Skip to content

Instantly share code, notes, and snippets.

@isSerge
Created January 7, 2022 10:38
Show Gist options
  • Select an option

  • Save isSerge/a9ced746e057d28f905511ebd9899cc9 to your computer and use it in GitHub Desktop.

Select an option

Save isSerge/a9ced746e057d28f905511ebd9899cc9 to your computer and use it in GitHub Desktop.
const { ApiPromise, WsProvider } = require("@polkadot/api");
async function main() {
const provider = new WsProvider('wss://kusama-rpc.polkadot.io');
const api = await ApiPromise.create({ provider });
const number = 10857954;
const hash = await api.rpc.chain.getBlockHash(number);
const block = await api.rpc.chain.getBlock.raw(hash); // same with chain.getBlock(hash);
console.log(block.justifications); // result is null
}
main().catch(e => console.log(e));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment