Files
stacks-blockchain-api/README-rosetta.md
wileyj b050b1bf2a chore: update rosetta dockerfile (#1651)
* Rewrite of rosetta dockerfile

This close to a full rewrite of the built image.
- runit is removed
- `/entrypoint.sh` now starts all processes via single script
- all logs are piped to stdout
- remove printf in favor of heredoc
- add a script to seed the chainstate when env var `SEED_CHAINSTATE=true`
- adds a postgres init script in case of genesis sync and DB != `postgres`

* chore - address PR comments

updating docs where stx-rosetta is used
add some docs around `SEED_CHAINSTATE`
add -W to pg_ctl and removing sleep
2023-05-19 11:14:02 +02:00

1.4 KiB

Testing the Rosetta APIs

Build and run the rosetta.Dockerfile image:

docker build -t rosetta:stable -f rosetta.Dockerfile .
docker run -d -p 3999:3999 --mount source=rosetta-data,target=/data \
    --name rosetta rosetta:stable

By default, this will connect to the testnet. To run a local node, run

docker run -d -p 3999:3999 --mount source=rosetta-data,target=/data \
    --name rosetta -e STACKS_NETWORK=mocknet rosetta:stable

Optionally, you can seed the chainstate for testnet/mainnet using Hiro archive data:

docker run -d -p 3999:3999 --mount source=rosetta-data,target=/data \
        --name rosetta -e SEED_CHAINSTATE=true rosetta:stable

Use a recent version of rosetta-cli to test the endpoints:

rosetta-cli --configuration-file rosetta-cli-config/rosetta-config.json \
    view:block 1

rosetta-cli --configuration-file rosetta-cli-config/rosetta-config.json \
    check:data

rosetta-cli will sync with the blockchain until it reaches the tip, and then exit, displaying the test results.

At present, account reconciliation is disabled; proper testing of that requires token transfer transactions while rosetta-cli is running.

Documentation for the Rosetta APIs can be found at

https://hirosystems.github.io/stacks-blockchain-api/