Code Monkey home page Code Monkey logo

bdjuno's Introduction

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.

bdjuno's People

Contributors

riccardom avatar monikacat avatar dependabot[bot] avatar dzmitryhil avatar wojtek-coreum avatar huichiaotsou avatar alinetskyi avatar harleyapplechoi avatar tiljrd avatar kwunyeung avatar vertex451 avatar ysv avatar miladz68 avatar akhlopiachyi avatar maiquanghiep avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.