This update was made for you to have as few worries as possible about your system's uptime. The one thing that's always problematic in systems management is that many things can happen that become a blockage for the system to work. Be it breaking updates, configuration errors, hardware malfunction, or otherwise.
Sometimes you can be endlessly busy researching why something is bothering your system, but uptime is important for this very reason as in this case, it interrupts your capacity to make transactions. And it's always most bothersome when you need to make those important transactions only to find out the system won't be up any time soon.
With that in mind, the most effective mitigation that helps users to at least be able to continue using software that connects to their node, is the ability to recover your system as closely as possible to what it was before the problem arose. It might not be the the desired outcome straightaway, as you want nothing to be wrong in the first place. But, the priority is to guarantee that there is a way for you to continue without even having to worry whether you can figure out what's wrong (much less what would even be the solution).
This release, we've put our effort into improving the feature set for backups, as a fresh installation plus restoring a backup is the most surefire way to get back on track, be it on the same device or another, while continuing right where the previous one had stopped.
Disaster recovery
Preparing for the worst, coming out the best
The backup procedure
RoninDojo has for the longest time had a simple but solid start to doing backups: the Initial Blockchain Download (IBD). When we're referring to IBD, we're talking about the chunk of data that's several hundreds of GB's that needs to be downloaded and verified. Without it, you'd have to trust some third party service before you could transact. But before you have it, you have to wait for hours if not days, depending on your internet connection and system specs.
When you install RoninDojo fresh, this option would allow you to receive this data from a backup device. Your system would replace the nearly empty IBD that had already started with the one from your backup. After placing the data onto your system, there would be a short procedure of the system going through the files. This would resolve in minutes and after which the IBD would be close to done, leaving only the newer blockchain data to be downloaded that has been produced on Bitcoin since the moment you created that backup.
There would be plenty to do for the system after that, as the indexer also has to traverse this massive chunk of data for generic operational functionality, and the tracker would have to process it as well for the xpubs your wallet uses specifically. This would still be downtime for a significant portion of a day at best.
It also required the user to reconfigure and connect their wallet to the newly installed Dojo, given that the onion URLs changed and the wallet's old settings would no longer work. This implies the user would be forced to connect to the system over his local network first to get the connection data via RoninUI, meaning the user would be sitting there waiting for the freshly installed system to reach the part of the installation procedure where RoninUI would be up and running.
RoninDojo V2.2.0
Backup includes the indexer data
RoninDojo v2.2.0 now also sends the indexer data onto the backup device.
You read that right: whether you're running addrindexrs, electrs, or fulcrum, your indexer data will be backed up on the backup device. When you start the backup receive procedure, the indexer data will be placed the same way it places the IBD.
Backup includes the Dojo configuration
All the tor onion data and the api keys can now also be backed up. When receiving this data, a "full Dojo rebuild" happens which is roughly the same as a new installation (but now using your configuration from your backup). So don't be alarmed if it looks like it's doing more than placing a set of configuration files, that's supposed to happen. The rest of the data won't be wiped, so your IBD and Indexer data and Database will stay intact, meaning it should take only a relatively short time for the system to be up and running and using the changed configuration.
Note: be aware that when you back up this data, your device now contains sensitive information about the system (but not sensitive data from your wallet!). You don't have to back up this data. You can choose to back up only the IBD + Indexer data in case you believe it would be safer for your personal situation.
Note: RoninUI's Tor onion will not be backed up. It would require more architectural changes outside the scope of this release and were forced to postpone implementing this. The technical TL;DR is: RoninUI exists outside the Dojo installation, and the new backup architecture was tailored mainly for the Dojo architecture.
Salvage
The salvage procedure is known by those who had to reinstall the system for whichever technical reason. The SD card would be reflashed by the user with the OS image, the system would boot with this and perform its first time install procedure. During this procedure, it would check to see if there was data already present on the storage device and try to reuse that.
In the past it would only reuse the IBD, but now with these upgrades to the RoninDojo codebase, just like with backups: it also reuses the indexer data and the Dojo configuration from the old system.
To clarify: you can insert the newly flashed SD card, start the system, and simply walk away.
Depending on the wallet you use, you might need to perform a specific action on your wallet device (for example: if you're still running the SamouraiWallet software, you'd have to re-load the wallet from the backup file to trigger your xpubs to be tracked). But you don't need to locally connect to your system first to obtain the connection data.
Note: The same caveat applies to RoninUI here, as its onion URL will not be reused. For this one part of the setup, you'll still need to locally connect to the device to obtain the new onion URL.
Upgrading your storage device
Another main feature in this release is for those who want to upgrade their 1TB system so it has a bigger storage device. If you have a 2TB storage device that you can use both internally, as well as connect via a USB this scenario explanation will help you.
Because managing storage devices in Linux requires a lot of care, it's not as simple as copying all files from one drive to another, swap the drives, boot, and it all magically works. We'll spare you the technicalities of boot orders and drive UUID assignments, here in the article, but also more importantly: you don't need to get technical for the upgrade with this release.
So, to make it as simple as we can for the user, upgrading to a 2TB drive is as follows:
- Upgrade your RoninDojo to v2.2.0
- Attach the 2TB storage device with USB
- Run the Backup Send script
- Shut down your device
- Disconnect the 2TB storage device
- Swap the old storage device for the new 2TB storage device internally (SATA or NVME) and safely store away your old storage device as a backup.
- Flash an SD with RoninDojo v2.2.0
- Boot up the system with the newly flashed RoninDojo v2.2.0
And that should be it!
Additionally, with this procedure there's a strict guarantee of your old data being safe in the full set of steps listed above: the old device is not connected while the system is doing the first time boot procedure on the newly flashed system. This means it's impossible for your old drive's data to become corrupted during your upgrade, leaving you with a trusty backup for you to keep safe for as long as you like.
Completely new system
If you want to transfer using an entirely new system, there are two ways to pick from, to reuse the data from the old system:
- You attach the new system's storage device to the old system, run the backup send script, then place the storage device in the new system and start the system with a freshly flashed RoninOS.
- Or, if you have already backed up the data on a backup device, connect the backup-device to the new system's usb and start the system with a freshly flashed RoninOS. The first time boot's installation procedure will detect the backup device and use it as a source of data (similar to a salvage procedure).
There were some architectural decisions that prevented us from allowing the old system's storage device to be used as-is as a source of data for the latter of these two options.
So only backup drives filled with data using the "Backup Send" script will work when attaching a USB (SATA/NVME) storage device during the first time boot procedure. It will not work for a USB connected drive that contains an old installation itself.
Maximum uptime
Less time messing around
Features
We value uptime - ensuring your Bitcoin node is operational with minimal downtime is a priority for us. That's why we've reimplemented backup feature in such a way to not only make backups easier but also ensure that when you recover or upgrade, you're back online swiftly.
And just as important, we've taken time this release to make sure the code-level architecture was in order for not just this feature set, but that possible feature additions regarding this topic are far easier to add, as well as that the current feature set is maintainable.
Featureset
- Install with backup drive attached: Now, during installation, if a backup drive is detected, RoninDojo will automatically use it to restore your IBD, indexer data and configuration, selecting the appropriate indexer based on what was backed up. This reduces setup time significantly.
- Upgrade Kit Preparation: We've streamlined the process for those looking to upgrade their storage. The method we advocate is "send to 2TB," swap the drives, and then use the salvage procedure. This ensures that your data is intact without the risk of corruption or data loss.
- Cron Jobs for Backup: Backup operations can be automated via cron jobs. We're considering both UI and CLI methods to manage these, providing flexibility for different user preferences. More on this in the future.
- Security Considerations: Users don't have to worry about managing two devices with sensitive data. You can opt to back up only bitcoind and indexer data, keeping your setup secure.
- Salvage and Backup Procedures: We've addressed an issue where the old code used mounting for salvage prep, which was essentially copying rather than moving. This has been fixed to ensure data integrity during salvage.
- Full Receive Scenario in CLI: If you forgot to attach your backup drive during the initial flash, you can perform a "full receive" through the CLI to restore your setup without needing to reflash again, saving time and effort.
- Post-Recovery Actions: After salvaging or receiving a backup, the easiest way to reconnect a wallet designed to use Dojo, is by using the wallet's feature to "save to an encrypted backup" and then restoring it. This helps in rescanning your xpubs.
- Hardware Considerations: Some enclosures don't allow connection while the device is powered off. If you encounter this, when booting wait about 10 seconds before connecting your backup drive to avoid any USB detection issues.
There is some additional information that needs to be mentioned in regards to backups:
- Backups exclude the Dojo Tracker database to ensure your backup device doesn't hold transaction data or passwords that could give access to your transaction history.
- Things not included in backups are the passwords for UI or SSH, enhancing security by not duplicating sensitive access credentials.
- Note: Do not attempt to install from the same backup data on multiple devices. The Tor onion URL would conflict, potentially causing issues across the decentralized network and making your Dojo inaccessible. You can setup a second device as a fallback, that you turn on if your main device has a failure, but do not have these devices active at the same time.
This update also brings the latest version of Samourai Dojo - latest Tor, Fulcrum, Electrs, Addrindexrs and updated codebase to keep your Dojo running as seamless as possible.
Conclusion
We hope this update will make it easier and more convenient for our users to backup their data, especially in times when upgrading from 1TB drives is inevitable. We wish for your upgrade to a new drive to go as flawlessly as possible, and that you can transact with fewer worries weighing on your shoulders in regards to managing your system and its uptime.
Our Git repositories are available through Tor browser at: http://2l2o5umijiwxjioxwpsvwxe6pr75tj7r5rggnl5ze256guwvtee3kpqd.onion/Ronin/
Download RoninOS v2.2.0 image here: https://ronindojo.io/downloads/RockPro64/
Get our PGP public key here: https://ronindojo.io/canary/#ronindojo
Credits:
- 零火怖
- BTCxZelko
- DojoCoder
- Formerly: dammkewl