-
Notifications
You must be signed in to change notification settings - Fork 0
/
Raspibolt Upgrade
241 lines (205 loc) · 7.92 KB
/
Raspibolt Upgrade
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
** BACKUP BEFORE UPGRADE
* Log in as user "admin".
* Backup essential files on external hard disk
```sh
$ sudo su - bitcoin
$ mkdir backup_hdd
$ tar cvf backup_hdd/bitcoin.tar .bitcoin/bitcoin.conf .bitcoin/wallet.dat .bitcoin/peers.dat .bitcoin/banlist.dat
$ tar cvf backup_hdd/lnd.tar .lnd/lnd.conf
$ exit
```
* Shutdown system
```sh
$ sudo shutdown now
```
* Remove the microSD card and connect it to your regular computer
* Follow [this guide to create a disk image:](https://lifehacker.com/how-to-clone-your-raspberry-pi-sd-card-for-super-easy-r-1261113524).
---
** LINUX UPGRADE
* Log in as user "admin".
* It is important to keep the system up-to-date with security patches and application updates. The “Advanced Packaging Tool” (apt) makes this easy. Do this regularly every few months to get security related updates.
* To reduce the potential for data corruption, we don’t want any of the services running while working through this upgrade.
* Stop and disable each service:
```sh
$ sudo systemctl stop btcrpcexplorer
$ sudo systemctl stop electrs
$ sudo systemctl stop lnd
$ sudo systemctl stop bitcoind
$ sudo systemctl stop tor
$ sudo systemctl disable btcrpcexplorer.service
$ sudo systemctl disable electrs.service
$ sudo systemctl disable lnd.service
$ sudo systemctl disable bitcoind.service
$ sudo systemctl disable tor.service
```
* Enter the folowing command ```sudo raspi-config```, then choose ```8 Update```.
* Check if there is any bootloader update:
```sh
$ sudo rpi-eeprom-update
```
* If there is any bootloader update, enter the folowing command ```sudo raspi-config```, then choose ```6 Advanced options```, then ```A7 Boot ROM Version``` and then ```E1 Latest```, to update the Bootloader of the Raspberry. It will t the system afterwards.
* Wait 5 minutes to give it enough time to install the new bootloader.
* Restart the Raspberry once again after installing the bootloader, just to be sure: ```sudo reboot```.
* Install system updates and reboot:
```sh
$ sudo apt update
$ sudo apt --fix-broken install
$ sudo apt full-upgrade
$ sudo apt install raspi-config rpi-eeprom avahi-daemon nyx iftop htop git curl bash-completion jq qrencode dphys-swapfile hdparm --install-recommends
$ sudo reboot
$ sudo apt --fix-broken install
$ sudo apt autoremove
```
* Start and enable each service:
```sh
$ sudo systemctl enable tor.service
$ sudo systemctl enable bitcoind.service
$ sudo systemctl enable lnd.service
$ sudo systemctl enable electrs.service
$ sudo systemctl enable btcrpcexplorer.service
$ sudo systemctl start tor
$ sudo systemctl start bitcoind
$ sudo systemctl start lnd
$ sudo systemctl start electrs
$ sudo systemctl start btcrpcexplorer
```
* Reboot the system, just to check everything starts up after a reboot: ```sudo reboot```.
* Wait for some minutes for the services to stabilize, check services are up and sync: ```raspibolt```.
---
** BITCOIN CORE UPGRADE
* [Updating to a new release](https://github.com/bitcoin/bitcoin/releases) should be straight-forward, but make sure to [check out the change log first](https://github.com/bitcoin/bitcoin/tree/master/doc/release-notes).
* Log in as user "admin".
* Stop and disable each service:
```sh
$ sudo systemctl stop btcrpcexplorer
$ sudo systemctl stop electrs
$ sudo systemctl stop lnd
$ sudo systemctl stop bitcoind
$ sudo systemctl stop tor
$ sudo systemctl disable btcrpcexplorer.service
$ sudo systemctl disable electrs.service
$ sudo systemctl disable lnd.service
$ sudo systemctl disable bitcoind.service
$ sudo systemctl disable tor.service
```
PENDIENTE DESGLOSAR
-Download, verify, extract and install the Bitcoin Core binaries as described in the Bitcoin section of this guide.
-Take care choosing ARM32 or ARM64 bits.
https://regiregi22.github.io/RaspiNail/raspibolt_30_bitcoin.html
* Reboot the system: ```sudo reboot```.
* Start and enable each service:
```sh
$ sudo systemctl enable tor.service
$ sudo systemctl enable bitcoind.service
$ sudo systemctl enable lnd.service
$ sudo systemctl enable electrs.service
$ sudo systemctl enable btcrpcexplorer.service
$ sudo systemctl start tor
$ sudo systemctl start bitcoind
$ sudo systemctl start lnd
$ sudo systemctl start electrs
$ sudo systemctl start btcrpcexplorer
```
---
** ELECTRS UPGRADE
* [Updating to a new release](https://github.com/romanz/electrs/releases) should be straight-forward, but make sure to [check out the change log first](https://github.com/romanz/electrs/blob/master/RELEASE-NOTES.md).
* Log in as user "admin".
* Check what version you have vs that available as lastest release:
```sh
$ cd /home/admin/rust
$ currentelectrs=$(head -n 1 electrs/RELEASE-NOTES.md | awk '{print "v"$2}')
$ echo "Current = ${currentelectrs}"
$ electrsgit=$(curl -s https://api.github.com/repos/romanz/electrs/tags | jq -r '.[0].name')
$ echo "Available = ${electrsgit}"
```
* If the available version is newer, then you can proceed with the following.
* Stop and disable each service:
```sh
$ sudo systemctl stop btcrpcexplorer
$ sudo systemctl stop electrs
$ sudo systemctl stop lnd
$ sudo systemctl stop bitcoind
$ sudo systemctl stop tor
$ sudo systemctl disable btcrpcexplorer.service
$ sudo systemctl disable electrs.service
$ sudo systemctl disable lnd.service
$ sudo systemctl disable bitcoind.service
$ sudo systemctl disable tor.service
```
```sh
$ # backup the current one
$ mv electrs electrs-v${currentelectrs};
$ # clone the most recent tagged version
$ git clone --branch ${electrsgit} https://github.com/romanz/electrs.git
$ # Build it
$ cd electrs
$ cargo build --locked --release
$ # Stop the service, copy the binary over, and start the service back up
$ sudo systemctl stop electrs
$ sudo cp ./target/release/electrs /usr/local/bin/
```
* Start and enable each service:
```sh
$ sudo systemctl enable tor.service
$ sudo systemctl enable bitcoind.service
$ sudo systemctl enable lnd.service
$ sudo systemctl enable electrs.service
$ sudo systemctl enable btcrpcexplorer.service
$ sudo systemctl start tor
$ sudo systemctl start bitcoind
$ sudo systemctl start lnd
$ sudo systemctl start electrs
$ sudo systemctl start btcrpcexplorer
```
---
** BTC RPC EXPLORER UPGRADE
* [Updating to a new release](https://github.com/janoside/btc-rpc-explorer/releases) should be straight-forward, but make sure to [check out the change log first](https://github.com/janoside/btc-rpc-explorer/blob/master/CHANGELOG.md).
* Log in as user "admin".
* Stop and disable each service:
```sh
$ sudo systemctl stop btcrpcexplorer
$ sudo systemctl stop electrs
$ sudo systemctl stop lnd
$ sudo systemctl stop bitcoind
$ sudo systemctl stop tor
$ sudo systemctl disable btcrpcexplorer.service
$ sudo systemctl disable electrs.service
$ sudo systemctl disable lnd.service
$ sudo systemctl disable bitcoind.service
$ sudo systemctl disable tor.service
```
* Open a “btcrpcexplorer” user session.
```sh
$ sudo su - btcrpcexplorer
```
* Fetch the latest GitHub repository information and check out [the newest release](https://github.com/janoside/btc-rpc-explorer/releases):
```sh
# Get the latest version:
$ cd ~/btc-rpc-explorer
$ git fetch
$ git checkout v3.2.0
```
```sh
# If the checkout gives an error, enter:
$ git stash
```
```sh
# Install the new version:
$ npm install
$ npm fund
$ npm audit fix
$ exit
```
* Start and enable each service:
```sh
$ sudo systemctl enable tor.service
$ sudo systemctl enable bitcoind.service
$ sudo systemctl enable lnd.service
$ sudo systemctl enable electrs.service
$ sudo systemctl enable btcrpcexplorer.service
$ sudo systemctl start tor
$ sudo systemctl start bitcoind
$ sudo systemctl start lnd
$ sudo systemctl start electrs
$ sudo systemctl start btcrpcexplorer
```