Get as many blocks as possible (stale, invalid, orphans)

2

I would like to download (and access) as much blocks as possible - including stale (extinct) blocks, orphans blocks and invalid blocks.
I have 0.11 official client.
My node is already synchronized but I can re-sync for that.
As I understand thanks to header-first IBD method (and maybe some other improvement) introduced in 0.10.0:

  • I have as few as possible stale blocks (only those downloaded after IBD)
  • I don't have invalid blocks
  • I don't have orphans as they were not materialized because they would be waiting for missing parents(?)

How can I download as much of them as possible?

Besides of downloading blocks what rpc calls should I use to query those blocks from local blockchain?

  • getbestblock will let me iterate using getblock from the most recent block all the way down to genesis
  • I can also getblock to iterate starting from genesis block

None of above gives access to stale or invalid. Orphaned were not materialized, correct?, so I'm not interested to access blocks which are still in-memory.

jangorecki

Posted 2015-09-01T12:05:34.180

Reputation: 183

1You might want to look at the RPC call getchaintips. It tells you the tips of all the chains you know about, many of which will be stale blocks.morsecoder 2015-09-01T13:07:21.437

4Bitcoin Core has never stored invalid blocks, they are rejected and the peer that sent them is banned. You will not likely find any because they are impossible to broadcast around the network.Anonymous 2015-09-01T13:24:19.127

@StephenM347 good point, from tips I can go similarly as from the getbestblock. Is there a way to download historical stale blocks then?jangorecki 2015-09-01T19:39:51.493

@jangorecki, only way I know of is to read the getchaintips from a node that has been live for a very long time!morsecoder 2015-09-01T20:05:41.197

@Bitcoin There are a couple of invalid blocks that are nonetheless well-known, like the ones in the 0.9.4/0.10.0 fork.Nick ODell 2015-09-02T03:57:18.253

@NickODell I'm not so much interested in invalid block now as in the stale blocks. And it looks like there is no way to get them without have own node running for a long time(?).jangorecki 2015-09-02T10:30:06.953

No answers