Skip to content

monadicus/mentat

Repository files navigation

Rosetta

Mentat

Overview

Mentat is a zero dependency framework that makes implementing and calling the Rosetta API for a myriad of Blockchains easier. It is written in Rust for high performance, and genercism such that it could be used for any Blockchain.

Features

  • Server.

    • Default Not Implemented Routes
    • Logging.
    • Default support for Offline and Online mode.
    • Easily run your Blockchain node with proper logging.
  • Client.

  • Keys(Different signature schemes are supported).

    • Aleo/Snarkos
  • Easy To Containerize.

System Requirements

Mentat itself is lightweight and easy to integrate anywhere. However, please refer to each Blockchain implementation using Mentat to see more requirements.

Usage

As specified in the Rosetta API Principles, all Rosetta implementations must be deployable via Docker and support running via either an online or offline mode.

YOU MUST INSTALL DOCKER FOR THE FOLLOWING INSTRUCTIONS TO WORK. YOU CAN DOWNLOAD DOCKER HERE.

Install

Running the following commands will create a Docker image called rosetta-snaroks:latest.

Change rosetta-snarkos with any other Mentat supported Blockchain.

From GitHub

To build the Docker image from the latest release, run:

docker build -t mentat-rosetta-snarkos:latest https://github.com/monadicus/mentat.git --build-arg SERVICE=rosetta-snarkos

Replace rosetta-snarkos with whatever service we offer.

From Source

After cloning this repository, and changing directory to a service run:

make build-local

Run

Running the following commands will start a Docker container in detached mode with a data directory at <working directory>/service-data and the Rosetta API accessible at port 8080.

Configuration Environment Variables

MAY VARY BETWEEN IMPLEMENTATIONS OF ROSETTA USING MENTAT.

  • MODE (optional) - Determines if Rosetta can make outbound connections. Options: ONLINE or OFFLINE (which defaults to ONLINE).
  • NETWORK (optional) - Service network to launch and/or communicate with. Options: MAINNET or TESTNET (which defaults to MAINNET).
  • PORT (required) - Which port to use for the Rosetta service.
Mainnet:Online
docker run -d --rm --ulimit "nofile=100000:100000" -v "$(pwd)/snarkos-data:/data" -e "MODE=ONLINE" -e "NETWORK=MAINNET" -e "PORT=8080" -p 8080:8080 -p 30303:30303 rosetta-snarkos:latest

If you cloned the repository, you can run make run-mainnet-online.

Mainnet:Online (Remote)
docker run -d --rm --ulimit "nofile=100000:100000" -e "MODE=ONLINE" -e "NETWORK=MAINNET" -e "PORT=8080" -p 8080:8080 -p 30303:30303 rosetta-snarkos:latest

If you cloned the repository, you can run make run-mainnet-remote.

Mainnet:Offline
docker run -d --rm -e "MODE=OFFLINE" -e "NETWORK=MAINNET" -e "PORT=8081" -p 8081:8081 rosetta-snarkos:latest

If you cloned the repository, you can run make run-mainnet-offline.

Testnet:Online
docker run -d --rm --ulimit "nofile=100000:100000" -v "$(pwd)/snarkos-data:/data" -e "MODE=ONLINE" -e "NETWORK=TESTNET" -e "PORT=8080" -p 8080:8080 -p 30303:30303 rosetta-snarkos:latest

If you cloned the repository, you can run make run-testnet-online.

Testnet:Online (Remote)
docker run -d --rm --ulimit "nofile=100000:100000" -e "MODE=ONLINE" -e "NETWORK=TESTNET" -e "PORT=8080" -p 8080:8080 -p 30303:30303 rosetta-snarkos:latest

If you cloned the repository, you can run make run-testnet-remote.

Testnet:Offline
docker run -d --rm -e "MODE=OFFLINE" -e "NETWORK=TESTNET" -e "PORT=8081" -p 8081:8081 rosetta-snarkos:latest

If you cloned the repository, you can run make run-testnet-offline.

Testing

TODO @MACS-J1149

Issues

Interested in helping fix issues in this repository? You can find to-dos in the Issues section.

Development

  • cargo +nightly fmt --check --all To check the formatting of the source code and all rosetta implementations.
  • cargo clippy --all To lint the formatting of the source code and all rosetta implementations.
  • make build-local SERVICE=rosetta-snarkos BRANCH=main To build the local docker image. The arguments are optional and default to shown values.

License

This project is available open source under the terms of the MIT License.

© 2022 Monadicus

About

A Rust-based implementation of the Coinbase Rosetta SDK

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages