Makebootstrap #5217

pull Elbandi wants to merge 2 commits into bitcoin:master from Elbandi:makebootstrap changing 8 files +149 −0
  1. Elbandi commented at 11:48 AM on November 5, 2014: contributor

    Hi,

    i had to export bootstrap file from some favorite altcoins. There is already an export script, but that is very slow, because blocks are queried from rpc. So i added some funcions to the coin's codebase, so the bootstrap export is accelerated by this. I want to share my code.

    The are two commit in this push: one made the export by running the daemon/wallet. the second allow made the bootstrap in a running daemon/wallet.

    The command line parameter required a filename or filepath. The bootstrap data is exported to this file. There are another two helper parameter, this allow exporting a part of the blockchain: the first blocks (minheight) and the last blocks (maxheight).

    The rpc command do the same: require a filename/filepath parameter, and the optional first/last blockheight. If no first/last are given, the whole blockchain is exported (1..bestblockheight).

    If you like this feature, feel free to give some notes.

    Note: the rpc exporting sould made by a separete thread, but i dont know how to modify the TraceThread function to pass parameter(s).

  2. Generate bootstrap.dat file with the wallet 8b2c75a28b
  3. makebootstrap rpc command 7ce51ec7bc
  4. jgarzik commented at 11:51 AM on November 5, 2014: contributor

    NAK. (1) duplicates linearize (2) no need to build this into bitcoind at all.

    See https://github.com/bitcoin/bitcoin/tree/master/contrib/linearize

  5. laanwj commented at 11:58 AM on November 5, 2014: member

    Agreed @jgarzik

    You could just have asked how we make a bootstrap.dat file? That script has existed for a while, but maybe it's underdocumented. Anyhow, on the positive side, now you gained some experience in patching bitcoind...

    Edit: no, the blocks are not queried using RPC in the current export script, just the block hashes are, and that's done using batched JSON-RPC so very fast

  6. Diapolo commented at 1:28 PM on November 5, 2014: none

    Running a python script on Windows is ugly, I didn't look at the code, but why not?

  7. Elbandi commented at 1:29 PM on November 5, 2014: contributor

    the main reason was the speed: the old rpc based script was running many hours (~10 hours, 600k blocks) on Diamon altcoin. With in-wallet export, this need <20 minutes. If this new python script are same fast, that's good. :)

    The second reason, is more complex: many altcoin are based on your codebase. they may have multihashing algo or new fields on blocks/transactions etc. This new stuff are good handled on code (readblockfromdisk, writeblocktodisk). But this altcoins cannot use your linearize script, because they have to port they changes into the script. Maybe that's hard or impossible. With in-wallet export, they doesnt need this.

  8. jgarzik commented at 1:39 PM on November 5, 2014: contributor

    @Diapolo It duplicates existing scripts, adding complexity where none is needed. The current trend is to move code out of bitcoind, not the other way around. @Elbandi If alt-coins refuse to upgrade their codebase, the maintenance cost is on them, not us. Our linearize script is sufficiently fast.

  9. sipa commented at 1:39 PM on November 5, 2014: member

    If they're not competent to make the necessary changes to a simple python script, I'm very doubtful whether they should be running their own currency...

  10. laanwj commented at 1:54 PM on November 5, 2014: member

    @Diapolo Running a bare Python script on Windows is not ugly at all. We had lots of Python code at my last employer, running on Windows as well. It gets ugly when you need dependencies such as PyQt, but that's not the case here, the script has no dependencies beyond the base library.

  11. laanwj closed this on Nov 5, 2014

  12. laanwj commented at 2:02 PM on November 5, 2014: member

    Note that the bootstrap file has become a lot less important now that headers-first synchronization has been implemented, so there's no use to have two ways to do it.

    If this makes sense for altcoins, then apply it to altcoins. For us it doesn't, so I'm closing this.

  13. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me