Skip to content

Instantly share code, notes, and snippets.

@amphineko
Last active August 20, 2021 15:55
Show Gist options
  • Save amphineko/89d5e5a6ca928bbfaed64a61d966f0cf to your computer and use it in GitHub Desktop.
Save amphineko/89d5e5a6ca928bbfaed64a61d966f0cf to your computer and use it in GitHub Desktop.
Khala: something is wrong at #58602
const start = 58600
const end = 58700
for (let i = start; i < end; i++) {
if (i % 100 === 0) {
console.log(`fetch block [${i}, ${i + 99}]`)
}
const blockHash = await api.rpc.chain.getBlockHash(i)
try {
await api.rpc.chain.getBlock(blockHash)
} catch (error) {
console.error(`Failed at block #${i} with hash ${blockHash}`)
console.error(error)
}
}
console.info('Ok')
fetch block [58600, 58699]
Failed at block #58602 with hash 0xaf1d3ae0793192e971b591482e6722f449de7cb03626cfeaa03d1bf2e7cd9ff3
Error: -32603: Unknown error occurred: Client, Application, NotInFinalizedChain
at b._checkError (https://polkadot.js.org/apps/polkadot.01.57a90f6a.js:1:128478)
at b.decodeResponse (https://polkadot.js.org/apps/polkadot.01.57a90f6a.js:1:128097)
at $.value (https://polkadot.js.org/apps/polkadot.01.57a90f6a.js:1:132603)
at WebSocket.value (https://polkadot.js.org/apps/polkadot.01.57a90f6a.js:1:132416)
TypeError: console.info is not a function
at eval (eval at <anonymous> (https://polkadot.js.org/apps/main.5df94254.js:19:446732), <anonymous>:20:9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment