- Create a new subgraph in The Graph Hosted service
You will then have a username/subgraphname
that you will use later.
- Clone the repo:
git clone git@github.com:dabit3/erc20-subgraph-starter.git
- Install dependencies
npm install
# or
yarn
- Update the
deploy
script inpackage.json
to match the name of your subgraph:
"deploy": "graph deploy --node https://api.thegraph.com/deploy/ dabit3/erc20subgraphtst"
# update
dabit3/erc20subgraphtst"
# to
your-username/your-subgraphname"
- Authenticate
graph auth
- Deploy
yarn deploy
Example query
{
accounts {
ERC20balances {
id
value
contract {
name
}
}
}
}