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.
To know how to setup and run BDJuno, please refer to the docs website.
If you want to test the code, you can do so by running
$ make test-unit
Note: Requires Docker.
This will:
- Create a Docker container running a PostgreSQL database.
- Run all the tests using that database as support.
- Create
.bdjuno
directory in the root of the repo and put there next two files:config.yaml
which you can copy fromconfig-sample.yaml
. Do next change there:- 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. - Replace
YOUR_NODE_IP
withcored
address.
- Replace
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.
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.
In case you want to integrate the indexing if the custom types, for example parameters, that PR can be taken as a reference implementation.
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.