Skip to content

Commit

Permalink
feat: add optimism support
Browse files Browse the repository at this point in the history
  • Loading branch information
tnrdd committed Aug 20, 2024
1 parent c6edf33 commit 5c45435
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
compose-file: "./docker-compose.yaml"
env:
DATABASE_URI: ${{ secrets.DATABASE_URI }}
RPC_URL_OPSEPOLIA: ${{ secrets.RPC_URL_OPSEPOLIA }}
RPC_URL_OPTIMISM: ${{ secrets.RPC_URL_OPTIMISM }}
RPC_URL_BASE: ${{ secrets.RPC_URL_BASE }}
RPC_URL_ARBITRUM_ONE: ${{ secrets.RPC_URL_ARBITRUM_ONE }}
RPC_URL_OPSEPOLIA: ${{ secrets.RPC_URL_OPSEPOLIA }}
6 changes: 4 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ jobs:
compose-file: "./docker-compose.yaml"
env:
DATABASE_URI: ${{ secrets.DATABASE_URI }}
RPC_URL_OPSEPOLIA: ${{ secrets.RPC_URL_OPSEPOLIA }}
RPC_URL_OPTIMISM: ${{ secrets.RPC_URL_OPTIMISM }}
RPC_URL_BASE: ${{ secrets.RPC_URL_BASE }}
RPC_URL_ARBITRUM_ONE: ${{ secrets.RPC_URL_ARBITRUM_ONE }}
RPC_URL_OPSEPOLIA: ${{ secrets.RPC_URL_OPSEPOLIA }}

deploy:
needs: build
Expand All @@ -40,8 +41,9 @@ jobs:
cd ${{ secrets.APP_PATH }}
git pull origin main
export DATABASE_URI=${{ secrets.DATABASE_URI }}
export RPC_URL_OPSEPOLIA=${{ secrets.RPC_URL_OPSEPOLIA }}
export RPC_URL_OPTIMISM=${{ secrets.RPC_URL_OPTIMISM }}
export RPC_URL_BASE=${{ secrets.RPC_URL_BASE }}
export RPC_URL_ARBITRUM_ONE=${{ secrets.RPC_URL_ARBITRUM_ONE }}
export RPC_URL_OPSEPOLIA=${{ secrets.RPC_URL_OPSEPOLIA }}
docker compose -f docker-compose.yaml up -d --build
ENDSSH
3 changes: 2 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ services:
environment:
- NODE_ENV=production
- DATABASE_URI=${DATABASE_URI}
- RPC_URL_OPSEPOLIA=${RPC_URL_OPSEPOLIA}
- RPC_URL_OPTIMISM=${RPC_URL_OPTIMISM}
- RPC_URL_BASE=${RPC_URL_BASE}
- RPC_URL_ARBITRUM_ONE=${RPC_URL_ARBITRUM_ONE}
- RPC_URL_OPSEPOLIA=${RPC_URL_OPSEPOLIA}
volumes:
- sqlite_data:/sqlite_cache
db:
Expand Down
49 changes: 33 additions & 16 deletions src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,53 @@ type Contract = {

const networks: Network[] = [
{
id: 42161,
name: "arbitrum-one",
rpc: process.env.RPC_URL_ARBITRUM_ONE ?? "https://arb1.arbitrum.io/rpc",
id: 10,
name: "optimism",
rpc: process.env.RPC_URL_OPTIMISM ?? "https://optimism-rpc.publicnode.com",
contracts: [
{
name: "Allo",
address: "0x1133eA7Af70876e64665ecD07C0A0476d09465a1",
fromBlock: 239835829n,
fromBlock: 111680064n,
},
{
name: "AlloRegistry",
address: "0x4AAcca72145e1dF2aeC137E1f3C5E3D75DB8b5f3",
fromBlock: 239827023n,
fromBlock: 111678968n,
},
],
},
{
id: 11155420,
name: "optimism-sepolia",
rpc:
process.env.RPC_URL_OPSEPOLIA ?? "https://optimism-sepolia.infura.io/v3",
id: 8453,
name: "base",
rpc: process.env.RPC_URL_BASE ?? "https://mainnet.base.org",
contracts: [
{
name: "Allo",
address: "0x1133eA7Af70876e64665ecD07C0A0476d09465a1",
fromBlock: 11724487n,
fromBlock: 16047236n,
},
{
name: "AlloRegistry",
address: "0x4AAcca72145e1dF2aeC137E1f3C5E3D75DB8b5f3",
fromBlock: 11724487n,
fromBlock: 16047236n,
},
],
},
{
id: 42161,
name: "arbitrum-one",
rpc: process.env.RPC_URL_ARBITRUM_ONE ?? "https://arb1.arbitrum.io/rpc",
contracts: [
{
name: "Allo",
address: "0x1133eA7Af70876e64665ecD07C0A0476d09465a1",
fromBlock: 239835829n,
},
{
name: "AlloRegistry",
address: "0x4AAcca72145e1dF2aeC137E1f3C5E3D75DB8b5f3",
fromBlock: 239827023n,
},
],
},
Expand All @@ -64,19 +80,20 @@ const networks: Network[] = [
],
},
{
id: 8453,
name: "base",
rpc: process.env.RPC_URL_BASE ?? "https://mainnet.base.org",
id: 11155420,
name: "optimism-sepolia",
rpc:
process.env.RPC_URL_OPSEPOLIA ?? "https://optimism-sepolia.infura.io/v3",
contracts: [
{
name: "Allo",
address: "0x1133eA7Af70876e64665ecD07C0A0476d09465a1",
fromBlock: 16047236n,
fromBlock: 11724487n,
},
{
name: "AlloRegistry",
address: "0x4AAcca72145e1dF2aeC137E1f3C5E3D75DB8b5f3",
fromBlock: 16047236n,
fromBlock: 11724487n,
},
],
},
Expand Down

0 comments on commit 5c45435

Please sign in to comment.