Skip to content

Commit

Permalink
Merge branch 'migrate-subgraphs' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAurelius committed Apr 30, 2024
2 parents 9d52ea4 + ce88d47 commit f1a42ca
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

from web3 import Web3

# Hard-coded since Polygon block times have stabilized
Expand Down Expand Up @@ -39,7 +41,18 @@
DAO_WALLET_ADDRESS = Web3.to_checksum_address('0x65a5076c0ba74e5f3e069995dc3dab9d197d995c')

# Subgraphs
KLIMA_PROTOCOL_SUBGRAPH = 'https://api.thegraph.com/subgraphs/name/klimadao/klimadao-protocol-metrics'
KLIMA_CARBON_SUBGRAPH = 'https://api.thegraph.com/subgraphs/name/klimadao/polygon-bridged-carbon'
KLIMA_BONDS_SUBGRAPH = 'https://api.thegraph.com/subgraphs/name/klimadao/klimadao-bonds'
POLYGON_DIGITAL_CARBON_SUBGRAPH = 'https://api.thegraph.com/subgraphs/name/klimadao/polygon-digital-carbon'
GRAPH_API_KEY = os.environ.get('GRAPH_API_KEY')
GRAPH_BASE_URL = f'https://gateway-arbitrum.network.thegraph.com/api/{GRAPH_API_KEY}/subgraphs/id/'
GRAPH_DEV_BASE_URL = 'https://api.studio.thegraph.com/query/71975/'
GRAPH_VERSION_SUFFIX = '/version/latest'

if os.environ.get('ENV') == 'production':
KLIMA_PROTOCOL_SUBGRAPH = 'https://api.thegraph.com/subgraphs/name/klimadao/klimadao-protocol-metrics'
KLIMA_CARBON_SUBGRAPH = 'https://api.thegraph.com/subgraphs/name/klimadao/polygon-bridged-carbon'
KLIMA_BONDS_SUBGRAPH = 'https://api.thegraph.com/subgraphs/name/klimadao/klimadao-bonds'
POLYGON_DIGITAL_CARBON_SUBGRAPH = 'https://api.thegraph.com/subgraphs/name/klimadao/polygon-digital-carbon'
else:
KLIMA_PROTOCOL_SUBGRAPH = GRAPH_DEV_BASE_URL + 'staging-klimadao-protocol-metrics' + GRAPH_VERSION_SUFFIX
KLIMA_CARBON_SUBGRAPH = GRAPH_DEV_BASE_URL + 'staging-polygon-bridged-carbon' + GRAPH_VERSION_SUFFIX
KLIMA_BONDS_SUBGRAPH = GRAPH_DEV_BASE_URL + 'staging-klimadao-bonds' + GRAPH_VERSION_SUFFIX
POLYGON_DIGITAL_CARBON_SUBGRAPH = GRAPH_DEV_BASE_URL + 'staging-polygon-digital-carbon' + GRAPH_VERSION_SUFFIX

0 comments on commit f1a42ca

Please sign in to comment.