Skip to content

Latest commit

 

History

History
91 lines (62 loc) · 3.31 KB

README.md

File metadata and controls

91 lines (62 loc) · 3.31 KB

BDJuno

GitHub Workflow Status Go Report Card Codecov branch

BDJuno (shorthand for BigDipper Juno) is the Juno implementation for BigDipper.

It extends the custom Juno behavior by adding different handlers and custom operations to make it easier for BigDipper showing the data inside the UI.

All the chains' data that are queried from the RPC and gRPC endpoints are stored inside a PostgreSQL database on top of which GraphQL APIs can then be created using Hasura.

Usage

To know how to setup and run BDJuno, please refer to the docs website.

Testing

If you want to test the code, you can do so by running

$ make test-unit

Note: Requires Docker.

This will:

  1. Create a Docker container running a PostgreSQL database.
  2. Run all the tests using that database as support.

Local launch in docker compose

  1. Create .bdjuno directory in the root of the repo and put there next two files:
    1. config.yaml which you can copy from config-sample.yaml. Do next change there:
      1. Replace YOUR_CHAIN_ACC_PREFIX with your account prefix(coredev is an example for devnet, you can use it too). This will let you have separate accounts with the same private keys for different chains.
      2. Replace YOUR_NODE_IP with cored address.
    2. genesis.json which you can find at cored /genesis endpoint(http://127.0.0.1:26557/genesis? for example). Take nested object:
      {
          "genesis": {this object}
      }
      
   
2. Build and start
```bash
docker-compose build && docker-compose up
  • Open hasura UI and check that it works correctly. The password is defined in docker-compose.yaml and set to "myadminsecretkey" by default.

Remarks

In case you run the bdjuno with the connection to old-running node you might face the error in the logs

error while getting staking pool: rpc error: code = Internal desc = UnmarshalJSON cannot decode empty bytes

This is expected since the node doesn't store all staking pool for all heights.

Custom params integration

In case you want to integrate the indexing if the custom types, for example parameters, that PR can be taken as a reference implementation.

Hasura API

GraphQL Schema

The GraphQL schema is located here. It describes all supported queries.

In order to export it you can run the hasura locally and execute script

npm install -g graphqurl # install the gq
gq http://localhost:8080/v1/graphql -H "X-Hasura-Admin-Secret: myadminsecretkey" --introspect > schema.graphql  # export schema

Pay attention that myadminsecretkey is the secret set for this repo local environment, and can be different for others.