Using The Graph
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.
1
yarn global add @graphprotocol/graph-cli
2
yarn global add --dev @graphprotocol/graph-ts
Copied!

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, Rinkeby, and Boba-Rinkeby. A deploy key or access token is required to deploy subgraphs. Depending on which chain you are indexing, provide either mainnet or rinkeby as a setting to yarn prepare:.

L1 Subgraphs

(below command untested)
1
graph auth --product hosted-service <ACCESS_TOKEN>
2
# or, graph auth --studio $DEPLOY_KEY
3
cd L1
4
yarn install
5
yarn prepare:mainnet
6
# or, yarn prepare:rinkeby
7
yarn codegen
8
yarn build
9
graph deploy --product hosted-service BOBANETWORK/boba-l2-subgraph
10
# or, graph deploy --studio boba-network-rinkeby
Copied!

L2 Subgraphs

(Below commands tested for deploy to Boba mainnet)
1
graph auth --product hosted-service <ACCESS_TOKEN>
2
# or, graph auth --studio $DEPLOY_KEY
3
cd L2
4
yarn install
5
yarn prepare:mainnet
6
# or, yarn prepare:rinkeby
7
yarn codegen
8
yarn build
9
graph deploy --product hosted-service BOBANETWORK/boba-l2-subgraph
10
# or, yarn deploy:subgraph:rinkeby
Copied!
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:
1
# L2 Boba Mainnet Query
2
3
curl -g -X POST \
4
-H "Content-Type: application/json" \
5
-d '{"query":"{ governorProposalCreateds {proposalId values description proposer}}"}' \
6
https://api.thegraph.com/subgraphs/name/bobanetwork/boba-l2-subgraph
Copied!
1
# L2 Boba Rinkeby Query
2
3
curl -g -X POST \
4
-H "Content-Type: application/json" \
5
-d '{"query":"{ governorProposalCreateds {proposalId values description proposer}}"}' \
6
https://graph.rinkeby.boba.network/subgraphs/name/boba/Bridges
Copied!

Querying

  • The Mainnet Graph Node is hosted by The Graph. Visit https://thegraph.com/hosted-service/ to deploy your subgraphs. You can experiment here: bobanetwork/boba-l2-subgraph.
  • Rinkeby endpoint: https://graph.rinkeby.boba.network. You can experiment here: boba/Bridges/graphql
Port
Purpose
Routes
URL
Permission
8000
GraphQL HTTP server
/subgraphs/name/.../...
https://graph.rinkeby.boba.network https://graph.rinkeby.boba.network:8000
Public
8020
JSON-RPC (for managing deployments)
/
https://graph.rinkeby.boba.network:8020
Private
8030
Subgraph indexing status API
/graphql
https://graph.rinkeby.boba.network:8030
Public
8040
Prometheus metrics
/metrics
https://graph.rinkeby.boba.network:8040
Public