Coder Social home page Coder Social logo

basilisk-api's Introduction

Basilisk API

This project serves as the API for Basilisk's UIs, Dashboards and analytics.

Prerequisites

โš ๏ธ Make sure to have both the Basilisk-node and polkadot accessible and built using cargo build --release in the aforementioned directories. Otherwise the testnet scripts available in package.json won't work.

Quick start

# Start the local basilisk testnet
npm run testnet:start

# Start the local indexer targeting the basilisk node from the previous step
# If you need to debug the indexer, omit the `-d` option
npm run indexer:start -- -d

# Prepare the dev environment for the processor
npm run processor:clean-and-setup

# Start processing the indexed data
npm run processor:start

Generate custom types

  1. define custom types in ./chain/definitions.ts
  2. run processor:gen-chain-types

Configuration

Project's configuration is driven by environment variables, defined in .env, and manifest.yml. For more details see https://docs.subsquid.io.

Local testnet

Run npm run testnet:start and visit the Polkadot apps UI to observe new blocks being produced after a while.

Development indexer

Run npm run indexer:start to start a local indexer, which will index the locally running Basilisk node. Open Graphiql Online and use http://localhost:4010/v1/graphql as the GraphQL endpoint to interact with the indexer.

You can run the following query to get started:

query MyQuery {
  indexerStatus {
    inSync
    lastComplete
    chainHeight
  }
}

Apple M1 support

For Apple M1 support you need to build the indexer docker image locally:

git clone clone https://github.com/subsquid/hydra
cd hydra && ./scripts/docker-build.sh --target indexer-gateway -t subsquid/hydra-indexer-gateway:4

Development processor

Run npm run processor:clean-and-setup to setup the development environment. Then run npm run processor:start to start the processor.

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.