The subgraph for ERC20.
- Linux:
/etc/hosts
- Windows:
C:\Windows\System32\drivers\etc\hosts
test:
ping graph-node
Suggest to use node v18, the package.json requires:
- node >= 18.0.0
- yarn >= 1.22.0
git clone https://github.com/gzliudan/erc20-subgraph
cd erc20-subgraph
yarn
yarn make:apothem && yarn create:apothem && yarn deploy:apothem
yarn make:xinfin && yarn create:xinfin && yarn deploy:xinfin
Endpoints:
- apothem network: http://graph-node:8000/subgraphs/name/gzliudan/test-coin-subgraph-apothem
- xinfin network: http://graph-node:8000/subgraphs/name/gzliudan/test-coin-subgraph-xinfin
Query statement:
{
erc20Contracts(first: 5) {
id
asAccount {
id
}
name
symbol
decimals
totalSupply {
value
valueExact
}
}
accounts(first: 5) {
id
asErc20 {
id
}
Erc20balances {
id
value
valueExact
}
}
}