You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a new server, a snapshot of the blockchain needs to be downloaded for quick sync. The sections below describe the steps for setting up a new node. If running a replacement node, see section "For a replacement server".
48
+
To migrate the validator, the main consideration is whether the blockchain data is available or not. In other words, whether the blockchain data is available on an external storage volume or does it need to be rebuilt. The latter scenario typically happens when moving to a different provider.
47
49
48
-
## Download a snapshot
50
+
Regardless of the scenarios, the steps described in Phase 1 and Phase 3 should be followed. It is Phase 2 where the steps differ depending on the scenario.
49
51
50
-
Download the snapshot from https://terra.quicksync.io/
Regardless of whether the data is migrated or is generated from a snapshot, the replacement server (Server B) should be able to access the origin server (Server A) via SSH.
After downloading, verify the integrity of the file by using the checksum.sh file provided by the service.
68
+
OPTIONAL: Before running either of the options described next, it is prudent to keep the SSH key in memory because the commands need to be executed quickly.
60
69
70
+
```bash
71
+
eval`ssh-agent`
72
+
ssh-add ~/.ssh/id_ed25519.pub
61
73
```
62
-
wget {SNAPSHOT_FILE_URL}.checksum
63
-
# E.g. https://get.quicksync.io/columbus-4-pruned.20210630.0310.tar.lz4.checksum
If the checksum passes, it means the file was downloaded properly. The next step is to extract it.
90
+
(No need to move .terra/config/node_key.json - [https://discord.com/channels/566086600560214026/566126867686621185/842673595117207573])
74
91
75
-
lz4 -d {SNAPSHOT_FILE} | tar xf - -C /mnt/columbus5a
92
+
The following commands can be run prior to the stopping of the old server.
76
93
77
-
This command extracts the files into /mnt/columbus5a/data (assuming /mnt/columbus5a is a separate storage disk). This can also take a long while (hours) to complete depending on the size and the speed of the disk.
Running the sync script will create three systemd service files in the home directory. They are to be moved to _/etc/systemd/system_ after checking for correctness (i.e. ensure that path and user account are correct).
80
102
81
-
A new node needs to be initialized with a moniker. E.g.
103
+
The ownership of these files also need to be set to `root:root`
82
104
83
-
terrad init "Validator A"
105
+
```bash
106
+
sudo chown root:root price-server.service
107
+
sudo chown root:root feeder.service
108
+
sudo chown root:root terrad.service
109
+
sudo mv -i *service /etc/systemd/system/
110
+
```
84
111
85
-
This will create a ".terrad" directory in the home folder. It comes with a file that needs to be replaced by one from Mainnet.
112
+
After doing so, the first service that can be started on server-b with no dependencies is the price server.
For the Mainnet (columbus-4), the genesis file can be downloaded from https://columbus-genesis.s3-ap-northeast-1.amazonaws.com/columbus-4-genesis.json (reference [docs.terra.money](https://docs.terra.money/node/join-network.html#download-the-genesis-file)).
119
+
The service can be confirmed to be running by executing
92
120
93
-
~~The address book can be found at https://network.terra.dev/addrbook.json (reference [docs.terra.money](https://docs.terra.money/node/join-network.html#picking-a-network)).~~ The address book is not actually required.
121
+
```bash
122
+
journalctl -u price-server.service -f
123
+
```
94
124
95
-
For the Testnet (tequila-0004), the genesis file can be downloaded from https://raw.githubusercontent.com/terra-project/testnet/master/tequila-0004/genesis.json (reference [github.com](https://github.com/terra-project/testnet)).
125
+
## Phase 2A: Migration with no pre-existing blockchain data
96
126
97
-
The address book can be found at https://network.terra.dev/testnet/addrbook.json
127
+
For a new server, a snapshot of the blockchain needs to be downloaded for quick sync.
98
128
99
-
For Bombay testnet, the genesis file is at https://raw.githubusercontent.com/terra-project/testnet/master/bombay-0007/genesis.json
129
+
### Download a snapshot
100
130
101
-
Update the seeds (~/.terrad/config/config.toml) to begin running the blockchain. The seeds for Mainnet are (reference: [docs.terra.money](https://docs.terra.money/node/join-network.html#define-seed-nodes)):
Regardless of whether the data is migrated or is generated from a snapshot, the replacement server (Server B) should be able to access the origin server (Server A) via SSH.
Before running either of the options described next, it is prudent to keep the SSH key in memory because the commands need to be executed quickly.
159
+
If the checksum passes, it means the file was downloaded properly. The next step is to extract it.
139
160
140
161
```bash
141
-
eval`ssh-agent`
142
-
ssh-add ~/.ssh/id_ed25519.pub
162
+
lz4 -d {SNAPSHOT_FILE} | tar xf - -C /mnt/columbus-a
143
163
```
144
164
145
-
## Replacement server with new data
146
-
147
-
Do the same steps for initializing the server. This includes downloading the snapshot file and extracting it.
148
-
149
-
To do the migration:
165
+
This command extracts the files into /mnt/columbus-a/data (assuming /mnt/columbus-a is a separate storage disk). This can also take a long while (hours) to complete depending on the size and the speed of the disk.
150
166
151
-
1. Stop the old terrad server.
152
-
2. Copy `.terrad/config/priv_validator_key.json` to the new node.
153
-
3. Copy `.terrad/data/priv_validator_state.json` to the new node.
154
-
4. Start the new terrad server.
167
+
Once the extraction is complete, run `sudo systemctl start terrad` and wait for it to catch up.
## Phase 2B: Migration with blockchain data available
181
197
182
198
Prepare the server by making sure that the software components are in place. There is no need to download the blockchain snapshot since the data is already available for migration.
183
199
184
200
What _needs_ to be done is to re-attach the block storage when doing the migration.
185
201
186
-
The steps for the migration:
202
+
At a high-level, the steps for the migration are:
187
203
188
-
1. Stop the old terrad server.
204
+
1. Stop the old server.
189
205
2. Unmount the storage volume.
190
206
3. Sync the terrad folders over.
191
207
4. Mount the storage volume to the new server.
192
-
5. Start the new terrad server.
193
-
194
-
### Commands
208
+
5. Start the new server.
195
209
196
210
Before following the next steps, it is prudent to reboot the machine and re-run the SSH agent.
Running the sync script will create three systemd service files in the home directory. They are to be moved to _/etc/systemd/system_ after checking for correctness.
228
-
229
-
The ownership of the files also need to be set to `root:root`
220
+
### Preparation at the old server
230
221
231
-
After doing so, the first service that can be executed with no problems is the price server.
222
+
Check that only `terrad` is accessing the mounted folder so that there is no delay in unmounting the drive later.
232
223
233
224
```bash
234
-
sudo systemctl daemon-reload
235
-
sudo systemctl start price-server.service
225
+
lsof +f -- /mnt/columbus-a
236
226
```
237
227
238
-
The service can be confirmed to be running by executing `journalctl -u price-server.service -f`
239
-
240
228
### Actual migration
241
229
242
230
The sequence of commands below needs to be **executed in quick succession**.
@@ -245,23 +233,26 @@ The sequence of commands below needs to be **executed in quick succession**.
245
233
# server-a
246
234
sudo systemctl stop terrad
247
235
umount /dev/sda
248
-
# Detach volume from Server A and attach to Server B.
236
+
237
+
# Dashboard: Detach volume from Server A and attach to Server B.
249
238
250
239
# server-b
251
240
bash sync.sh
252
241
# Check that the symbolic link works.
253
-
sudo mount -o nodiscard,defaults,noatime /dev/disk/by-id/scsi-0DO_Volume_columbus5a /mnt/columbus5a&& ls -l ~/.terra/
242
+
sudo mount -o nodiscard,defaults,noatime /dev/disk/by-id/scsi-0DO_Volume_columbus5a /mnt/columbus-a&& ls -l ~/.terra/
For the Mainnet (columbus-4), the genesis file can be downloaded from https://columbus-genesis.s3-ap-northeast-1.amazonaws.com/columbus-4-genesis.json (reference [docs.terra.money](https://docs.terra.money/node/join-network.html#download-the-genesis-file)).
284
+
285
+
~~The address book can be found at https://network.terra.dev/addrbook.json (reference [docs.terra.money](https://docs.terra.money/node/join-network.html#picking-a-network)).~~ The address book is not actually required.
286
+
287
+
For the Testnet (tequila-0004), the genesis file can be downloaded from https://raw.githubusercontent.com/terra-project/testnet/master/tequila-0004/genesis.json (reference [github.com](https://github.com/terra-project/testnet)).
288
+
289
+
For Bombay testnet, the genesis file is at https://raw.githubusercontent.com/terra-project/testnet/master/bombay-0007/genesis.json
290
+
291
+
Update the seeds (~/.terrad/config/config.toml) to begin running the blockchain. The seeds for Mainnet are (reference: [docs.terra.money](https://docs.terra.money/node/join-network.html#define-seed-nodes)):
0 commit comments