For questions or request information reach out via Discord.
This document describes how to setup your local working environment in order to develop Messari subgraphs.
- Node & npm
- Some development experience
- Technical knowledge of blockchains (especially evm)
- Knowledge of The Graph (our beginner RESOURCES.md file will be a good starting place)
After installing Nodejs and npm you are close to done with installing all of the development dependencies. There are a few other npm packages to install globally:
This is really all that you need, but you can read more about The Graph packages here.
After cloning the repo and moving into the head of the repository you should install the project-level npm packages:
git clone https://github.com/thebadge/thebadge-subgraph.git
yarn install
In general we follow Google's styling guide as best we can. A few pointers to get you started:
- Always opt for
const
overlet
unless you have to change the value of the variable. - Use constants when you are hardcoding a value and use
CONSTANT_CASE
. - Otherwise, most variables should be in
camelCase
- File names should be in
camelCase
and we try to keep folder names to one word if possible. - To make your code more readable use early returns when things go wrong.
- When making a contract call you should always your
try...reverted
pattern outlined here.
From here you should be set to build, run, but what about deploy?
- First authenticate to TheGraph:
Configure your .env file: THE_GRAPH_DEV_TESTING_AUTH_TOKEN
# Run the following
$ yarn auth
- Then you can do
# development
$ yarn codegen
$ yarn build
$ yarn deploy:dev
You can learn more reading docs