pancake-v2-subgraph
pancake-v2-subgraph copied to clipboard
Change subgraph.yaml to use network BSC
Node that I run a local graph node and define my ethereum network as bsc:http://hode.url
your subgraph.yaml specifies the network as mainnet. graphnode recommends using network bsc for bsc, so this basically always breaks. I just changed 2 lines in the package.yaml and everything worked fine.
note I also changed to start at block 5 million because we only need recent data in our local copy of the graph:
specVersion: 0.0.2
description: Pancakeswap Masterchef
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum/contract
name: MasterChef
network: bsc
source:
address: "0x73feaa1eE314F8c655E354234017bE2193C9E24E"
abi: MasterChef
startBlock: 5000000
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
entities:
- MasterChef
- History
- Pool
- PoolHistory
abis:
- name: MasterChef
file: ./abis/MasterChef.json
- name: PairContract
file: ./abis/PairContract.json
eventHandlers:
- event: Deposit(indexed address,indexed uint256,uint256)
handler: deposit
- event: Withdraw(indexed address,indexed uint256,uint256)
handler: withdraw
# callHandlers:
# - function: add(uint256,address,bool)
# handler: add
# - function: set(uint256,uint256,bool)
# handler: set
# - function: updatePool(uint256)
# handler: updatePool
# - function: dev(address)
# handler: dev
file: ./src/masterchef.ts
```
@ChefKai mind taking a look, or is there a way I can fork and submit a pr?