Skip to content

Latest commit

 

History

History
109 lines (77 loc) · 4.71 KB

README.md

File metadata and controls

109 lines (77 loc) · 4.71 KB

Goldsky migration

Light bridge has been migrated to Goldsky, more contracts may follow (we may need to evaluate which subgraphs are still needed).

You need only one config file: subgraph.json This one has to be adapted manually, but the rest is automized.

Just execute goldsky subgraph deploy light-bridge/v{VERSION} --from-abi ./subgraph.json to deploy the subgraphs on all supported networks.


Boba Network Subgraphs

These subgraphs index the StandardBridge, the LiquidityPool, the Boba DAO, and the TuringMonster contracts.

Requirements

The global graph is required to deploy to The Graph. Make sure that you have various packages installed.

yarn global add @graphprotocol/graph-cli
yarn global add --dev @graphprotocol/graph-ts

Building & Running

First, cd to either the L1 or the L2 folders, depending on where you will be deploying your subgraphs to. There are four subgraphs: Ethereum, Boba, Goerli, and Boba-Goerli. A deploy key or access token is required to deploy subgraphs. Depending on which chain you are indexing, provide either mainnet or goerli as a setting to yarn prepare:.

L1 Subgraphs

(below command untested)

graph auth --product hosted-service <ACCESS_TOKEN>
# or, graph auth --studio $DEPLOY_KEY
cd L1
yarn install
yarn prepare:mainnet
# or, yarn prepare:goerli
yarn codegen
yarn build
graph deploy --product hosted-service BOBANETWORK/boba-l2-subgraph
# or, graph deploy --studio boba-network-goerli

L2 Subgraphs

(Below commands tested for deploy to Boba mainnet)

graph auth --product hosted-service <ACCESS_TOKEN>
# or, graph auth --studio $DEPLOY_KEY
cd L2
yarn install
yarn prepare:mainnet
# or, yarn prepare:goerli
yarn codegen
yarn build
graph deploy --product hosted-service BOBANETWORK/boba-l2-subgraph
# or, yarn deploy:subgraph:goerli

NOTE: When you log into https://thegraph.com/hosted-service/dashboard, you may have more than one account. Make sure that you are using the ACCESS_TOKEN associated with the correct account, otherwise your depoyment will fail. You can cycle through your multiple accounts by clicking on your GitHub user ID or whatever other account is displayed next to your user Avatar.

Example

Here is some example queries to get you started:

# L2 Boba Mainnet Query

  curl -g -X POST \
    -H "Content-Type: application/json" \
    -d '{"query":"{ governorProposalCreateds {proposalId values description proposer}}"}' \
    https://api.thegraph.com/subgraphs/name/bobanetwork/boba-l2-subgraph
# L2 Boba Goerli Query

  curl -g -X POST \
    -H "Content-Type: application/json" \
    -d '{"query":"{ governorProposalCreateds {proposalId values description proposer}}"}' \
    https://graph.goerli.boba.network/subgraphs/name/boba/Bridges

Querying

Port Purpose Routes URL Permission
8000 GraphQL HTTP server /subgraphs/name/.../... https://graph.goerli.boba.network
https://graph.goerli.boba.network:8000
Public
8020 JSON-RPC
(for managing deployments)
/ https://graph.goerli.boba.network:8020 Private
8030 Subgraph indexing status API /graphql https://graph.goerli.boba.network:8030 Public
8040 Prometheus metrics /metrics https://graph.goerli.boba.network:8040 Public

Local setup

  1. Run local hardhat node and fork network: npx hardhat node --fork https://replica.goerli.boba.network --hostname 0.0.0.0
  2. Clone graph-node
  3. Replace mainnet: with boba: in the ethereum: property.
  4. Run docker-compose up in the ./docker directory of the repo.
  5. Use the *:local commands from the package.json in the boba repo.
  6. The GraphQL interface will be available here: http://127.0.0.1:8000/subgraphs/name/boba/Bridges