The Hop Protocol Subgraph for The Graph.
Mainnet
Goerli
npx graph auth https://api.thegraph.com/deploy/ <access-token>The access token is found on the hosted-service dashboard.
npm run build-deploy:mainnet
npm run build-deploy:mainnet-subgraph-studio
npm run build-deploy:polygon
npm run build-deploy:xdai
npm run build-deploy:optimism
npm run build-deploy:arbitrum
# testnet
npm run build-deploy:goerli
npm run build-deploy:mumbai
npm run build-deploy:optimism-goerliBy default, it will deploy under hop-protocol github org.
Set GITHUB_ORG to deploy another a different account.
Example:
GITHUB_ORG=<github-username> npm run build-deploy:mainnetThe following subgraphs will need to be created on the dashboard:
hop-mainnethop-polygonhop-xdaihop-optimismhop-arbitrumhop-goerlihop-mumbaihop-optimism-goerli
npm run cleanUpdate networks in docker-compose.yml:
For Optimism Regenesis:
ethereum: 'optimism:https://mainnet-replica-4.optimism.io'For Arbitrum Nova:
ethereum: 'nova:https://nova.arbitrum.io/rpc'For zkSync:
ethereum: 'zksync:https://zksync2-testnet.zksync.dev'For Linea (Goerli):
ethereum: 'linea-goerli:https://consensys-zkevm-goerli-prealpha.infura.io/v3/YOUR_PROJECT_ID'For Base (Goerli):
ethereum: 'base-goerli:https://goerli.base.org'Start containers:
docker-compose upCreate local subgraph (in another terminal):
For Optimism Regenesis:
npx graph create hop-protocol/hop-optimism --node http://127.0.0.1:8020For Arbitrum Nova:
npx graph create hop-protocol/hop-nova --node http://127.0.0.1:8020For zkSync:
npx graph create hop-protocol/hop-zksync --node http://127.0.0.1:8020For Linea (Goerli):
npx graph create hop-protocol/hop-linea-goerli --node http://127.0.0.1:8020For Base (Goerli):
npx graph create hop-protocol/hop-base-goerli --node http://127.0.0.1:8020Deploy subgraph after building (add this line at the bottom of buildfiles.template.sh and comment out existing npx graph deploy line):
For Optimism Regenesis:
npx graph deploy --ipfs http://localhost:5001 --node http://localhost:8020 hop-protocol/hop-optimismFor Arbitrum Nova:
npx graph deploy --ipfs http://localhost:5001 --node http://localhost:8020 hop-protocol/hop-novaFor zkSync:
npx graph deploy --ipfs http://localhost:5001 --node http://localhost:8020 hop-protocol/hop-zksyncFor Linea (Goerli):
npx graph deploy --ipfs http://localhost:5001 --node http://localhost:8020 hop-protocol/hop-linea-goerliFor Base (Goerli):
npx graph deploy --ipfs http://localhost:5001 --node http://localhost:8020 hop-protocol/hop-base-goerliBuild and deploy:
For Optimism Regenesis:
npm run build-deploy:optimismFor Arbitrum Nova:
npm run build-deploy:novaFor zkSync:
npm run build-deploy:zksyncFor Linea (Goerli):
npm run build-deploy:linea-goerliFor Base (Goerli):
npm run build-deploy:base-goerliQuery subgraphs
For Optimism Regenesis:
http://localhost:8000/subgraphs/name/hop-protocol/hop-optimism
For Arbitrum Nova:
http://localhost:8000/subgraphs/name/hop-protocol/hop-nova
For zkSync:
http://localhost:8000/subgraphs/name/hop-protocol/hop-zksync
For Linea:
http://localhost:8000/subgraphs/name/hop-protocol/hop-linea-goerli
For Base:
http://localhost:8000/subgraphs/name/hop-protocol/hop-base-goerli