Replies: 1 comment 5 replies
-
I'm not sure what it is that you mean by "unvalidated blocks". However, if this means that you just want to get all the new blocks that are being observed by the client (regardless of whether they are finalized, best or whatever), then you can get those from the import { CompatibilityLevel, createClient } from "polkadot-api"
import { getSmProvider } from "polkadot-api/sm-provider"
import { start } from "polkadot-api/smoldot"
import { chainSpec } from "polkadot-api/chains/polkadot"
const smoldot = start()
const client = createClient(getSmProvider(smoldot.addChain({ chainSpec })))
client.blocks$.subscribe((block) => {
console.log(block.hash)
})If by "unvalidated blocks" you refer to blocks that have not been validated to be part of the chain... Then, I'm afraid that there is no way to have access to those blocks, and IMO it doesn't make a whole lot of sense for smoldot to expose them... |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
I recently worked on a tool (PAPI, TypeScript based) that was investigating some network issues. At first I used smoldot, but I was unable to locate a way to gain access to the unvalidated blocks.
I could see them when logging, and even thought about trying to scan the log for the information, but the logger doesn't have the complete hash, so that wasn't an option either.
Is there perhaps another way? If not, is this a feature that would be welcome for others?
Beta Was this translation helpful? Give feedback.
All reactions