Coder Social home page Coder Social logo

totemfi-stackingpool-subgraph's Introduction

Totem Subgraph

Running Instructions

The first step is to run a local node, by following the instructions at the docs. You can either run a node connected to a local ganache private network, or a node connected to a testnet (like ropsten) or mainnet.

The following commands illustrate the scenario to deploy a graph from information available at goerli testnet. So you also need to run the node connected to goerli.

Some of the steps require a Infura application id to be specified as an environment variable called PROJECT_ID.

yarn
yarn prepare:goerli
yarn codegen subgraph.goerli.yaml
yarn build subgraph.goerli.yaml
yarn create-local
yarn deploy-local

How to update contracts

  • need to replace deployment/ folder with latest compiled/deployed version from contracts project
  • replace abi/* with latest changes from contract
  • run above scripts

Run on the local env by Docker

To run the project on the local we suppose the latest version of contract has been deployed on the BSC TestNet and the latest ABIs are provided in the contracts/deployments/bsc_testnet folder. We also use the subgraph.template.dev.yaml as template for generating and building sub-graph, So the source addresses must be set correctly on it.

At this point the docker-compose uses a BSC TestNet node as a local node. Maybe in the future we use Ganache (or any other developing node) as a local node.

  1. Create two folders for Ipfs and PostgreSql file system next to the totem-subgraph folder:
cd ..
mkdir totem-subgraph-ipfs
mkdir totem-subgraph-postgres
cd totem-subgraph/
  1. Run the docker-compose local file:
docker-compose -f docker-compose-graph-localhost.yaml up -d
  1. Install node_modules:
yarn
  1. Now we can generate new sub-graph based on subgraph.template.dev.yaml template:
yarn prepare:bsc_testnet
yarn codegen subgraph.bsc_testnet.yaml
yarn build subgraph.bsc_testnet.yaml
  1. Deploy generated sub-graph to the graph-node:
yarn create-local
yarn deploy:bsc_testnet
  1. If everything goes well and the sub-graph deployed you can access the GrappQl panel of your sub-graph on this path by HTTPS & WS:
http://localhost:8000/subgraphs/name/totemfi/predictor/graphql

totemfi-stackingpool-subgraph's People

Contributors

sinatadayon avatar

Watchers

 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.