From 6a2bc42fc00909320461be98f71933255e93b935 Mon Sep 17 00:00:00 2001 From: Dennis Charmington Date: Fri, 16 May 2025 11:15:52 +0200 Subject: [PATCH 1/2] Add Bitcoin doc - how to copy existing blockchain from other drive Signed-off-by: Dennis Charmington --- docs/.vuepress/config.js | 1 + docs/bitcoin/data-from-other-disk.md | 71 ++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 docs/bitcoin/data-from-other-disk.md diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 01d908b..f3f180e 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -56,6 +56,7 @@ module.exports = { "/bitcoin/bitcoin-status", "/bitcoin/manage", "/bitcoin/quicksync", + "/bitcoin/data-from-other-disk", "/bitcoin/data-from-other-node", "/bitcoin/troubleshoot" ] diff --git a/docs/bitcoin/data-from-other-disk.md b/docs/bitcoin/data-from-other-disk.md new file mode 100644 index 0000000..0fe21b5 --- /dev/null +++ b/docs/bitcoin/data-from-other-disk.md @@ -0,0 +1,71 @@ +# Using Bitcoin Data from Other Hard drive +In some cases, you may want to use Bitcoin data from a different hard drive to get MyNode up and running faster or to save bandwidth. If you have another hard drive that is already synced, you can copy that data to your MyNode. + + +## Step 1 - Install & Start MyNode +Start with [MyNode standard installation](https://mynodebtc.com/download) and then [Getting started guide](https://mynodebtc.github.io/intro/getting-started.html) + +## Step 2 - Stop The Bitcoin Syncing +As soon as the Bitcoin Blockchain syncing process has started, the web interface will displays `"Bitcoin Blockchain Syncing..."`. + +At this point, "stop" the syncing: + +```sh +ssh admin@mynode.local +sudo /usr/bin/mynode_stop_critical_services.sh +``` + +## Step 3 - Remove Old Data +Remove any data that the syncing process has completed before you stopped the process. + +```sh +ssh admin@mynode.local +sudo rm -rf /mnt/hdd/mynode/bitcoin/blocks +sudo rm -rf /mnt/hdd/mynode/bitcoin/chainstate +sudo rm -rf /mnt/hdd/mynode/bitcoin/indexes +``` + +### Step 4 - Copy Existing Blockchain +1. Connect a second hard drive (which has a copy of the blockchain) to your Raspberry Pi +2. SSH into your node + +```sh +ssh admin@mynode.local +``` + +3. Mount the second drive to some path + +```sh +sudo mount -t auto /dev/sda /mnt/sda +``` + +4. Set access-levels... + +```sh +sudo chmod -R 755 /mnt/sda//bitcoin/blocks +sudo chmod -R 755 /mnt/sda//bitcoin/chainstate +sudo chmod -R 755 /mnt/sda//bitcoin/indexes +``` + +5. Copy the existing blockchain from the other drive to MyNode's drive + +```sh +sudo cp -r /mnt/sda//bitcoin/blocks /mnt/hdd/mynode/bitcoin/ +sudo cp -r /mnt/sda//bitcoin/chainstate /mnt/hdd/mynode/bitcoin/ +sudo cp -r /mnt/sda//bitcoin/indexes /mnt/hdd/mynode/bitcoin/ +``` + +6. Change group access... + +```sh +sudo chown -R bitcoin:bitcoin /mnt/hdd/mynode/bitcoin/ +``` + +7. Reboot the node + +```sh +sudo reboot +``` + + +🥳 From 77e3cba0b2962cf75ed67d40a4ff5c81cca8db7d Mon Sep 17 00:00:00 2001 From: Dennis Charmington Date: Thu, 5 Jun 2025 09:22:50 +0200 Subject: [PATCH 2/2] Merge both Bitcoin docs related to syncing Bitcoin data into 1 doc Signed-off-by: Dennis Charmington --- docs/.vuepress/config.js | 3 +- docs/bitcoin/data-from-other-disk.md | 71 ------------ docs/bitcoin/data-from-other-node.md | 47 -------- docs/bitcoin/using-existing-bitcoin-data.md | 122 ++++++++++++++++++++ 4 files changed, 123 insertions(+), 120 deletions(-) delete mode 100644 docs/bitcoin/data-from-other-disk.md delete mode 100644 docs/bitcoin/data-from-other-node.md create mode 100644 docs/bitcoin/using-existing-bitcoin-data.md diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index f3f180e..9329479 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -56,8 +56,7 @@ module.exports = { "/bitcoin/bitcoin-status", "/bitcoin/manage", "/bitcoin/quicksync", - "/bitcoin/data-from-other-disk", - "/bitcoin/data-from-other-node", + "/bitcoin/using-existing-bitcoin-data", "/bitcoin/troubleshoot" ] }, diff --git a/docs/bitcoin/data-from-other-disk.md b/docs/bitcoin/data-from-other-disk.md deleted file mode 100644 index 0fe21b5..0000000 --- a/docs/bitcoin/data-from-other-disk.md +++ /dev/null @@ -1,71 +0,0 @@ -# Using Bitcoin Data from Other Hard drive -In some cases, you may want to use Bitcoin data from a different hard drive to get MyNode up and running faster or to save bandwidth. If you have another hard drive that is already synced, you can copy that data to your MyNode. - - -## Step 1 - Install & Start MyNode -Start with [MyNode standard installation](https://mynodebtc.com/download) and then [Getting started guide](https://mynodebtc.github.io/intro/getting-started.html) - -## Step 2 - Stop The Bitcoin Syncing -As soon as the Bitcoin Blockchain syncing process has started, the web interface will displays `"Bitcoin Blockchain Syncing..."`. - -At this point, "stop" the syncing: - -```sh -ssh admin@mynode.local -sudo /usr/bin/mynode_stop_critical_services.sh -``` - -## Step 3 - Remove Old Data -Remove any data that the syncing process has completed before you stopped the process. - -```sh -ssh admin@mynode.local -sudo rm -rf /mnt/hdd/mynode/bitcoin/blocks -sudo rm -rf /mnt/hdd/mynode/bitcoin/chainstate -sudo rm -rf /mnt/hdd/mynode/bitcoin/indexes -``` - -### Step 4 - Copy Existing Blockchain -1. Connect a second hard drive (which has a copy of the blockchain) to your Raspberry Pi -2. SSH into your node - -```sh -ssh admin@mynode.local -``` - -3. Mount the second drive to some path - -```sh -sudo mount -t auto /dev/sda /mnt/sda -``` - -4. Set access-levels... - -```sh -sudo chmod -R 755 /mnt/sda//bitcoin/blocks -sudo chmod -R 755 /mnt/sda//bitcoin/chainstate -sudo chmod -R 755 /mnt/sda//bitcoin/indexes -``` - -5. Copy the existing blockchain from the other drive to MyNode's drive - -```sh -sudo cp -r /mnt/sda//bitcoin/blocks /mnt/hdd/mynode/bitcoin/ -sudo cp -r /mnt/sda//bitcoin/chainstate /mnt/hdd/mynode/bitcoin/ -sudo cp -r /mnt/sda//bitcoin/indexes /mnt/hdd/mynode/bitcoin/ -``` - -6. Change group access... - -```sh -sudo chown -R bitcoin:bitcoin /mnt/hdd/mynode/bitcoin/ -``` - -7. Reboot the node - -```sh -sudo reboot -``` - - -🥳 diff --git a/docs/bitcoin/data-from-other-node.md b/docs/bitcoin/data-from-other-node.md deleted file mode 100644 index 0c09e6a..0000000 --- a/docs/bitcoin/data-from-other-node.md +++ /dev/null @@ -1,47 +0,0 @@ -# Using Bitcoin Data from Other Node -In some cases, you may want to use Bitcoin data from a different node to get MyNode up and running faster or to save bandwidth. If you have another node that is already synced, you can copy that data to your MyNode. - -## Step 1 - Start MyNode - -The first thing you need to do is start your MyNode and disable QuickSync. To disable QuickSync, go to the settings page and click the "Disable QuickSync" button. - -This will reboot your device and start syncing Bitcoin from scratch. - -## Step 2 - Upload your own Data - -Next, you need to log into your device via SSH and copy files from your existing node. - -On the node with the source data, ensure the bitcoin block data is readable by the "admin" user or the user you are logging in with. Also, make sure that Bitcoin is not running. Run the following commands on each device. - -**On source node:** -
Steps may differ if source is not MyNode device -```sh -# Stop Bitcoin and other services -sudo /usr/bin/mynode_stop_critical_services.sh - -# Make sure block data is readable by the admin user -sudo chmod -R 755 /mnt/hdd/mynode/bitcoin/blocks -sudo chmod -R 755 /mnt/hdd/mynode/bitcoin/chainstate -sudo chmod -R 755 /mnt/hdd/mynode/bitcoin/indexes -``` - -**On destination node:** -```sh -# Stop Bitcoin and other services -sudo /usr/bin/mynode_stop_critical_services.sh - -# Make sure old data is removed -sudo rm -rf /mnt/hdd/mynode/bitcoin/blocks -sudo rm -rf /mnt/hdd/mynode/bitcoin/chainstate -sudo rm -rf /mnt/hdd/mynode/bitcoin/indexes - -# Copy the blocks and chainstate folders from your existing node to /mnt/hdd/mynode/bitcoin/ -# For example (fill in with your own IP and path): -sudo rsync -aP admin@othernode.local:/mnt/hdd/mynode/bitcoin/blocks /mnt/hdd/mynode/bitcoin/ -sudo rsync -aP admin@othernode.local:/mnt/hdd/mynode/bitcoin/chainstate /mnt/hdd/mynode/bitcoin/ -sudo rsync -aP admin@othernode.local:/mnt/hdd/mynode/bitcoin/indexes /mnt/hdd/mynode/bitcoin/ -sudo chown -R bitcoin:bitcoin /mnt/hdd/mynode/bitcoin/ -sudo reboot -``` - -This will copy files from your remote node to your local node. After rebooting, your device will sync from the same state as your other node. diff --git a/docs/bitcoin/using-existing-bitcoin-data.md b/docs/bitcoin/using-existing-bitcoin-data.md new file mode 100644 index 0000000..e3b5b74 --- /dev/null +++ b/docs/bitcoin/using-existing-bitcoin-data.md @@ -0,0 +1,122 @@ +# Using Existing Bitcoin Data + +There are 2 methods, either reuse existing Bitcoin blockchain data from another MyNode instance or copy it from an external hard drive. + +## Using Bitcoin Data from Other MyNode +In some cases, you may want to use Bitcoin data from a different node to get MyNode up and running faster or to save bandwidth. If you have another node that is already synced, you can copy that data to your MyNode. + +### Step 1 - Start MyNode + +The first thing you need to do is start your MyNode and disable QuickSync. To disable QuickSync, go to the settings page and click the "Disable QuickSync" button. + +This will reboot your device and start syncing Bitcoin from scratch. + +### Step 2 - Upload your own Data + +Next, you need to log into your device via SSH and copy files from your existing node. + +On the node with the source data, ensure the bitcoin block data is readable by the "admin" user or the user you are logging in with. Also, make sure that Bitcoin is not running. Run the following commands on each device. + +**On source node:** +
Steps may differ if source is not MyNode device +```sh +# Stop Bitcoin and other services +sudo /usr/bin/mynode_stop_critical_services.sh + +# Make sure block data is readable by the admin user +sudo chmod -R 755 /mnt/hdd/mynode/bitcoin/blocks +sudo chmod -R 755 /mnt/hdd/mynode/bitcoin/chainstate +sudo chmod -R 755 /mnt/hdd/mynode/bitcoin/indexes +``` + +**On destination node:** +```sh +# Stop Bitcoin and other services +sudo /usr/bin/mynode_stop_critical_services.sh + +# Make sure old data is removed +sudo rm -rf /mnt/hdd/mynode/bitcoin/blocks +sudo rm -rf /mnt/hdd/mynode/bitcoin/chainstate +sudo rm -rf /mnt/hdd/mynode/bitcoin/indexes + +# Copy the blocks and chainstate folders from your existing node to /mnt/hdd/mynode/bitcoin/ +# For example (fill in with your own IP and path): +sudo rsync -aP admin@othernode.local:/mnt/hdd/mynode/bitcoin/blocks /mnt/hdd/mynode/bitcoin/ +sudo rsync -aP admin@othernode.local:/mnt/hdd/mynode/bitcoin/chainstate /mnt/hdd/mynode/bitcoin/ +sudo rsync -aP admin@othernode.local:/mnt/hdd/mynode/bitcoin/indexes /mnt/hdd/mynode/bitcoin/ +sudo chown -R bitcoin:bitcoin /mnt/hdd/mynode/bitcoin/ +sudo reboot +``` + +This will copy files from your remote node to your local node. After rebooting, your device will sync from the same state as your other node. + + +## Using Bitcoin Data from Other Hard drive +In some cases, you may want to use Bitcoin data from a different hard drive to get MyNode up and running faster or to save bandwidth. If you have another hard drive that is already synced, you can copy that data to your MyNode. + + +### Step 1 - Install & Start MyNode +Start with [MyNode standard installation](https://mynodebtc.com/download) and then [Getting started guide](https://mynodebtc.github.io/intro/getting-started.html) + +### Step 2 - Stop The Bitcoin Syncing +As soon as the Bitcoin Blockchain syncing process has started, the web interface will displays `"Bitcoin Blockchain Syncing..."`. + +At this point, "stop" the syncing: + +```sh +ssh admin@mynode.local +sudo /usr/bin/mynode_stop_critical_services.sh +``` + +## Step 3 - Remove Old Data +Remove any data that the syncing process has completed before you stopped the process. + +```sh +ssh admin@mynode.local +sudo rm -rf /mnt/hdd/mynode/bitcoin/blocks +sudo rm -rf /mnt/hdd/mynode/bitcoin/chainstate +sudo rm -rf /mnt/hdd/mynode/bitcoin/indexes +``` + +### Step 4 - Copy Existing Blockchain +1. Connect a second hard drive (which has a copy of the blockchain) to your Raspberry Pi +2. SSH into your node + +```sh +ssh admin@mynode.local +``` + +3. Mount the second drive to some path + +```sh +sudo mount -t auto /dev/sda /mnt/sda +``` + +4. Set access-levels... + +```sh +sudo chmod -R 755 /mnt/sda//bitcoin/blocks +sudo chmod -R 755 /mnt/sda//bitcoin/chainstate +sudo chmod -R 755 /mnt/sda//bitcoin/indexes +``` + +5. Copy the existing blockchain from the other drive to MyNode's drive + +```sh +sudo cp -r /mnt/sda//bitcoin/blocks /mnt/hdd/mynode/bitcoin/ +sudo cp -r /mnt/sda//bitcoin/chainstate /mnt/hdd/mynode/bitcoin/ +sudo cp -r /mnt/sda//bitcoin/indexes /mnt/hdd/mynode/bitcoin/ +``` + +6. Change group access... + +```sh +sudo chown -R bitcoin:bitcoin /mnt/hdd/mynode/bitcoin/ +``` + +7. Reboot the node + +```sh +sudo reboot +``` +