Import $DataDir/bootstrap.dat automatically, if it exists. #1684

pull jgarzik wants to merge 1 commits into bitcoin:master from jgarzik:bootstrap changing 1 files +14 −1
  1. jgarzik commented at 11:13 PM on August 17, 2012: contributor

    As discussed on IRC. Intended to make using an external blockchain download solution just a bit easier.

  2. BitcoinPullTester commented at 2:47 AM on August 18, 2012: none

    Automatic sanity-testing: FAILED MERGE, see http://jenkins.bluematt.me/pull-tester/e1a36eefea413f83f91da3f4ffdbb0182f45587e for test log.

    This pull does not merge cleanly onto current master

  3. laanwj commented at 7:21 AM on August 18, 2012: member

    Is this functionality currently safe enough to trigger automatically? What will happen in these cases:

    1. Client stops before full import completes

    2. User exits (after succesful import), then re-starts bitcoin

    Also, we probably want some kind of progress widget, as the process can take a few hours.

  4. luke-jr commented at 7:31 AM on August 18, 2012: member

    Right now, Bitcoin-Qt is fully interactive during IBD...

  5. laanwj commented at 7:35 AM on August 18, 2012: member

    @luke-jr So to decode that, you mean run this importing in a thread (after the Init succeeds), pretend that the blocks come in from the network, and use the current progress mechanism? I suppose that could work, if you block the real network for the duration that the file is being read.

    Also it doesn't address the above points. Does it somehow need to remember where it was with importing, between runs?

  6. Diapolo commented at 9:07 AM on August 18, 2012: none

    I recently added an info message when doing a -loadblock, so this needs a rebase + the shorter the message the better, because of the small splashscreen. @luke-jr When doing a -loadblock nothing is interactive, the client is just displaying the splashscreen and a message for ~1 hour or more.

  7. luke-jr commented at 1:26 PM on August 18, 2012: member

    @laanwj I guess that would keep the current IBD behaviour during a loadblocks. However, it seems like it has potential to slow things down, so should probably be tested.

  8. laanwj commented at 2:38 PM on August 18, 2012: member

    It should not be used for the specific -loadblocks, which is also a benchmark.

    But for the automatic loadblocks for bootstrapping users (that jgarzik is proposing) it'd be fine. It's fine if it is a bit slower as long as the user gets feedback and doesn't have the idea that his client crashed at the splash screen.

  9. Diapolo commented at 2:42 PM on August 18, 2012: none

    So perhaps rebase and change the second InitMessage to Auto-Importing blocks...?

  10. sipa commented at 8:49 PM on August 18, 2012: member

    I'm planning on writing a "reindexer" that takes an existing blk*.dat file (in the normal location for those), and rebuilds/updates the index with the found blocks, and afterwards reorg to a new best chain if one is found there. That's maybe even preferable?

  11. jgarzik commented at 8:56 PM on August 18, 2012: contributor

    Yes, a reindexer would absolutely be preferred. Should be faster, with less disk traffic, and no files left over at the end.

  12. mikehearn commented at 1:02 PM on August 19, 2012: contributor

    A better way to reindex would be great, I already did some code for this (loading a blk?.dat files with a progress gui) in the leveldb branch but it's not very good because I wanted the change as small as possible.

  13. gmaxwell commented at 1:21 PM on August 20, 2012: contributor

    Am I misunderstanding this patch? It looks like it will reimport at every startup because it doesn't remove/move/flag the file when done. That seems pretty surprising.

  14. laanwj commented at 2:05 PM on August 20, 2012: member

    Yes, I thought so. That's why I asked what would happen in those cases.

  15. jgarzik commented at 3:10 PM on September 4, 2012: contributor

    Rebased, and corrected the FMB (frequently mentioned bug): it now renames bootstrap.dat, after import, to prevent re-import.

    That should address all outstanding objections.

  16. in src/init.cpp:None in 25b5d5da7d outdated
     720 | @@ -721,7 +721,8 @@ bool AppInit2()
     721 |  
     722 |      if (mapArgs.count("-loadblock"))
     723 |      {
     724 | -        uiInterface.InitMessage(_("Importing blocks..."));
     725 | +        uiInterface.InitMessage(_("Importing blockchain data file.  This operation may take several hours."));
    


    Diapolo commented at 4:03 PM on September 4, 2012:

    Can you please remove that double-space, it really sucks on Transifex to have these, thanks :). Same for the second string below...

    Edit: And as that message is quite large it will perhaps not even fit in our tiny splashscreen.

  17. BitcoinPullTester commented at 2:26 PM on September 6, 2012: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/25b5d5da7daf046c974bb32785bb58f877d46795 for binaries and test log.

  18. Import $DataDir/bootstrap.dat automatically, if it exists.
    As discussed on IRC. Intended to make using an external blockchain download
    solution just a bit easier.
    52c90a2b2b
  19. jgarzik commented at 5:38 PM on September 24, 2012: contributor

    Updated strings, addressing @Diapolo's comments.

  20. Diapolo commented at 8:28 PM on September 24, 2012: none

    @jgarzik Thanks, one last nitpick, we use ellipsis for every stage of the init and you make me happy, when you convert the . into ... for both strings :-D. You are free to hate me a little afterwards ^^, but get my ACK then.

  21. gavinandresen commented at 8:34 PM on September 25, 2012: contributor

    ACK.

    (and I think Diapolo's nit-picking is excessive)

  22. Diapolo commented at 8:42 PM on September 25, 2012: none

    @gavinandresen I sometimes hate that character trait and so I'm fine with other devs ignoring some of the nit-picks if they feel bugged.

  23. jgarzik referenced this in commit 1381ad2b21 on Sep 25, 2012
  24. jgarzik merged this on Sep 25, 2012
  25. jgarzik closed this on Sep 25, 2012

  26. jgarzik deleted the branch on Aug 24, 2014
  27. 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-20 00:16 UTC

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