Skip to content

Commit

Permalink
Merge pull request #225 from gnosis/issue-#224_sepolia_network
Browse files Browse the repository at this point in the history
Add sepolia network
  • Loading branch information
juliopavila authored May 8, 2023
2 parents aee23e2 + addb855 commit 325cfef
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
- name: Generate subgraph.yaml for Goerli
working-directory: packages/subgraph
run: yarn prepare:goerli
- name: Generate subgraph.yaml for Sepolia
working-directory: packages/subgraph
run: yarn prepare:sepolia
- name: Run subgraph tests
working-directory: packages/subgraph
run: yarn test
7 changes: 7 additions & 0 deletions .github/workflows/dev-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
REACT_APP_SUBGRAPH_GNOSIS_CHAIN: auryn-macmillan/tabula-gnosis-chain
REACT_APP_SUBGRAPH_MAINNET: auryn-macmillan/tabula-mainnet
REACT_APP_SUBGRAPH_GOERLI: auryn-macmillan/tabula-goerli
REACT_APP_SUBGRAPH_SEPOLIA: auryn-macmillan/tabula-sepolia
REACT_APP_SUBGRAPH_POLYGON: auryn-macmillan/tabula-polygon
REACT_APP_SUBGRAPH_ARBITRUM: auryn-macmillan/tabula-arbitrum
REACT_APP_SUBGRAPH_OPTIMISM: auryn-macmillan/tabula-optimism
Expand Down Expand Up @@ -78,3 +79,9 @@ jobs:
env:
HOSTED_SERVICE_SUBGRAPH__GOERLI: auryn-macmillan/tabula-goerli
run: yarn deploy:goerli

- name: Deploy Sepolia subgraphs
working-directory: packages/subgraph
env:
HOSTED_SERVICE_SUBGRAPH__GOERLI: auryn-macmillan/tabula-sepolia
run: yarn deploy:sepolia
7 changes: 7 additions & 0 deletions .github/workflows/prod-release-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
REACT_APP_SUBGRAPH_GNOSIS_CHAIN: auryn-macmillan/tabula-gnosis-chain
REACT_APP_SUBGRAPH_MAINNET: auryn-macmillan/tabula-mainnet
REACT_APP_SUBGRAPH_GOERLI: auryn-macmillan/tabula-goerli
REACT_APP_SUBGRAPH_SEPOLIA: auryn-macmillan/tabula-sepolia
REACT_APP_SUBGRAPH_POLYGON: auryn-macmillan/tabula-polygon
REACT_APP_SUBGRAPH_ARBITRUM: auryn-macmillan/tabula-arbitrum
REACT_APP_SUBGRAPH_OPTIMISM: auryn-macmillan/tabula-optimism
Expand Down Expand Up @@ -111,6 +112,12 @@ jobs:
HOSTED_SERVICE_SUBGRAPH__GOERLI: auryn-macmillan/tabula-goerli
run: yarn deploy:goerli

- name: Deploy subgraph to Sepolia
working-directory: packages/subgraph
env:
HOSTED_SERVICE_SUBGRAPH__GOERLI: auryn-macmillan/tabula-sepolia
run: yarn deploy:sepolia

- name: Deploy subgraph to Polygon
working-directory: packages/subgraph
env:
Expand Down
1 change: 1 addition & 0 deletions packages/app/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ REACT_APP_SUBGRAPH_BASE_URL=https://api.thegraph.com/subgraphs/name/
REACT_APP_SUBGRAPH_GNOSIS_CHAIN=auryn-macmillan/tabula-gnosis-chain
REACT_APP_SUBGRAPH_MAINNET=auryn-macmillan/tabula-mainnet
REACT_APP_SUBGRAPH_GOERLI=auryn-macmillan/tabula-goerli
REACT_APP_SUBGRAPH_SEPOLIA=auryn-macmillan/tabula-sepolia
REACT_APP_SUBGRAPH_POLYGON=auryn-macmillan/tabula-polygon
REACT_APP_SUBGRAPH_ARBITRUM=auryn-macmillan/tabula-arbitrum
REACT_APP_SUBGRAPH_OPTIMISM=auryn-macmillan/tabula-optimism
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/connectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ if (typeof INFURA_KEY === "undefined") {
const NETWORK_URLS: { [key in SupportedChainId]: string } = {
[SupportedChainId.MAINNET]: `https://mainnet.infura.io/v3/${INFURA_KEY}`,
[SupportedChainId.GOERLI]: `https://goerli.infura.io/v3/${INFURA_KEY}`,
[SupportedChainId.SEPOLIA]: `https://sepolia.infura.io/v3/${INFURA_KEY}`,
[SupportedChainId.GNOSIS_CHAIN]: `https://rpc.gnosischain.com/`,
[SupportedChainId.POLYGON]: `https://polygon-rpc.com/`,
[SupportedChainId.ARBITRUM]: `https://arb1.arbitrum.io/rpc/`,
Expand Down
25 changes: 25 additions & 0 deletions packages/app/src/constants/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum SupportedChainId {
MAINNET = 1,
GNOSIS_CHAIN = 100,
GOERLI = 5,
SEPOLIA = 11155111,
POLYGON = 137,
ARBITRUM = 42161,
OPTIMISM = 10,
Expand All @@ -16,6 +17,7 @@ export enum SupportedChain {
MAINNET = "mainnet",
GNOSIS_CHAIN = "gnosis_chain",
GOERLI = "goerli",
SEPOLIA = "sepolia",
POLYGON = "polygon",
ARBITRUM = "arbitrum",
OPTIMISM = "optimism",
Expand All @@ -30,6 +32,8 @@ export const chainIdToChainName = (chainId: number) => {
return SupportedChain.GNOSIS_CHAIN
case SupportedChainId.GOERLI:
return SupportedChain.GOERLI
case SupportedChainId.SEPOLIA:
return SupportedChain.SEPOLIA
case SupportedChainId.POLYGON:
return SupportedChain.POLYGON
case SupportedChainId.ARBITRUM:
Expand All @@ -49,6 +53,8 @@ export const chainNameToChainId = (chainName?: string) => {
return SupportedChainId.GNOSIS_CHAIN
case SupportedChain.GOERLI:
return SupportedChainId.GOERLI
case SupportedChain.SEPOLIA:
return SupportedChainId.SEPOLIA
case SupportedChain.POLYGON:
return SupportedChainId.POLYGON
case SupportedChain.ARBITRUM:
Expand All @@ -66,6 +72,7 @@ export const ALL_SUPPORTED_CHAIN_IDS: SupportedChainId[] = [
SupportedChainId.MAINNET,
SupportedChainId.GNOSIS_CHAIN,
SupportedChainId.GOERLI,
SupportedChainId.SEPOLIA,
SupportedChainId.POLYGON,
SupportedChainId.ARBITRUM,
SupportedChainId.OPTIMISM,
Expand All @@ -80,6 +87,8 @@ export const chainToString = (chainId: number) => {
return `Gnosis Chain (ChainID: ${chainId})`
case SupportedChainId.GOERLI:
return `Goerli (ChainID: ${chainId})`
case SupportedChainId.SEPOLIA:
return `Sepolia (ChainID: ${chainId})`
case SupportedChainId.POLYGON:
return `Polygon (ChainID: ${chainId})`
case SupportedChainId.ARBITRUM:
Expand Down Expand Up @@ -165,6 +174,22 @@ export const chainParameters = (chainId: number) => {
},
blockExplorerUrls: ["https://goerli.etherscan.io/"],
}
case SupportedChainId.SEPOLIA:
return {
chainId: requiredChainIdHex,
chainName: "Sepolia",
rpcUrls: [
"https://rpc.sepolia.org",
"https://rpc2.sepolia.org",
"https://rpc-sepolia.rockx.com"
],
nativeCurrency: {
name: "ETH",
symbol: "ETH",
decimals: 18,
},
blockExplorerUrls: ["https://sepolia.etherscan.io/"],
}
case SupportedChainId.POLYGON:
return {
chainId: requiredChainIdHex,
Expand Down
6 changes: 6 additions & 0 deletions packages/app/src/services/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ if (!process.env.REACT_APP_SUBGRAPH_MAINNET) {
if (!process.env.REACT_APP_SUBGRAPH_GOERLI) {
throw new Error("REACT_APP_SUBGRAPH_GOERLI is not set")
}
if (!process.env.REACT_APP_SUBGRAPH_SEPOLIA) {
throw new Error("REACT_APP_SUBGRAPH_SEPOLIA is not set")
}
if (!process.env.REACT_APP_SUBGRAPH_POLYGON) {
throw new Error("REACT_APP_SUBGRAPH_POLYGON is not set")
}
Expand All @@ -30,6 +33,7 @@ const BASE_SUBGRAPH_URL = process.env.REACT_APP_SUBGRAPH_BASE_URL
const SUBGRAPH_GNOSIS_CHAIN = process.env.REACT_APP_SUBGRAPH_GNOSIS_CHAIN
const SUBGRAPH_MAINNET = process.env.REACT_APP_SUBGRAPH_MAINNET
const SUBGRAPH_GOERLI = process.env.REACT_APP_SUBGRAPH_GOERLI
const SUBGRAPH_SEPOLIA = process.env.REACT_APP_SUBGRAPH_SEPOLIA
const SUBGRAPH_POLYGON = process.env.REACT_APP_SUBGRAPH_POLYGON
const SUBGRAPH_ARBITRUM = process.env.REACT_APP_SUBGRAPH_ARBITRUM
const SUBGRAPH_OPTIMISM = process.env.REACT_APP_SUBGRAPH_OPTIMISM
Expand All @@ -43,6 +47,8 @@ const getUrl = (chainId?: number) => {
return BASE_SUBGRAPH_URL + SUBGRAPH_GNOSIS_CHAIN
case SupportedChainId.GOERLI:
return BASE_SUBGRAPH_URL + SUBGRAPH_GOERLI
case SupportedChainId.SEPOLIA:
return BASE_SUBGRAPH_URL + SUBGRAPH_SEPOLIA
case SupportedChainId.POLYGON:
return BASE_SUBGRAPH_URL + SUBGRAPH_POLYGON
case SupportedChainId.OPTIMISM:
Expand Down
4 changes: 4 additions & 0 deletions packages/subgraph/network_configs/sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"network": "sepolia",
"startBlock": 3444014
}
2 changes: 2 additions & 0 deletions packages/subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"prepare:gnosis-chain": "mustache network_configs/gnosis-chain.json subgraph.template.yaml > subgraph.yaml",
"deploy:goerli": "yarn prepare:goerli && bash -c 'source .env || true && graph deploy --node https://api.thegraph.com/deploy/ $HOSTED_SERVICE_SUBGRAPH__GOERLI'",
"prepare:goerli": "mustache network_configs/goerli.json subgraph.template.yaml > subgraph.yaml",
"deploy:sepolia": "yarn prepare:sepolia && bash -c 'source .env || true && graph deploy --node https://api.thegraph.com/deploy/ $HOSTED_SERVICE_SUBGRAPH__SEPOLIA'",
"prepare:sepolia": "mustache network_configs/sepolia.json subgraph.template.yaml > subgraph.yaml",
"deploy:polygon": "yarn prepare:polygon && bash -c 'source .env || true && graph deploy --node https://api.thegraph.com/deploy/ $HOSTED_SERVICE_SUBGRAPH__POLYGON'",
"prepare:polygon": "mustache network_configs/polygon.json subgraph.template.yaml > subgraph.yaml",
"deploy:optimism": "yarn prepare:optimism && bash -c 'source .env || true && graph deploy --node https://api.thegraph.com/deploy/ $HOSTED_SERVICE_SUBGRAPH__OPTIMISM'",
Expand Down

1 comment on commit 325cfef

@vercel
Copy link

@vercel vercel bot commented on 325cfef May 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

tabula – ./

tabula-eight.vercel.app
tabula-git-main-gnosis-guild.vercel.app
tabula-gnosis-guild.vercel.app

Please sign in to comment.