Add 'dumpbootstrap' RPC for creating bootstrap.dat files. #10081

pull dooglus wants to merge 1 commits into bitcoin:master from dooglus:dumpbootstrap changing 2 files +73 −0
  1. dooglus commented at 4:48 AM on March 26, 2017: contributor

    I don't know if there's any interest in merging this or not, but I find it useful. It will dump a bootstrap.dat file from a synced node that can be used to sync another node.

    You can dump any part of the blockchain using the optional parameters. By default it will dump the whole blockchain.

    $ bitcoin-cli help dumpbootstrap
    dumpbootstrap <destination> [endblock] [startblock=0]
    
    Creates a bootstrap format block dump of the blockchain in destination, which can be a directory or a path with filename, up to the given endblock number.
    
    Arguments:
    1. destination  (string, required) Pathname of file to write to. If a directory is use, 'bootstrap.dat' is created in that directory.
    2. endblock     (numeric, optional, defaults to the last block in the active chain) Height of last block to dump.
    3. startblock   (numeric, optional, default=0) Height of first block to dump.
    
    Result:
    
    Examples:
    > bitcoin-cli dumpbootstrap "/tmp"
    > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "dumpbootstrap", "params": ["/tmp"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
    
    $ bitcoin-cli dumpbootstrap /tmp/ 10
    dumped 11 blocks from 0 to 10 into /tmp/bootstrap.dat
    
    $ bitcoin-cli dumpbootstrap /tmp 10 11
    error code: -1
    error message:
    Start block number out of range.
    
    $ bitcoin-cli dumpbootstrap /tmp/ 30 20
    dumped 11 blocks from 20 to 30 into /tmp/bootstrap.dat
  2. Add 'dumpbootstrap' RPC for creating bootstrap.dat files. 90701994f2
  3. dooglus force-pushed on Mar 26, 2017
  4. sipa commented at 8:55 AM on March 26, 2017: member

    This does the same as linearize.py?

  5. cdecker commented at 11:34 AM on March 26, 2017: contributor

    I like the simplicity of the implementation, but I wonder how many people will find it useful.

  6. dooglus commented at 11:42 AM on March 26, 2017: contributor

    @sipa If linearize.py creates bootstrap.dat format files from a synced blockchain then I guess so. I hadn't heard of linearize.py.

    Are you talking about contrib/linearize/linearize-data.py? That's the closest I can find in this repository.

    I find it convenient to use dumpbootstrap to dump the portion of the blockchain I want into a linear file but understand if you don't want the functionality duplicated.

  7. fanquake added the label RPC/REST/ZMQ on Mar 26, 2017
  8. laanwj commented at 7:58 AM on March 27, 2017: member

    I think this could be useful in some cases.

    However remembering the recent discussion on dumpwallet (#9937, #9934), I'd prefer not to have more RPCs that create or write server-side files. It introduces security risks, can load to dangerous situations (e.g. overwriting the wallet) and also interferes with future process sandboxing.

    The ideal solution to this would be to stream the data over HTTP instead, which I attempted to introduce in #7759. Unfortunately I had no time to continue that.

    And as said, this is already what the linarize tooling does. There is not an urgent need to have this functionality in bitcoind.

  9. laanwj commented at 1:36 PM on June 14, 2017: member

    Let's close this for now. Tooling to generate bootstrap.dat is available, after all, and it doesn't seem like something that has a lot of users, so I'm not convinced it makes sense to merge this.

  10. laanwj closed this on Jun 14, 2017

  11. DrahtBot 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-13 15:15 UTC

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