-
Notifications
You must be signed in to change notification settings - Fork 57
Use previously downloaded blockchain #119
Comments
It's not officially supported but if you don't mind getting your hands dirty it's definitely possible. You'll need to:
The reason for needing a Linux host is that the SSD is formatted as EXT4 which macOS and Windows don't have write access to by default. If you don't have access to a Linux machine mounting the storage device in a Linux VM should also work. The reason for not attaching an additional SSD with the blockchain to the Pi and copying the files over like that is because in our testing even high capacity power supplies where unable to supply enough power to the Pi to let it run two SSDs simultaneously without stability issues. |
Thanks, pretty straight forward, and nothing I haven't done before. Although as future enhancement it would be cool if on setup Umbrel would detect if there was a previous blockchain on disk and ask if you'd like to use that or just wipe and start fresh... |
@talvasconcelos Yeah that's been suggested a few times, but it's not actually that simple. We completely format the drive to make sure we're using a good filesystem with efficient block sector offset and have everything laid out the way we want it. Migrating existing data would involve partitioning half the drive, copying over some data, then resizing the partitions, move over more data, rinse, repeat, etc. We could also run into issues with file permissions. Or what if the blockchain data comes from a more recent version of Bitcoin Core than we run in Umbrel? We might migrate successfully but Umbrel's older Bitcoin Core might not be able to read the data. We ultimately decided that it would be quite a lot of work to implement well, and even then there would probably be many edge cases where it wouldn't be reliable. It's much easier and more reliable to nuke the drive to be completely sure that everything is set up correctly the way Umbrel is expecting. Advanced users can always fairly easily mount the drive and copy over the data files themselves. |
See getumbrel/umbrel#185 (comment) for previous discussion. |
@lukechilds BTW, about permissions, what's the permission set for the bitcoin folder? I'm pretty sure it will get screwed once I finish copying stuff over (group:user)! Also if I'd want to do a scp from one pi to the other, how do I stop the bitcoind and lnd until copy it's over? just stop the daemons? there's a "special command" to stop them? sudo service stop bitcoind? lnd? and it's good to go? And yet, if I decide to just let the node sync (probably not because it's eating my bandwith), is the node fully functional the same way, until it syncs? or does it need to finish the IBD, syncing and all that? Sorry about probably stupid noob questions but I'd like to weight my options here! |
This should make sure everything is readable by the Umbrel user:
If you SSH in to your Umbrel you can stop all Umbrel related stuff with:
and then when you're done:
Although word of warning, scp is very slow for copying a large number of small files, I think last time I tried it was gonna take days to copy a Bitcoin data dir via scp.
It's fully functional right away, no need to wait for IBD. Umbrel runs in SPV mode during IBD so you can instantly use Bitcoin and Lightning, then once Bitcoin Core is fully synced we disable SPV and switch over to your own full node.
Not at all! All good questions. |
I just tried this and it kind of worked, the issue I am running into is when i start Umbrel with the copied blocks and chaindata folder, it start a rescan that seems take forever, here are some logs:
Is it possible to skip this process, since I trust the chaindata? From what I have seen so far it seems this process is going to take long time, which defeats the purpose to copy the chaindata |
Rescanning is nothing to do with Umbrel, we don't use the Bitcoin Core wallet at all. Are you linking Umbrel with some other app that is doing a rescan via Bitcoin Core RPC? If not, it could be caused by your wallet.dat from your old Bitcoin Core install. Do you have anything important in wallet.dat? If you don't you should be able to shutdown Umbrel, delete wallet.dat, then start it again. (maybe take a backup of of wallet.dat just incase you do have something important in it) |
Yeah and it didnt't take that long time as I expected so we are all good, thanks for your quick response |
I've just done the process that you've described, but used
|
So, the SSD can't be used as a plug'n play Bitcoin blockchain to sync with any version of the Bitcoin Core? |
@csralvall No, the SSD doesn't contain only the blockchain, but also all Umbrel data, following a specific architecture. |
Should I copy |
Hi, and thanks for great help! I decided to take this approach too. However I ran into a little problem I hope you can help me with. I did:
I looked in the logs and got this: ... I then added "reindex=1" to the bitcoin.conf file. It changed the log slightly to: ... I then ran: "sudo chown -R 1000:1000 bitcoin" standing in the umbrel directory. Now logs look like this: |
Same problem here. How can we copy all files like they are regular files from Umbrel, is that possible? (so we have no permission issues and this kind of errors) |
Would it be possible to, hypothetically, scan for another Umbrel on the network and if one is found with more blockchain data than the current one, fetch from it? It should be discoverable, the user can provide the password, and the files should always be in the same place... I'm thinking a little popup when a new Umbrel is set up for the first time (or even a button in the settings page). I'll look into building this if it's feasible? (No idea where to start but I can learn fast) |
Did anyone find a fix to the error
|
Works like a charm! thanks a lot. |
Noob here. I've been following this for a couple weeks now. I've got a bitcoin node running on my mac. It's up to date.
So, I'm not sure if there is a long-term effect of loading the indexes too, but it definitely worked for me. YMMV, maybe give it a try... |
I had to reinstall Umbrel today so followed steps from @lukechilds comment and got the indexing error mentioned above. I copied
|
I think this is important... @lukechilds can you please update the top comment? My fresh Umbrel 0.5 install is error looping.. So looks like I need to start all over, and can't use my old blockchain. |
Same here! I had to finally reindex from scratch... Too bad I didn't scroll all the way down.
|
Is it possible to use a previously downloaded blockchain?
I already have a node running and have the entire blockchain, in order to avoid the IBD on my very slow internet, I'd like to be able to that. Is this possible?
Thanks,
Tiago
The text was updated successfully, but these errors were encountered: