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.
-
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.
Mentat
itself is lightweight and easy to integrate anywhere.
However, please refer to each Blockchain implementation using Mentat
to see more requirements.
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.
Running the following commands will create a Docker image called rosetta-snaroks:latest
.
Change rosetta-snarkos
with any other Mentat supported Blockchain.
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.
After cloning this repository, and changing directory to a service run:
make build-local
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
.
MAY VARY BETWEEN IMPLEMENTATIONS OF ROSETTA USING MENTAT.
MODE
(optional) - Determines if Rosetta can make outbound connections. Options:ONLINE
orOFFLINE
(which defaults toONLINE
).NETWORK
(optional) - Service network to launch and/or communicate with. Options:MAINNET
orTESTNET
(which defaults toMAINNET
).PORT
(required) - Which port to use for the Rosetta service.
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
.
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
.
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
.
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
.
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
.
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
.
TODO @MACS-J1149
Interested in helping fix issues in this repository? You can find to-dos in the Issues section.
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.
This project is available open source under the terms of the MIT License.
© 2022 Monadicus