|
7 | 7 | This repository provides a lightweight java implementation of the [Rosetta API](https://github.com/coinbase/mesh-specifications). It uses [Yaci-Store](https://github.com/bloxbean/yaci-store) as an indexer
|
8 | 8 | to fetch the data from a Cardano node.
|
9 | 9 |
|
| 10 | +This component consists of: |
| 11 | +- a full Cardano node |
| 12 | +- a Cardano Submit API |
| 13 | +- an indexer which stores data in Postgres |
| 14 | +- the Mesh (formerly Rosetta) API |
| 15 | + |
| 16 | +This implementation follows the [Rosetta API](https://docs.cdp.coinbase.com/mesh/docs/api-reference/) specification and is compatible with the [Rosetta CLI](https://docs.cdp.coinbase.com/mesh/docs/mesh-cli/). |
| 17 | +It contains some extensions to fit the needs of the Cardano blockchain. These changes are documented in the [wiki](https://github.com/cardano-foundation/cardano-rosetta-java/wiki/2.-Cardano-Specific-API-Additions). |
10 | 18 |
|
11 | 19 | ## Documentation
|
| 20 | +Detailed explanation to all components can be found in the [wiki pages](https://github.com/cardano-foundation/cardano-rosetta-java/wiki) of this repository. |
| 21 | +It includes explanations about the Architecture, how to build and run the components and explanations to environment variables. |
| 22 | + |
| 23 | +## System requirements |
| 24 | +Since [Yaci-Store](https://github.com/bloxbean/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: |
| 25 | +- 4CPU Cores |
| 26 | +- 32GB RAM |
| 27 | +- 400GB of storage |
| 28 | + |
| 29 | +Better hardware will improve the performance of the indexer and the node, which will result in faster syncing times. |
| 30 | + |
| 31 | +## Installation |
| 32 | +By default this Cardano-node will sync the entire chain from Genesis. |
| 33 | +This will take up to 48-72 hours (dependening on the system resources). |
| 34 | + |
| 35 | +### Docker (build from source) |
| 36 | +If your user is not in the `docker` group you might have to execute these commands with `sudo`. |
| 37 | +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](https://github.com/cardano-foundation/cardano-rosetta-java/wiki/5.-Environment-Variables) on other options and their default values. |
| 38 | + |
| 39 | +```bash |
| 40 | + git clone https://github.com/cardano-foundation/cardano-rosetta-java |
| 41 | + cd cardano-rosetta-java |
| 42 | + docker build -t rosetta-java -f ./docker/Dockerfile . |
| 43 | + docker run --name rosetta --env-file ./docker/.env.dockerfile -p 8082:8082 -d rosetta-java:latest |
| 44 | +``` |
| 45 | +Detailed explanation can be found in the [Wiki](https://github.com/cardano-foundation/cardano-rosetta-java/wiki/3.-Getting-Started-with-Docker). |
| 46 | + |
| 47 | +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`. |
| 48 | + |
| 49 | +**Useful commands:** |
| 50 | +- Following Docker container logs: |
| 51 | +```bash |
| 52 | + docker logs rosetta -f |
| 53 | +``` |
| 54 | +- Access node logs: |
| 55 | +```bash |
| 56 | + docker exec rosetta tail -f /logs/node.log |
| 57 | +``` |
| 58 | +- Interactive access to container: |
| 59 | +```bash |
| 60 | + docker exec -it rosetta bash # direct bash access within the container |
| 61 | + |
| 62 | + |
| 63 | + # Useful commands within the container |
| 64 | + cardano-cli query tip --mainnet # check node sync status |
| 65 | + tail -f /logs/node.log # follow node logs |
| 66 | + tail -f /logs/indexer.log # follow indexer logs |
| 67 | +``` |
| 68 | + |
| 69 | +### Docker (using pre-built image) |
| 70 | +For every Release we provide pre-built docker images stored in the DockerHub Repositories of the Cardano Foundation ([DockerHub](https://hub.docker.com/orgs/cardanofoundation/repositories)) |
| 71 | +To start it use the following command: |
| 72 | +```bash |
| 73 | + docker run --name rosetta --env-file ./docker/.env.dockerfile -p 8082:8082 -d cardanofoundation/cardano-rosetta-java:latest |
| 74 | +``` |
| 75 | +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](https://github.com/cardano-foundation/cardano-rosetta-java/wiki/5.-Environment-Variables). |
| 76 | + |
| 77 | +### Docker compose |
| 78 | +If needed we also provide all components needed to run Rosetta in a docker-compose file. |
| 79 | +This will start: |
| 80 | +- Cardano-node |
| 81 | +- Cardano-Submit-API |
| 82 | +- Yaci-Store |
| 83 | +- Rosetta-API |
| 84 | +- Postgres |
12 | 85 |
|
13 |
| -Please refer to our [wiki pages](https://github.com/cardano-foundation/cardano-rosetta-java/wiki) for more information on the project. |
| 86 | +```bash |
| 87 | + docker-compose --env-file .env.docker-compose -f docker-compose.yaml up -d |
| 88 | +``` |
| 89 | +Adjustments can be made by changing `.env.docker-compose` file. For more information on the environment variables, please refer to the [Wiki](https://github.com/cardano-foundation/cardano-rosetta-java/wiki/5.-Environment-Variables). |
14 | 90 |
|
15 | 91 | ---
|
16 |
| -Thanks for visiting us and enjoy :heart:! |
| 92 | +Thanks for visiting us and enjoy :heart:! |
0 commit comments