Skip to content

Commit

Permalink
feat: Migration from TheGraph to GoldSky for LightBridge
Browse files Browse the repository at this point in the history
  • Loading branch information
wsdt committed Dec 17, 2023
1 parent 01877b3 commit a47d36e
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 11 deletions.
3 changes: 2 additions & 1 deletion packages/boba/subgraph/L2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"create:subgraph:goerli": "graph create --node https://graph.goerli.boba.network:8020 boba/Bridges",
"deploy:subgraph:local": "graph deploy boba/Bridges --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"deploy:subgraph:goerli": "graph deploy boba/Bridges --ipfs https://graph.goerli.boba.network:5001 --node https://graph.goerli.boba.network:8020",
"deploy:subgraph:mainnet": "graph deploy --product hosted-service BOBANETWORK/boba-l2-subgraph"
"deploy:subgraph:mainnet": "graph deploy --product hosted-service BOBANETWORK/boba-l2-subgraph",
"deploy:goldsky": "goldsky subgraph deploy light-bridge/v1 --from-abi ./subgraph.json"
},
"devDependencies": {
"@graphprotocol/graph-cli": "^0.55.0",
Expand Down
48 changes: 48 additions & 0 deletions packages/boba/subgraph/L2/subgraph.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"version": "1",
"name": "light-bridge",
"abis": {
"Teleportation": {
"path": "./abis/Teleportation.json"
}
},
"chains": ["arbitrum-goerli", "chapel", "boba-bnb-testnet", "boba-goerli", "goerli", "optimism-goerli"],
"instances": [
{
"abi": "Teleportation",
"address": "0x7f6a32bCaA70c65E08F2f221737612F6fC18347A",
"startBlock": 32272487,
"chain": "chapel"
},
{
"abi": "Teleportation",
"address": "0x84b22166366a6f7E0cD0c3ce9998f2913Bf17A13",
"startBlock": 9484025,
"chain": "goerli"
},
{
"abi": "Teleportation",
"address": "0xC226F132A686A08018431C913d87693396246024",
"startBlock": 17010097,
"chain": "optimism-goerli"
},
{
"abi": "Teleportation",
"address": "0x7063f59e1Db3e505D844d11A71C78F92D39E5963",
"startBlock": 53880808,
"chain": "arbitrum-goerli"
},
{
"abi": "Teleportation",
"address": "0xf4d179d3a083Fa3Eede935FaF4C679D32d514186",
"startBlock": 295353,
"chain": "boba-bnb-testnet"
},
{
"abi": "Teleportation",
"address": "0xB43EE846Aa266228FeABaD1191D6cB2eD9808894",
"startBlock": 40822,
"chain": "boba-goerli"
}
]
}
10 changes: 10 additions & 0 deletions packages/boba/subgraph/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 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.
Expand Down
16 changes: 6 additions & 10 deletions packages/boba/teleportation/src/utils/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const BobaChains: IBobaChains = {

//#region boba_networks
288: {
// TODO: seemingly no public graph node available (would require hosted_service or deploying it ourselves) --> boba listed though, but requires a hosted service
url: process.env.TELEPORTATION_RPC_BOBAETHMAINNET ?? 'https://boba-ethereum.gateway.tenderly.co',
testnet: false,
name: 'Boba Ethereum Mainnet',
Expand All @@ -41,7 +40,6 @@ export const BobaChains: IBobaChains = {
},
},
56288: {
// TODO: seemingly no public graph node available (would require hosted_service or deploying it ourselves)
url: process.env.TELEPORTATION_RPC_BOBABNBMAINNET ?? 'https://replica.bnb.boba.network',
testnet: false,
name: 'Boba BNB Mainnet',
Expand All @@ -53,7 +51,7 @@ export const BobaChains: IBobaChains = {
},
},
2888: {
// TODO: seemingly no public graph node available (would require hosted_service or deploying it ourselves)
// GoldSky GraphQL endpoint: https://api.goldsky.com/api/public/project_clq6jph4q9t2p01uja7p1f0c3/subgraphs/light-bridge-boba-goerli/v1/gn
url: process.env.TELEPORTATION_RPC_BOBAETHGOERLI ?? 'https://replica.goerli.boba.network',
testnet: true,
name: 'Boba Ethereum Goerli',
Expand All @@ -65,7 +63,7 @@ export const BobaChains: IBobaChains = {
},
},
9728: {
// TODO: seemingly no public graph node available (would require hosted_service or deploying it ourselves)
// GoldSky GraphQL endpoint: https://api.goldsky.com/api/public/project_clq6jph4q9t2p01uja7p1f0c3/subgraphs/light-bridge-boba-bnb-testnet/v1/gn
url: process.env.TELEPORTATION_RPC_BOBABNBTESTNET ?? 'https://boba-bnb-testnet.gateway.tenderly.co',
testnet: true,
name: 'Boba BNB Testnet',
Expand All @@ -78,6 +76,7 @@ export const BobaChains: IBobaChains = {
},
},
421613: {
// GoldSky GraphQL endpoint: https://api.goldsky.com/api/public/project_clq6jph4q9t2p01uja7p1f0c3/subgraphs/light-bridge-arbitrum-goerli/v1/gn
url: process.env.TELEPORTATION_RPC_ARBITRUMGOERLI ?? 'https://arbitrum-goerli.public.blastapi.io',
testnet: true,
name: 'Arbitrum Goerli',
Expand All @@ -88,6 +87,7 @@ export const BobaChains: IBobaChains = {
},
},
420: {
// GoldSky GraphQL endpoint: https://api.goldsky.com/api/public/project_clq6jph4q9t2p01uja7p1f0c3/subgraphs/light-bridge-optimism-goerli/v1/gn
url: process.env.TELEPORTATION_RPC_OPTIMISMGOERLI ?? 'https://optimism-goerli.publicnode.com',
testnet: true,
name: 'Optimism Goerli',
Expand All @@ -98,7 +98,6 @@ export const BobaChains: IBobaChains = {
},
},
42161: {
// TODO: seemingly no public graph node available (would require hosted_service or deploying it ourselves)
url: process.env.TELEPORTATION_RPC_ARBITRUMMAINNET ?? 'https://arbitrum.llamarpc.com',
testnet: false,
name: 'Arbitrum Mainnet',
Expand All @@ -109,7 +108,6 @@ export const BobaChains: IBobaChains = {
},
},
10: {
// TODO: seemingly no public graph node available (would require hosted_service or deploying it ourselves)
url: process.env.TELEPORTATION_RPC_OPTIMISMMAINNET ?? 'https://optimism.llamarpc.com',
testnet: false,
name: 'Optimism Mainnet',
Expand All @@ -122,7 +120,6 @@ export const BobaChains: IBobaChains = {
//#endregion
//#region l1
1: {
// TODO: Public nodes available, deploy once contract is live
url: process.env.TELEPORTATION_RPC_ETHMAINNET ?? 'https://eth.llamarpc.com',
testnet: false,
name: 'Ethereum Mainnet',
Expand All @@ -136,7 +133,6 @@ export const BobaChains: IBobaChains = {
},
},
56: {
// TODO: Public nodes available, deploy once contract is live
url: process.env.TELEPORTATION_RPC_BNBMAINNET ?? 'https://rpc.ankr.com/bsc',
testnet: false,
name: 'BNB Mainnet',
Expand All @@ -150,7 +146,7 @@ export const BobaChains: IBobaChains = {
},
},
5: {
// TODO: DEV VERSION (GRT tokens needed): subgraph deployed: https://api.studio.thegraph.com/query/57436/boba_bridges/version/latest
// GoldSky GraphQL endpoint: https://api.goldsky.com/api/public/project_clq6jph4q9t2p01uja7p1f0c3/subgraphs/light-bridge-goerli/v1/gn
url: process.env.TELEPORTATION_RPC_GOERLITESTNET ?? 'https://rpc.ankr.com/eth_goerli',
testnet: true,
name: 'Goerli Testnet',
Expand All @@ -164,7 +160,7 @@ export const BobaChains: IBobaChains = {
},
},
97: {
// TODO: seemingly no public graph node available (would require hosted_service or deploying it ourselves)
// GoldSky GraphQL endpoint: https://api.goldsky.com/api/public/project_clq6jph4q9t2p01uja7p1f0c3/subgraphs/light-bridge-chapel/v1/gn
url: process.env.TELEPORTATION_RPC_BNBTESTNET ?? 'https://api.zan.top/node/v1/bsc/testnet/public',
testnet: true,
name: 'BNB Testnet',
Expand Down

0 comments on commit a47d36e

Please sign in to comment.