Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ormponder mainnets #42

Merged
merged 2 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
## ENV

export INFURA_API_KEY=<YOUR_INFURA_API_KEY>
export BLAST_API_KEY=<YOUR_BLAST_API_KEY>

## Local run

```bash
1. git clone https://github.com/darwinia-network/ormponder.git
1. git clone https://github.com/msgport/ormponder.git
2. yarn install
3. yarn dev
```
115 changes: 38 additions & 77 deletions ponder.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,72 +4,25 @@ import { http } from "viem";
import { ORMPAbi as ORMPAbiV2 } from "./abis/v2/ORMPAbi";
import { SignaturePubAbi } from "./abis/v2/SignaturePubAbi";

// const INFURA_API_KEY = process.env.INFURA_API_KEY;
const INFURA_API_KEY = null;
const INFURA_API_KEY = process.env.INFURA_API_KEY;
const BLAST_API_KEY = process.env.BLAST_API_KEY;
const MAX_REQUESTS_PER_SECOND = 5;
const FAST_MAX_REQUESTS_PER_SECOND = 10;
const POLYGON_INFURA_API_KEY = process.env.INFURA_API_KEY;

export default createConfig({
networks: {
// testnets
arbitrum_sepolia: {
chainId: 421614,
transport: http(
INFURA_API_KEY
? `https://arbitrum-sepolia.infura.io/v3/${INFURA_API_KEY}`
// : "https://arbitrum-sepolia-hrpc.vercel.app/"
: "https://sepolia-rollup.arbitrum.io/rpc"
),
maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
},
pangolin: {
chainId: 43,
transport: http("http://g1.testnets.darwinia.network:9940"),
maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
},
pangoro: {
chainId: 45,
transport: http("https://fraa-flashbox-2871-rpc.a.stagenet.tanssi.network"),
maxRequestsPerSecond: FAST_MAX_REQUESTS_PER_SECOND,
},
sepolia: {
chainId: 11155111,
transport: http(
INFURA_API_KEY
? `https://sepolia.infura.io/v3/${INFURA_API_KEY}`
// : "https://sepolia-hrpc.vercel.app/"
: "https://rpc2.sepolia.org"
),
maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
},
taiko_hekla: {
chainId: 167009,
transport: http("https://rpc.hekla.taiko.xyz"),
maxRequestsPerSecond: FAST_MAX_REQUESTS_PER_SECOND,
},
tron_shasta: {
chainId: 2494104990,
transport: http("https://api.shasta.trongrid.io/jsonrpc"),
maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
},
// mainnets
arbitrum: {
chainId: 42161,
transport: http(
INFURA_API_KEY
? `https://arbitrum-mainnet.infura.io/v3/${INFURA_API_KEY}`
: "https://arb1.arbitrum.io/rpc"
// : "https://arbitrum-hrpc.vercel.app/"
// `https://arbitrum-one.blastapi.io/${BLAST_API_KEY}`
"https://arb1.arbitrum.io/rpc"
),
maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
},
blast: {
chainId: 81457,
transport: http(
INFURA_API_KEY
? `https://blast-mainnet.infura.io/v3/${INFURA_API_KEY}`
: "https://rpc.blast.io"
"https://rpc.blast.io"
),
maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
},
Expand All @@ -88,52 +41,60 @@ export default createConfig({
ethereum: {
chainId: 1,
transport: http(
// INFURA_API_KEY
// ? `https://mainnet.infura.io/v3/de35badc1ec7472da2967dd0248bd60c`

"https://eth-mainnet.public.blastapi.io"
`https://eth-mainnet.blastapi.io/${BLAST_API_KEY}`
),

maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
},
moonbeam: {
chainId: 1284,
transport: http("https://moonbeam-rpc.dwellir.com"),
maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
},
polygon: {
chainId: 137,
transport: http(
POLYGON_INFURA_API_KEY
? `https://polygon-mainnet.infura.io/v3/${POLYGON_INFURA_API_KEY}`
: "https://polygon-bor-rpc.publicnode.com"
// : "https://polygon-hrpc.vercel.app/"
`https://polygon-mainnet.infura.io/v3/${INFURA_API_KEY}`
),
maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
},
tron: {
chainId: 728126428,
transport: http("https://api.trongrid.io/jsonrpc"),
maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
},
},
contracts: {
// === V2
ORMPV2: {
abi: ORMPAbiV2,
address: "0xA72d283015c01807bc0788Bf22C1A774bDbFC8fA",
network: {
// testnets
pangolin: {
startBlock: 2936734,
arbitrum: {
startBlock: 215523404
},
pangoro: {
startBlock: 229000,
blast: {
startBlock: 3996337
},
sepolia: {
startBlock: 5967541,
crab: {
startBlock: 2861404
},
darwinia: {
startBlock: 2782562
},
arbitrum_sepolia: {
startBlock: 47378439,
ethereum: {
startBlock: 19960322
},
taiko_hekla: {
startBlock: 204774,
moonbeam: {
startBlock: 6245157
},
tron_shasta: {
startBlock: 44338539,
address: "0x841B6b2F3148131Ac161d88edFb2C11F146e189F", // TN1j3Ttt1c1mB3X2zdKkdMsUK6pZyLCxSr
polygon: {
startBlock: 57445517
},
// mainnets
tron: {
startBlock: 62053103,
address: "0x152c6DdDD0A4cfD817af7Cf4cf5491D4AC44e886", // TBuAR5bP2KoJ6Thx4zFqGChSARNRYrknTD
}
},
filter: {
event: [
Expand All @@ -146,10 +107,10 @@ export default createConfig({
},
SignaturePub: {
abi: SignaturePubAbi,
address: "0xb2aa34fde97ffdb6197dd5a2be23c2121405cc12",
address: "0x57aa601a0377f5ab313c5a955ee874f5d495fc92",
network: {
darwinia: {
startBlock: 2761609,
startBlock: 2782562,
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { ponder } from "@/generated";

const listenRelayer = [
"0xaC2b224c2E1eD2E8663097a361A05a72d6671C7D",
"0xaBFEBd81169de74f5a9Dbd7C1b5E349E835852E8", // TRediXQ8qcTqorMQqJ2jQgqnjUojWZo2qc
"0xDD9622309aa2798D74CD39C772D289dfe3EEdaD5", // TWArBv4oRtVE4MAkqaEVHHiBQX1Wc7xDg6
];
const listenOracle = [
"0x3f938756ceFa33665719Eb528E581FF3f460b7C6",
"0x488116286B253D61FFd41F4948c288c3C672918F", // TGaaHxjof9QcfKwggnFVM3QwjGKzbuNzNk
"0xf7A4217c2c372E50c19fdF68D86b3C7E493d2d21", // TYYcXSzzc8r4Q17xrYUtqWEMtKUNwNictu
];
const listenSignature = [
"0xA72d283015c01807bc0788Bf22C1A774bDbFC8fA",
"0x841B6b2F3148131Ac161d88edFb2C11F146e189F", // TN1j3Ttt1c1mB3X2zdKkdMsUK6pZyLCxSr
"0x152c6DdDD0A4cfD817af7Cf4cf5491D4AC44e886", // TBuAR5bP2KoJ6Thx4zFqGChSARNRYrknTD
];

ponder.on("ORMPV2:MessageAccepted", async ({ event, context }) => {
Expand Down