Hop Subgraph
The Hop Protocol Subgraph for The Graph.
Subgraphs
Development
Authenticate:
npx graph auth https://api.thegraph.com/deploy/ <access-token>
The access token is found on the hosted-service dashboard.
Build and deploy:
npm run build-deploy:mainnet
npm run build-deploy:polygon
npm run build-deploy:xdai
npm run build-deploy:optimism
npm run build-deploy:arbitrum
By 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:mainnet
The following subgraphs will need to be created on the dashboard:
hop-mainnet
hop-polygon
hop-xdai
hop-optimism
hop-arbitrum
Clean build files:
npm run clean
Deploying locally:
Update networks in docker-compose.yml
ethereum: 'optimism:https://mainnet.optimism.io'
Start containers:
docker-compose up
Create local subgraph:
npx graph create hop-protocol/hop-optimism --node http://127.0.0.1:8020
Deploy subgraph after building:
npx graph deploy --debug --ipfs http://localhost:5001 --node http://localhost:8020 hop-protocol/hop-optimism