API used for the Iron Fish Block Explorer.
The architecture is as follow
One instance: Database <- Syncer -> Iron Fish node
Other instance API -> Database
The block explorer client connects to the API. It allows scaling the API and the database, while still needing only one Iron Fish node and one Syncer.
yarnDepends on Postgres
brew install postgresql
brew services start postgresql
createdb rosetta;
psql rosetta
CREATE USER postgres;
grant all privileges on database rosetta to postgres;
ALTER SCHEMA public OWNER to postgres;# Create a migration
yarn run migrate create my migration
# Run the migration
yarn run migrate up
# Rollback
yarn run migrate downRun dev environment and access http://localhost:8000/docs/
brew services start postgresql
yarn dev
Starting the API:
yarn
yarn build
yarn start
Starting the Syncer:
yarn
yarn build
yarn start:syncer
Start an Iron Fish node with
ironfish start --rpc.tcp --rpc.tcp.port=8021The repository is using OpenAPI 3.0 from the Coinbase Rosetta specs. Find the latest version here
Copy the specs in the root
cp -rf ../node_modules/rosetta-specifications ./rosetta-specifications
Run make gen in ./rosetta-specifications
Update the type file:
- run
yarn api:types
Install Rosetta CLI https://github.com/coinbase/rosetta-cli
Run:
rosetta-cli view:networksto see the networks ...