cardano-foundation / cardano-rosetta-java

An implementation of Rosetta for cardano based yaci-store to offer reduced ressource footprints
https://www.rosetta-api.org
Apache License 2.0
8 stars 2 forks source link
blockchain cardano rosetta yaci-store

Quality Gate Status Coverage FOSSA Status

What the project is about?

This repository provides a lightweight java implementation of the Rosetta API. It uses Yaci-Store as an indexer to fetch the data from a Cardano node.

This component consists of:

This implementation follows the Rosetta API specification and is compatible with the Rosetta CLI. It contains some extensions to fit the needs of the Cardano blockchain. These changes are documented in the wiki.

Documentation

Detailed explanation to all components can be found in the wiki pages of this repository. It includes explanations about the Architecture, how to build and run the components and explanations to environment variables.

System requirements

Since Yaci-Store is a comparatively lightweight indexer, the system requirements are lower than for other chain indexers. The following are the recommended system requirements for running this component:

Better hardware will improve the performance of the indexer and the node, which will result in faster syncing times.

Installation

By default this Cardano-node will sync the entire chain from Genesis. This will take up to 48-72 hours (dependening on the system resources).

Docker (build from source)

If your user is not in the docker group you might have to execute these commands with sudo. The default config is focused on mainnet. If you want to test this on other Cardano netwoks (like preview or preprod) please adjust the docker/.env.dockerfile or read the Wiki page on Environment variables on other options and their default values.

    git clone https://github.com/cardano-foundation/cardano-rosetta-java
    cd cardano-rosetta-java
    docker build -t rosetta-java -f ./docker/Dockerfile .
    docker run --name rosetta -v {CUSTOM_MOUNT_PATH}:/node --env-file ./docker/.env.dockerfile -p 8082:8082 -d rosetta-java:1.0-rc4

Detailed explanation can be found in the Wiki.

Depending on using a snapshot feature or not, this will take X amount of time. You can follow along with the commands below. Your instance is ready when you see: DONE.

Useful commands:

Docker (using pre-built image)

For every Release we provide pre-built docker images stored in the DockerHub Repositories of the Cardano Foundation (DockerHub) To start it use the following command:

    docker run --name rosetta -v {CUSTOM_MOUNT_PATH}:/node --env-file ./docker/.env.dockerfile -p 8082:8082 -d cardanofoundation/cardano-rosetta-java:1.0-rc4

Changes to the configuration can be made by adjusting the docker/.env.dockerfile file. For more information on the environment variables, please refer to the Wiki.

If you want to use the cardano-submit-api you can additionally expose port 8090. It can then be used to submit raw cbor transaction (API documentation here: Link)

    docker run --name rosetta -v {CUSTOM_MOUNT_PATH}:/node --env-file ./docker/.env.dockerfile -p 8090:8090 -p 8082:8082 -d cardanofoundation/cardano-rosetta-java:1.0-rc4

Docker compose

If needed we also provide all components needed to run Rosetta in a docker-compose file. This will start:

    docker-compose --env-file .env.docker-compose -f docker-compose.yaml up -d 

Adjustments can be made by changing .env.docker-compose file. For more information on the environment variables, please refer to the Wiki.


Thanks for visiting us and enjoy :heart:!