Skip to content

Commit

Permalink
Merge pull request #491 from api3dao/main
Browse files Browse the repository at this point in the history
Initiate release
  • Loading branch information
hiletmis authored Nov 5, 2024
2 parents 1fbd9c1 + 712f7c5 commit b360a69
Show file tree
Hide file tree
Showing 39 changed files with 121 additions and 53 deletions.
25 changes: 25 additions & 0 deletions .changeset/forty-vans-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
'@api3/chains': patch
---

Fixes following issues:
* conflux-testnet
- Remove inconsistent rpc url
* ethereum-sepolia-testnet
- Remove inconsistent rpc url
* fraxtal-holesky-testnet
- Set api key required to true
* gnosis
- Change hardhatEtherscanAlias
* kava
- Update api url
* kava-testnet
- Update api url
* taiko
- Swap default rpc url with public
* taiko-holesky-testnet
- Replace block explorer with a new one
* x-layer
- Update api url
* x-layer-sepolia-testnet
- Update api url
2 changes: 2 additions & 0 deletions .changeset/selfish-flowers-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
1 change: 1 addition & 0 deletions chains/arbitrum-nova.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"rpcUrl": "https://nova.arbitrum.io/rpc"
}
],
"skipProviderCheck": true,
"symbol": "ETH",
"testnet": false
}
1 change: 1 addition & 0 deletions chains/aurora-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"rpcUrl": "https://testnet.aurora.dev/"
}
],
"skipProviderCheck": true,
"symbol": "ETH",
"testnet": true
}
1 change: 1 addition & 0 deletions chains/aurora.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"rpcUrl": "https://mainnet.aurora.dev/"
}
],
"skipProviderCheck": true,
"symbol": "ETH",
"testnet": false
}
1 change: 1 addition & 0 deletions chains/boba-bnb.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"rpcUrl": "https://replica.bnb.boba.network/"
}
],
"skipProviderCheck": true,
"symbol": "BOBA",
"testnet": false
}
1 change: 1 addition & 0 deletions chains/boba-ethereum.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"rpcUrl": "https://lightning-replica.boba.network/"
}
],
"skipProviderCheck": true,
"symbol": "BOBA",
"testnet": false
}
1 change: 1 addition & 0 deletions chains/bsquared-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"rpcUrl": "https://b2-testnet.alt.technology"
}
],
"skipProviderCheck": true,
"symbol": "BTC",
"testnet": true
}
1 change: 1 addition & 0 deletions chains/bsquared.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"rpcUrl": "https://b2-mainnet.alt.technology"
}
],
"skipProviderCheck": true,
"symbol": "BTC",
"testnet": false
}
1 change: 1 addition & 0 deletions chains/canto-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"rpcUrl": "https://canto-testnet.plexnode.wtf/"
}
],
"skipProviderCheck": true,
"symbol": "CANTO",
"testnet": true
}
1 change: 1 addition & 0 deletions chains/canto.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"rpcUrl": "https://canto.gravitychain.io/"
}
],
"skipProviderCheck": true,
"symbol": "CANTO",
"testnet": false
}
4 changes: 0 additions & 4 deletions chains/conflux-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
{
"alias": "public",
"rpcUrl": "https://evmtest.confluxrpc.com/"
},
{
"alias": "backup",
"rpcUrl": "https://evmtestnet.confluxrpc.org/"
}
],
"symbol": "CFX",
Expand Down
1 change: 1 addition & 0 deletions chains/cronos-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"rpcUrl": "https://evm-t3.cronos.org"
}
],
"skipProviderCheck": true,
"symbol": "CRO",
"testnet": true
}
4 changes: 0 additions & 4 deletions chains/ethereum-sepolia-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
"providers": [
{
"alias": "default",
"rpcUrl": "https://rpc2.sepolia.org"
},
{
"alias": "publicnode",
"rpcUrl": "https://ethereum-sepolia-rpc.publicnode.com"
}
],
Expand Down
2 changes: 1 addition & 1 deletion chains/fraxtal-holesky-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"explorer": {
"api": {
"key": {
"required": false
"required": true
},
"url": "https://api-holesky.fraxscan.com/api/"
},
Expand Down
2 changes: 1 addition & 1 deletion chains/gnosis.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"explorer": {
"api": {
"key": {
"hardhatEtherscanAlias": "gnosis",
"hardhatEtherscanAlias": "xdai",
"required": true
},
"url": "https://api.gnosisscan.io/api"
Expand Down
1 change: 1 addition & 0 deletions chains/godwoken-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"rpcUrl": "https://v1.testnet.godwoken.io/rpc"
}
],
"skipProviderCheck": true,
"symbol": "pCKB",
"testnet": true
}
1 change: 1 addition & 0 deletions chains/godwoken.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"rpcUrl": "https://v1.mainnet.godwoken.io/rpc"
}
],
"skipProviderCheck": true,
"symbol": "pCKB",
"testnet": false
}
2 changes: 1 addition & 1 deletion chains/kava-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"key": {
"required": false
},
"url": "https://testnet.kavascan.com/api"
"url": "https://api.verify.mintscan.io/evm/api/0x8ad"
},
"browserUrl": "https://testnet.kavascan.com/"
},
Expand Down
2 changes: 1 addition & 1 deletion chains/kava.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"key": {
"required": false
},
"url": "https://kavascan.com/api"
"url": "https://api.verify.mintscan.io/evm/api/0x8ae"
},
"browserUrl": "https://kavascan.com/"
},
Expand Down
1 change: 1 addition & 0 deletions chains/meld-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"rpcUrl": "https://testnet-rpc.meld.com/"
}
],
"skipProviderCheck": true,
"symbol": "MELD",
"testnet": true
}
1 change: 1 addition & 0 deletions chains/meld.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"rpcUrl": "https://rpc-1.meld.com/"
}
],
"skipProviderCheck": true,
"symbol": "MELD",
"testnet": false
}
1 change: 1 addition & 0 deletions chains/meter-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"rpcUrl": "https://rpctest.meter.io/"
}
],
"skipProviderCheck": true,
"symbol": "MTR",
"testnet": true
}
1 change: 1 addition & 0 deletions chains/meter.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"homepageUrl": "https://blockpi.io"
}
],
"skipProviderCheck": true,
"symbol": "MTR",
"testnet": false
}
1 change: 1 addition & 0 deletions chains/milkomeda-c1-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"rpcUrl": "https://rpc-devnet-cardano-evm.c1.milkomeda.com"
}
],
"skipProviderCheck": true,
"symbol": "ADA",
"testnet": true
}
1 change: 1 addition & 0 deletions chains/milkomeda-c1.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"rpcUrl": "https://rpc-mainnet-cardano-evm.c1.milkomeda.com"
}
],
"skipProviderCheck": true,
"symbol": "ADA",
"testnet": false
}
1 change: 1 addition & 0 deletions chains/neon-evm-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"rpcUrl": "https://devnet.neonevm.org"
}
],
"skipProviderCheck": true,
"symbol": "NEON",
"testnet": true
}
1 change: 1 addition & 0 deletions chains/neon-evm.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"rpcUrl": "https://neon-mainnet.everstake.one"
}
],
"skipProviderCheck": true,
"symbol": "NEON",
"testnet": false
}
1 change: 1 addition & 0 deletions chains/rsk-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"rpcUrl": "https://public-node.testnet.rsk.co"
}
],
"skipProviderCheck": true,
"symbol": "RBTC",
"testnet": true
}
1 change: 1 addition & 0 deletions chains/rsk.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"rpcUrl": "https://public-node.rsk.co"
}
],
"skipProviderCheck": true,
"symbol": "RBTC",
"testnet": false
}
1 change: 1 addition & 0 deletions chains/sx-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"rpcUrl": "https://rpc.toronto.sx.technology"
}
],
"skipProviderCheck": true,
"symbol": "SX",
"testnet": true
}
1 change: 1 addition & 0 deletions chains/sx.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"rpcUrl": "https://rpc.sx.technology"
}
],
"skipProviderCheck": true,
"symbol": "SX",
"testnet": false
}
6 changes: 3 additions & 3 deletions chains/taiko-holesky-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"explorer": {
"api": {
"key": {
"required": false
"required": true
},
"url": "https://blockscoutapi.hekla.taiko.xyz/api"
"url": "https://api-hekla.taikoscan.io/api"
},
"browserUrl": "https://blockscoutapi.hekla.taiko.xyz/"
"browserUrl": "https://hekla.taikoscan.io/"
},
"id": "167009",
"name": "Taiko testnet",
Expand Down
4 changes: 2 additions & 2 deletions chains/taiko.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"providers": [
{
"alias": "default",
"rpcUrl": "https://rpc.taiko.tools"
"rpcUrl": "https://rpc.mainnet.taiko.xyz"
},
{
"alias": "public",
"rpcUrl": "https://rpc.mainnet.taiko.xyz"
"rpcUrl": "https://rpc.taiko.tools"
},
{
"alias": "publicnode",
Expand Down
6 changes: 6 additions & 0 deletions chains/x-layer-sepolia-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
"alias": "x-layer-sepolia-testnet",
"decimals": 18,
"explorer": {
"api": {
"key": {
"required": false
},
"url": "https://www.oklink.com/api/v5/explorer/contract/verify-source-code-plugin/XLAYER_TESTNET"
},
"browserUrl": "https://www.okx.com/explorer/xlayer-test/"
},
"id": "195",
Expand Down
6 changes: 6 additions & 0 deletions chains/x-layer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
"alias": "x-layer",
"decimals": 18,
"explorer": {
"api": {
"key": {
"required": false
},
"url": "https://www.oklink.com/api/v5/explorer/contract/verify-source-code-plugin/XLAYER"
},
"browserUrl": "https://www.okx.com/explorer/xlayer/"
},
"id": "196",
Expand Down
1 change: 1 addition & 0 deletions chains/zksync.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"rpcUrl": "https://mainnet.era.zksync.io"
}
],
"skipProviderCheck": true,
"symbol": "ETH",
"testnet": false
}
21 changes: 0 additions & 21 deletions scripts/ping-providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ async function main(): Promise<PromiseSettledResult<void>[]> {
const client = createPublicClient({ transport: http(defaultProvider.rpcUrl!) });

await validateChain(client, chain);
const latestRes = await go(() => validateLatestBlock(client, chain), {
retries: 3,
delay: { type: 'static', delayMs: 60_000 },
});
if (!latestRes.success) {
throw latestRes.error;
}
});

return await Promise.allSettled(promises);
Expand All @@ -44,20 +37,6 @@ async function validateChain(client: PublicClient, chain: Chain): Promise<void>
}
}

async function validateLatestBlock(client: PublicClient, chain: Chain): Promise<void> {
const blockRes = await go(() => client.getBlock({ blockTag: 'latest' }), { retries: 1 });
if (!blockRes.success) {
throw new Error(`Unable to fetch latest block for ${chain.alias}`);
}
const block = blockRes.data;
const blockTimestamp = block.timestamp;
const deltaTime = Number(BigInt(Math.floor(Date.now() / 1000)) - blockTimestamp);
const cutoff = 60 * 5; // Arbitrary cutoff of 5 minutes
if (Math.abs(deltaTime) > cutoff) {
throw new Error(`${chain.alias} latest block timestamp is ${deltaTime} seconds behind the system clock`);
}
}

async function notifySlack(errors: Error[]): Promise<Error[]> {
if (errors.length > 0 && slackChannel) {
const text = errors.reduce((acc, error) => `${acc}\n${error.message}`, '');
Expand Down
Loading

0 comments on commit b360a69

Please sign in to comment.