Skip to content

Latest commit

 

History

History
105 lines (69 loc) · 1.82 KB

File metadata and controls

105 lines (69 loc) · 1.82 KB

ironfish-rosetta-api

codecov

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.

Installation

yarn

Database

Depends 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;

Run migration

# Create a migration
yarn run migrate create my migration
# Run the migration
yarn run migrate up
# Rollback
yarn run migrate down

Documentation

Run dev environment and access http://localhost:8000/docs/

Development

brew services start postgresql
yarn dev

Production

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=8021

Updating or creating a new API endpoint

The 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

Testing the Rosetta integration

Install Rosetta CLI https://github.com/coinbase/rosetta-cli

Run:

  • rosetta-cli view:networks to see the networks ...