Skip to content

superboyiii/subgraph

 
 

Repository files navigation

Hop Subgraph

The Hop Protocol Subgraph for The Graph.

Subgraphs

Mainnet

Goerli

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: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-goerli

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
  • hop-goerli
  • hop-mumbai
  • hop-optimism-goerli

Clean build files:

npm run clean

Deploying locally:

Update 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 up

Create local subgraph (in another terminal):

For Optimism Regenesis:

npx graph create hop-protocol/hop-optimism --node http://127.0.0.1:8020

For Arbitrum Nova:

npx graph create hop-protocol/hop-nova --node http://127.0.0.1:8020

For zkSync:

npx graph create hop-protocol/hop-zksync --node http://127.0.0.1:8020

For Linea (Goerli):

npx graph create hop-protocol/hop-linea-goerli --node http://127.0.0.1:8020

For Base (Goerli):

npx graph create hop-protocol/hop-base-goerli --node http://127.0.0.1:8020

Deploy 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-optimism

For Arbitrum Nova:

npx graph deploy --ipfs http://localhost:5001 --node http://localhost:8020 hop-protocol/hop-nova

For zkSync:

npx graph deploy --ipfs http://localhost:5001 --node http://localhost:8020 hop-protocol/hop-zksync

For Linea (Goerli):

npx graph deploy --ipfs http://localhost:5001 --node http://localhost:8020 hop-protocol/hop-linea-goerli

For Base (Goerli):

npx graph deploy --ipfs http://localhost:5001 --node http://localhost:8020 hop-protocol/hop-base-goerli

Build and deploy:

For Optimism Regenesis:

npm run build-deploy:optimism

For Arbitrum Nova:

npm run build-deploy:nova

For zkSync:

npm run build-deploy:zksync

For Linea (Goerli):

npm run build-deploy:linea-goerli

For Base (Goerli):

npm run build-deploy:base-goerli

Query 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

License

MIT

About

🇬 The Hop Protocol v1 Subgraphs for The Graph

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 91.7%
  • Shell 6.1%
  • JavaScript 1.3%
  • Solidity 0.9%