Created
January 7, 2022 10:38
-
-
Save isSerge/a9ced746e057d28f905511ebd9899cc9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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