From f316ad546905ecd70f0c6d9826f14458284c183a Mon Sep 17 00:00:00 2001 From: Yaro Shkvorets Date: Sat, 30 Nov 2024 19:05:05 -0500 Subject: [PATCH] Add blockscout apis (#22) * add blockscout apis * update near firehose first block * add etherscan check script --- package.json | 2 +- registry/eip155/arbitrum-nova.json | 3 +- registry/eip155/arbitrum-one.json | 6 +- registry/eip155/arbitrum-sepolia.json | 3 +- registry/eip155/astar-zkevm-mainnet.json | 2 +- registry/eip155/aurora-testnet.json | 2 +- registry/eip155/aurora.json | 2 +- registry/eip155/base-sepolia.json | 6 +- registry/eip155/base.json | 3 +- registry/eip155/blast-mainnet.json | 3 +- registry/eip155/blast-testnet.json | 3 +- registry/eip155/celo-alfajores.json | 3 +- registry/eip155/celo.json | 3 +- registry/eip155/clover.json | 2 +- registry/eip155/cronos.json | 2 +- registry/eip155/etherlink-mainnet.json | 2 +- registry/eip155/etherlink-testnet.json | 5 +- registry/eip155/gnosis-chiado.json | 2 +- registry/eip155/gnosis.json | 3 +- registry/eip155/holesky.json | 4 +- registry/eip155/linea-sepolia.json | 4 ++ registry/eip155/linea.json | 3 +- registry/eip155/matic.json | 3 +- registry/eip155/mode-mainnet.json | 2 +- registry/eip155/mode-sepolia.json | 2 +- registry/eip155/optimism-sepolia.json | 4 ++ registry/eip155/optimism.json | 3 +- registry/eip155/polygon-zkevm-cardona.json | 2 +- registry/eip155/polygon-zkevm.json | 3 +- registry/eip155/rootstock.json | 2 +- registry/eip155/scroll-sepolia.json | 3 +- registry/eip155/scroll.json | 5 +- registry/eip155/sepolia.json | 3 +- registry/eip155/xai.json | 2 +- registry/eip155/zksync-era-sepolia.json | 3 +- registry/eip155/zksync-era.json | 3 +- registry/eip155/zkyoto-testnet.json | 2 +- registry/eip155/zora.json | 2 +- registry/near/near-mainnet.json | 4 +- src/check_etherscan.ts | 69 ++++++++++++++++++++++ 40 files changed, 147 insertions(+), 38 deletions(-) create mode 100644 src/check_etherscan.ts diff --git a/package.json b/package.json index 7522494..78b5b13 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.6.9", + "version": "0.6.10", "private": true, "type": "module", "scripts": { diff --git a/registry/eip155/arbitrum-nova.json b/registry/eip155/arbitrum-nova.json index 3e2c687..dc457b6 100644 --- a/registry/eip155/arbitrum-nova.json +++ b/registry/eip155/arbitrum-nova.json @@ -16,7 +16,8 @@ { "url": "https://arbitrum-nova.abi.pinax.network/api", "kind": "etherscan" - } + }, + { "url": "https://nova-explorer.arbitrum.io/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"], diff --git a/registry/eip155/arbitrum-one.json b/registry/eip155/arbitrum-one.json index ea555a2..2a778e6 100644 --- a/registry/eip155/arbitrum-one.json +++ b/registry/eip155/arbitrum-one.json @@ -16,7 +16,11 @@ "https://arbone.rpc.pinax.network/v1/{PINAX_API_KEY}" ], "apiUrls": [ - { "url": "https://arbitrum-one.abi.pinax.network/api", "kind": "etherscan" } + { + "url": "https://arbitrum-one.abi.pinax.network/api", + "kind": "etherscan" + }, + { "url": "https://arbitrum.blockscout.com/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"], diff --git a/registry/eip155/arbitrum-sepolia.json b/registry/eip155/arbitrum-sepolia.json index 8b51539..222ebfc 100644 --- a/registry/eip155/arbitrum-sepolia.json +++ b/registry/eip155/arbitrum-sepolia.json @@ -20,7 +20,8 @@ { "url": "https://arbitrum-sepolia.abi.pinax.network/api", "kind": "etherscan" - } + }, + { "url": "https://sepolia-explorer.arbitrum.io/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"], diff --git a/registry/eip155/astar-zkevm-mainnet.json b/registry/eip155/astar-zkevm-mainnet.json index 1261168..bc1b285 100644 --- a/registry/eip155/astar-zkevm-mainnet.json +++ b/registry/eip155/astar-zkevm-mainnet.json @@ -14,7 +14,7 @@ "apiUrls": [ { "url": "https://astar-zkevm.explorer.startale.com/api", - "kind": "etherscan" + "kind": "blockscout" } ], "services": { diff --git a/registry/eip155/aurora-testnet.json b/registry/eip155/aurora-testnet.json index 2f79b17..70cbe03 100644 --- a/registry/eip155/aurora-testnet.json +++ b/registry/eip155/aurora-testnet.json @@ -8,7 +8,7 @@ "explorerUrls": ["https://explorer.testnet.aurora.dev"], "rpcUrls": ["https://testnet.aurora.dev"], "apiUrls": [ - { "url": "https://explorer.testnet.aurora.dev/api", "kind": "etherscan" } + { "url": "https://explorer.testnet.aurora.dev/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"] }, "networkType": "testnet", diff --git a/registry/eip155/aurora.json b/registry/eip155/aurora.json index 81ec587..5c39bbf 100644 --- a/registry/eip155/aurora.json +++ b/registry/eip155/aurora.json @@ -8,7 +8,7 @@ "explorerUrls": ["https://explorer.aurora.dev"], "rpcUrls": ["https://mainnet.aurora.dev"], "apiUrls": [ - { "url": "https://explorer.mainnet.aurora.dev/api", "kind": "etherscan" } + { "url": "https://explorer.mainnet.aurora.dev/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"] }, "networkType": "mainnet", diff --git a/registry/eip155/base-sepolia.json b/registry/eip155/base-sepolia.json index 6bda8fb..53160e5 100644 --- a/registry/eip155/base-sepolia.json +++ b/registry/eip155/base-sepolia.json @@ -13,7 +13,11 @@ "https://basesepolia.rpc.pinax.network/v1/{PINAX_API_KEY}" ], "apiUrls": [ - { "url": "https://base-sepolia.abi.pinax.network/api", "kind": "etherscan" } + { + "url": "https://base-sepolia.abi.pinax.network/api", + "kind": "etherscan" + }, + { "url": "https://base-sepolia.blockscout.com/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"], diff --git a/registry/eip155/base.json b/registry/eip155/base.json index 4225fb1..3a04775 100644 --- a/registry/eip155/base.json +++ b/registry/eip155/base.json @@ -12,7 +12,8 @@ "https://base.rpc.pinax.network/v1/{PINAX_API_KEY}" ], "apiUrls": [ - { "url": "https://base.abi.pinax.network/api", "kind": "etherscan" } + { "url": "https://base.abi.pinax.network/api", "kind": "etherscan" }, + { "url": "https://base.blockscout.com/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"], diff --git a/registry/eip155/blast-mainnet.json b/registry/eip155/blast-mainnet.json index fd17db6..81f94d7 100644 --- a/registry/eip155/blast-mainnet.json +++ b/registry/eip155/blast-mainnet.json @@ -12,7 +12,8 @@ "https://rpc.ankr.com/blast" ], "apiUrls": [ - { "url": "https://blast.abi.pinax.network/api", "kind": "etherscan" } + { "url": "https://blast.abi.pinax.network/api", "kind": "etherscan" }, + { "url": "https://blast.blockscout.com/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"], diff --git a/registry/eip155/blast-testnet.json b/registry/eip155/blast-testnet.json index a8c59fd..e37ed5a 100644 --- a/registry/eip155/blast-testnet.json +++ b/registry/eip155/blast-testnet.json @@ -15,7 +15,8 @@ { "url": "https://blast-testnet.abi.pinax.network/api", "kind": "etherscan" - } + }, + { "url": "https://blast-testnet.blockscout.com/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"], diff --git a/registry/eip155/celo-alfajores.json b/registry/eip155/celo-alfajores.json index 82169aa..7efe123 100644 --- a/registry/eip155/celo-alfajores.json +++ b/registry/eip155/celo-alfajores.json @@ -17,7 +17,8 @@ { "url": "https://celo-alfajores.abi.pinax.network/api", "kind": "etherscan" - } + }, + { "url": "https://celo-alfajores.blockscout.com/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"] }, "issuanceRewards": false, diff --git a/registry/eip155/celo.json b/registry/eip155/celo.json index e443742..b32cb4b 100644 --- a/registry/eip155/celo.json +++ b/registry/eip155/celo.json @@ -11,7 +11,8 @@ "https://celo.rpc.pinax.network/v1/{PINAX_API_KEY}" ], "apiUrls": [ - { "url": "https://celo.abi.pinax.network/api", "kind": "etherscan" } + { "url": "https://celo.abi.pinax.network/api", "kind": "etherscan" }, + { "url": "https://explorer.celo.org/mainnet/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"] }, "networkType": "mainnet", diff --git a/registry/eip155/clover.json b/registry/eip155/clover.json index e4559e1..1832386 100644 --- a/registry/eip155/clover.json +++ b/registry/eip155/clover.json @@ -7,7 +7,7 @@ "graphNode": { "protocol": "ethereum" }, "explorerUrls": ["https://clvscan.com"], "rpcUrls": ["https://api-para.clv.org"], - "apiUrls": [{ "url": "https://clvscan.com/api", "kind": "etherscan" }], + "apiUrls": [{ "url": "https://clvscan.com/api", "kind": "blockscout" }], "networkType": "mainnet", "services": { "subgraphs": ["https://api.thegraph.com/deploy"] }, "issuanceRewards": false, diff --git a/registry/eip155/cronos.json b/registry/eip155/cronos.json index c3d540e..0a8eabc 100644 --- a/registry/eip155/cronos.json +++ b/registry/eip155/cronos.json @@ -11,7 +11,7 @@ "https://cronos.rpc.pinax.network/v1/{PINAX_API_KEY}" ], "apiUrls": [ - { "url": "https://explorer-api.cronos.org/mainnet/api/v1", "kind": "other" } + { "url": "https://cronos.org/explorer/api", "kind": "blockscout" } ], "services": {}, "networkType": "mainnet", diff --git a/registry/eip155/etherlink-mainnet.json b/registry/eip155/etherlink-mainnet.json index ab14831..2bccd81 100644 --- a/registry/eip155/etherlink-mainnet.json +++ b/registry/eip155/etherlink-mainnet.json @@ -8,7 +8,7 @@ "explorerUrls": ["https://explorer.etherlink.com"], "rpcUrls": ["https://node.mainnet.etherlink.com"], "apiUrls": [ - { "url": "https://explorer.etherlink.com/api", "kind": "etherscan" } + { "url": "https://explorer.etherlink.com/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"] }, "networkType": "mainnet", diff --git a/registry/eip155/etherlink-testnet.json b/registry/eip155/etherlink-testnet.json index ce08e2f..344369b 100644 --- a/registry/eip155/etherlink-testnet.json +++ b/registry/eip155/etherlink-testnet.json @@ -8,7 +8,10 @@ "explorerUrls": ["https://testnet.explorer.etherlink.com"], "rpcUrls": ["https://node.ghostnet.etherlink.com"], "apiUrls": [ - { "url": "https://testnet.explorer.etherlink.com/api", "kind": "etherscan" } + { + "url": "https://testnet.explorer.etherlink.com/api", + "kind": "blockscout" + } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"] }, "networkType": "testnet", diff --git a/registry/eip155/gnosis-chiado.json b/registry/eip155/gnosis-chiado.json index 0f63348..ea7be5f 100644 --- a/registry/eip155/gnosis-chiado.json +++ b/registry/eip155/gnosis-chiado.json @@ -12,7 +12,7 @@ "https://chiado.rpc.pinax.network/v1/{PINAX_API_KEY}" ], "apiUrls": [ - { "url": "https://gnosis-chiado.blockscout.com/api", "kind": "etherscan" } + { "url": "https://gnosis-chiado.blockscout.com/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"] }, "networkType": "testnet", diff --git a/registry/eip155/gnosis.json b/registry/eip155/gnosis.json index de659e2..dd02ad0 100644 --- a/registry/eip155/gnosis.json +++ b/registry/eip155/gnosis.json @@ -13,7 +13,8 @@ "https://rpc.ankr.com/gnosis" ], "apiUrls": [ - { "url": "https://gnosis.abi.pinax.network/api", "kind": "etherscan" } + { "url": "https://gnosis.abi.pinax.network/api", "kind": "etherscan" }, + { "url": "https://gnosis.blockscout.com/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"] }, "networkType": "mainnet", diff --git a/registry/eip155/holesky.json b/registry/eip155/holesky.json index 60b49b8..7eadb58 100644 --- a/registry/eip155/holesky.json +++ b/registry/eip155/holesky.json @@ -17,7 +17,9 @@ "https://rpc.holesky.ethpandaops.io", "https://holesky.rpc.pinax.network/v1/{PINAX_API_KEY}" ], - "apiUrls": [], + "apiUrls": [ + { "url": "https://eth-holesky.blockscout.com/api", "kind": "blockscout" } + ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"], "sps": ["https://api.thegraph.com/deploy"], diff --git a/registry/eip155/linea-sepolia.json b/registry/eip155/linea-sepolia.json index 53d9c1f..94fbba5 100644 --- a/registry/eip155/linea-sepolia.json +++ b/registry/eip155/linea-sepolia.json @@ -12,6 +12,10 @@ { "url": "https://linea-sepolia.abi.pinax.network/api", "kind": "etherscan" + }, + { + "url": "https://api-explorer.sepolia.linea.build/api", + "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"] }, diff --git a/registry/eip155/linea.json b/registry/eip155/linea.json index 269e12a..14cee54 100644 --- a/registry/eip155/linea.json +++ b/registry/eip155/linea.json @@ -12,7 +12,8 @@ "https://linea-mainnet.infura.io/v3/${INFURA_API_KEY}" ], "apiUrls": [ - { "url": "https://linea.abi.pinax.network/api", "kind": "etherscan" } + { "url": "https://linea.abi.pinax.network/api", "kind": "etherscan" }, + { "url": "https://api-explorer.linea.build/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"], diff --git a/registry/eip155/matic.json b/registry/eip155/matic.json index f2e7878..bb978d1 100644 --- a/registry/eip155/matic.json +++ b/registry/eip155/matic.json @@ -13,7 +13,8 @@ "https://rpc.ankr.com/polygon" ], "apiUrls": [ - { "url": "https://polygon.abi.pinax.network/api", "kind": "etherscan" } + { "url": "https://polygon.abi.pinax.network/api", "kind": "etherscan" }, + { "url": "https://polygon.blockscout.com/api", "kind": "blockscout" } ], "networkType": "mainnet", "services": { diff --git a/registry/eip155/mode-mainnet.json b/registry/eip155/mode-mainnet.json index 99b1820..7fb1e03 100644 --- a/registry/eip155/mode-mainnet.json +++ b/registry/eip155/mode-mainnet.json @@ -11,7 +11,7 @@ "https://mode.rpc.pinax.network/v1/{PINAX_API_KEY}" ], "apiUrls": [ - { "url": "https://explorer.mode.network/api", "kind": "etherscan" } + { "url": "https://explorer.mode.network/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"], diff --git a/registry/eip155/mode-sepolia.json b/registry/eip155/mode-sepolia.json index 1ffa28f..23969d0 100644 --- a/registry/eip155/mode-sepolia.json +++ b/registry/eip155/mode-sepolia.json @@ -9,7 +9,7 @@ "explorerUrls": ["https://sepolia.explorer.mode.network"], "rpcUrls": ["https://sepolia.mode.network"], "apiUrls": [ - { "url": "https://sepolia.explorer.mode.network/api", "kind": "etherscan" } + { "url": "https://sepolia.explorer.mode.network/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"] }, "networkType": "testnet", diff --git a/registry/eip155/optimism-sepolia.json b/registry/eip155/optimism-sepolia.json index 1efe4f2..11b783c 100644 --- a/registry/eip155/optimism-sepolia.json +++ b/registry/eip155/optimism-sepolia.json @@ -19,6 +19,10 @@ { "url": "https://optimism-sepolia.abi.pinax.network/api", "kind": "etherscan" + }, + { + "url": "https://optimism-sepolia.blockscout.com/api", + "kind": "blockscout" } ], "services": { diff --git a/registry/eip155/optimism.json b/registry/eip155/optimism.json index b289011..dc86e23 100644 --- a/registry/eip155/optimism.json +++ b/registry/eip155/optimism.json @@ -13,7 +13,8 @@ "https://optimism.rpc.pinax.network/v1/{PINAX_API_KEY}" ], "apiUrls": [ - { "url": "https://optimism.abi.pinax.network/api", "kind": "etherscan" } + { "url": "https://optimism.abi.pinax.network/api", "kind": "etherscan" }, + { "url": "https://optimism.blockscout.com/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"], diff --git a/registry/eip155/polygon-zkevm-cardona.json b/registry/eip155/polygon-zkevm-cardona.json index 4a3f7ed..b541ec1 100644 --- a/registry/eip155/polygon-zkevm-cardona.json +++ b/registry/eip155/polygon-zkevm-cardona.json @@ -18,7 +18,7 @@ "apiUrls": [ { "url": "https://api-cardona-zkevm.polygonscan.com/api", - "kind": "etherscan" + "kind": "blockscout" }, { "url": "https://polygon-zkevm-cardona.abi.pinax.network/api", diff --git a/registry/eip155/polygon-zkevm.json b/registry/eip155/polygon-zkevm.json index 97f24ee..9347c36 100644 --- a/registry/eip155/polygon-zkevm.json +++ b/registry/eip155/polygon-zkevm.json @@ -15,7 +15,8 @@ { "url": "https://polygon-zkevm.abi.pinax.network/api", "kind": "etherscan" - } + }, + { "url": "https://zkevm.blockscout.com/api", "kind": "blockscout" } ], "networkType": "mainnet", "services": { diff --git a/registry/eip155/rootstock.json b/registry/eip155/rootstock.json index 52249e8..4eb8dd3 100644 --- a/registry/eip155/rootstock.json +++ b/registry/eip155/rootstock.json @@ -11,7 +11,7 @@ "https://rootstock.rpc.pinax.network/v1/{PINAX_API_KEY}" ], "apiUrls": [ - { "url": "https://rootstock.blockscout.com/api", "kind": "etherscan" } + { "url": "https://rootstock.blockscout.com/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"] }, "networkType": "mainnet", diff --git a/registry/eip155/scroll-sepolia.json b/registry/eip155/scroll-sepolia.json index 08a63c2..0fcf31e 100644 --- a/registry/eip155/scroll-sepolia.json +++ b/registry/eip155/scroll-sepolia.json @@ -12,7 +12,8 @@ "https://scrsepolia.rpc.pinax.network/v1/{PINAX_API_KEY}" ], "apiUrls": [ - { "url": "https://api-sepolia.scrollscan.com/api", "kind": "etherscan" } + { "url": "https://api-sepolia.scrollscan.com/api", "kind": "etherscan" }, + { "url": "https://scroll-sepolia.blockscout.com/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"], diff --git a/registry/eip155/scroll.json b/registry/eip155/scroll.json index aca8d41..34b132b 100644 --- a/registry/eip155/scroll.json +++ b/registry/eip155/scroll.json @@ -11,7 +11,10 @@ "https://scroll.rpc.pinax.network/v1/{PINAX_API_KEY}", "https://rpc.ankr.com/scroll" ], - "apiUrls": [{ "url": "https://api.scrollscan.com/api", "kind": "etherscan" }], + "apiUrls": [ + { "url": "https://api.scrollscan.com/api", "kind": "etherscan" }, + { "url": "https://scroll.blockscout.com/api", "kind": "blockscout" } + ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"], "sps": ["https://api.thegraph.com/deploy"], diff --git a/registry/eip155/sepolia.json b/registry/eip155/sepolia.json index c20e52a..d137dff 100644 --- a/registry/eip155/sepolia.json +++ b/registry/eip155/sepolia.json @@ -18,7 +18,8 @@ "https://sepolia.infura.io/v3/${INFURA_API_KEY}" ], "apiUrls": [ - { "url": "https://sepolia.abi.pinax.network/api", "kind": "etherscan" } + { "url": "https://sepolia.abi.pinax.network/api", "kind": "etherscan" }, + { "url": "https://eth-sepolia.blockscout.com/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"], diff --git a/registry/eip155/xai.json b/registry/eip155/xai.json index 33e7a31..52fd88c 100644 --- a/registry/eip155/xai.json +++ b/registry/eip155/xai.json @@ -11,7 +11,7 @@ "https://xai.rpc.pinax.network/v1/{PINAX_API_KEY}" ], "apiUrls": [ - { "url": "https://explorer.xai-chain.net/api", "kind": "etherscan" } + { "url": "https://explorer.xai-chain.net/api", "kind": "blockscout" } ], "services": { "firehose": ["xai.firehose.pinax.network:443"], diff --git a/registry/eip155/zksync-era-sepolia.json b/registry/eip155/zksync-era-sepolia.json index 03324c3..fec5471 100644 --- a/registry/eip155/zksync-era-sepolia.json +++ b/registry/eip155/zksync-era-sepolia.json @@ -12,7 +12,8 @@ { "url": "https://block-explorer-api.sepolia.zksync.dev/api", "kind": "etherscan" - } + }, + { "url": "https://zksync-sepolia.blockscout.com/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"] }, "networkType": "testnet", diff --git a/registry/eip155/zksync-era.json b/registry/eip155/zksync-era.json index fd71060..51416f3 100644 --- a/registry/eip155/zksync-era.json +++ b/registry/eip155/zksync-era.json @@ -15,7 +15,8 @@ { "url": "https://block-explorer-api.mainnet.zksync.io/api", "kind": "etherscan" - } + }, + { "url": "https://zksync.blockscout.com/api", "kind": "blockscout" } ], "services": { "subgraphs": ["https://api.thegraph.com/deploy"] }, "networkType": "mainnet", diff --git a/registry/eip155/zkyoto-testnet.json b/registry/eip155/zkyoto-testnet.json index 8d96f10..0b4d4e6 100644 --- a/registry/eip155/zkyoto-testnet.json +++ b/registry/eip155/zkyoto-testnet.json @@ -17,7 +17,7 @@ "https://zkyoto.rpc.pinax.network/v1/{PINAX_API_KEY}" ], "apiUrls": [ - { "url": "https://zkyoto.explorer.startale.com/api", "kind": "etherscan" } + { "url": "https://zkyoto.explorer.startale.com/api", "kind": "blockscout" } ], "services": { "firehose": ["zkyoto.firehose.pinax.network:443"], diff --git a/registry/eip155/zora.json b/registry/eip155/zora.json index 9ec5669..25a7238 100644 --- a/registry/eip155/zora.json +++ b/registry/eip155/zora.json @@ -11,7 +11,7 @@ "https://zora.rpc.pinax.network/v1/{PINAX_API_KEY}" ], "apiUrls": [ - { "url": "https://explorer.zora.energy/api/v2", "kind": "etherscan" } + { "url": "https://explorer.zora.energy/api", "kind": "blockscout" } ], "services": { "firehose": ["zora.firehose.pinax.network:443"], diff --git a/registry/near/near-mainnet.json b/registry/near/near-mainnet.json index 35c68f6..0784ac1 100644 --- a/registry/near/near-mainnet.json +++ b/registry/near/near-mainnet.json @@ -25,8 +25,8 @@ "nativeToken": "NEAR", "docsUrl": "https://docs.near.org", "genesis": { - "hash": "0xa7110b9052e1be68f7fa8bb4065bf54e731205801878e708db7464ec4b9b8014", - "height": 9820214 + "hash": "0xc6fdf91c8e82f8f917cc1975e9de1c64be11899e321dfdf5febcfbb7313f1486", + "height": 9820210 }, "firehose": { "blockType": "sf.near.type.v1.Block", diff --git a/src/check_etherscan.ts b/src/check_etherscan.ts new file mode 100644 index 0000000..8747aec --- /dev/null +++ b/src/check_etherscan.ts @@ -0,0 +1,69 @@ +import { loadNetworks } from "./utils/fs"; + +interface EtherscanChain { + chainid: number; + name: string; + url: string; + status: string; + chainname: string; +} + +interface EtherscanResponse { + comments: string; + totalcount: number; + result: EtherscanChain[]; +} + +const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + +async function getEtherscanChains(): Promise { + try { + const response = await fetch("https://api.etherscan.io/v2/chainlist"); + const data = await response.json(); + + return data.result as EtherscanChain[]; + } catch (error) { + console.error("Failed to fetch Etherscan chains:", error); + throw error; + } +} + +// pinax runs proxies for etherscan multi-chain api, i.e. https://mainnet.abi.pinax.network/api for https://api.etherscan.io/v2/api?chainid=1 +// this script checks if all proxies are setup and added to the registry +async function main() { + try { + const etherscanChains = await getEtherscanChains(); + console.log("Fetched Etherscan chains:", etherscanChains.length); + + let networks = loadNetworks("registry"); + console.log("Loaded from registry: ", networks.length); + + console.log( + "id chainid registry proxy url", + ); + for (const ethChain of etherscanChains) { + const network = networks.find( + (n) => n.caip2Id === `eip155:${ethChain.chainid}`, + ); + if (!network) continue; + const ourApi = network.apiUrls?.find((c) => + c.url.includes("abi.pinax.network"), + )?.url; + const inRegistry = !!ourApi; + const url = ourApi ?? `https://${network.id}.abi.pinax.network/api`; + const inProxy = await fetch(url) + .then((res) => res.status === 200) + .catch(() => false); + + console.log( + `${network.id.padEnd(22)} ${ethChain.chainid.toString().padEnd(15)} ${(inRegistry ? "✅" : "❌").padEnd(7)} ${inProxy ? "✅" : "❌"} ${url}`, + ); + await sleep(7000); // limited to 10 requests in 1 minute + } + } catch (error) { + console.error("Error in main:", error); + process.exit(1); + } +} + +main();