Skip to content

Commit 1f7725c

Browse files
committed
Update blockchain copy instructions
1 parent b59fcc7 commit 1f7725c

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

docs/bitcoin/using-existing-bitcoin-data.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
# Using Existing Bitcoin Data
22

3+
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.
4+
35
There are 2 methods, either reuse existing Bitcoin blockchain data from another MyNode instance or copy it from an external hard drive.
46

7+
<ul>
8+
<li><a href="#using-bitcoin-data-from-other-mynode">From Another Operational MyNode Device</a></li>
9+
<li><a href="#using-bitcoin-data-from-other-hard-drive">From a Saved Blockchain Copy on Another Drive</a></li>
10+
</ul>
11+
512
## Using Bitcoin Data from Other MyNode
6-
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.
713

8-
### Step 1 - Start MyNode
14+
This process assumes you have two nodes up and running. You will copy data from one node with the fully-synced blockchain to another.
915

10-
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.
16+
### Step 1 - Start MyNode
1117

12-
This will reboot your device and start syncing Bitcoin from scratch.
18+
Start both devices. We will refer to them as the source node and the destination node. The source node currently has a copy of the chain data and the destination node is the one receiving the chain data.
1319

14-
### Step 2 - Upload your own Data
20+
### Step 2 - Copy Data
1521

16-
Next, you need to log into your device via SSH and copy files from your existing node.
22+
Next, you need to log into both of your devices via SSH to copy data from the source node to the destination node.
1723

18-
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.
24+
On the node with the source data, ensure the bitcoin block data is readable by the "admin" user. Also, make sure that Bitcoin is not running. Run the following commands on each device.
1925

2026
**On source node:**
2127
<br/><sub><sup>Steps may differ if source is not MyNode device</sup></sub>
@@ -52,7 +58,8 @@ This will copy files from your remote node to your local node. After rebooting,
5258

5359

5460
## Using Bitcoin Data from Other Hard drive
55-
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.
61+
62+
This process assumes you have one node that is running and a copy of the chain data on an existing hard drive.
5663

5764

5865
### Step 1 - Install & Start MyNode
@@ -68,7 +75,7 @@ ssh [email protected]
6875
sudo /usr/bin/mynode_stop_critical_services.sh
6976
```
7077

71-
## Step 3 - Remove Old Data
78+
### Step 3 - Remove Old Data
7279
Remove any data that the syncing process has completed before you stopped the process.
7380

7481
```sh
@@ -79,7 +86,7 @@ sudo rm -rf /mnt/hdd/mynode/bitcoin/indexes
7986
```
8087

8188
### Step 4 - Copy Existing Blockchain
82-
1. Connect a second hard drive (which has a copy of the blockchain) to your Raspberry Pi
89+
1. Connect a second hard drive (which has a copy of the blockchain) to your node
8390
2. SSH into your node
8491

8592
```sh
@@ -89,23 +96,24 @@ ssh [email protected]
8996
3. Mount the second drive to some path
9097

9198
```sh
92-
sudo mount -t auto /dev/sda<X> /mnt/sda<X>
99+
sudo mkdir -p /mnt/blockchain_hdd
100+
sudo mount -t auto /dev/sda<X> /mnt/blockchain_hdd
93101
```
94102

95103
4. Set access-levels...
96104

97105
```sh
98-
sudo chmod -R 755 /mnt/sda<X>/<some-path...>/bitcoin/blocks
99-
sudo chmod -R 755 /mnt/sda<X>/<some-path...>/bitcoin/chainstate
100-
sudo chmod -R 755 /mnt/sda<X>/<some-path...>/bitcoin/indexes
106+
sudo chmod -R 755 /mnt/blockchain_hdd/<some-path...>/bitcoin/blocks
107+
sudo chmod -R 755 /mnt/blockchain_hdd/<some-path...>/bitcoin/chainstate
108+
sudo chmod -R 755 /mnt/blockchain_hdd/<some-path...>/bitcoin/indexes
101109
```
102110

103111
5. Copy the existing blockchain from the other drive to MyNode's drive
104112

105113
```sh
106-
sudo cp -r /mnt/sda<X>/<some-path...>/bitcoin/blocks /mnt/hdd/mynode/bitcoin/
107-
sudo cp -r /mnt/sda<X>/<some-path...>/bitcoin/chainstate /mnt/hdd/mynode/bitcoin/
108-
sudo cp -r /mnt/sda<X>/<some-path...>/bitcoin/indexes /mnt/hdd/mynode/bitcoin/
114+
sudo cp -r /mnt/blockchain_hdd/<some-path...>/bitcoin/blocks /mnt/hdd/mynode/bitcoin/
115+
sudo cp -r /mnt/blockchain_hdd/<some-path...>/bitcoin/chainstate /mnt/hdd/mynode/bitcoin/
116+
sudo cp -r /mnt/blockchain_hdd/<some-path...>/bitcoin/indexes /mnt/hdd/mynode/bitcoin/
109117
```
110118

111119
6. Change group access...

0 commit comments

Comments
 (0)