This commit is contained in:
openoms
2019-09-04 17:16:09 +01:00
parent f65285073e
commit a7c8570bab

View File

@@ -1,9 +1,13 @@
## RaspiBlitz: install the Electrum Server in Rust (electrs)
# Electrum Server in Rust (electrs) setup on the RaspiBlitz
\`The server indexes the entire Bitcoin blockchain, and the resulting index enables fast queries for any given user wallet, allowing the user to keep real-time track of his balances and his transaction history using the Electrum wallet. Since it runs on the user's own machine, there is no need for the wallet to communicate with external Electrum servers, thus preserving the privacy of the user's addresses and balances.\` - [https:/github.com/romanz/electrs](https:/github.com/romanz/electrs)
## Install Electrs
Based on https://github.com/romanz/electrs/blob/master/doc/usage.md
Shared experiences here: https://github.com/rootzoll/raspiblitz/issues/123 and https://github.com/openoms/bitcoin-tutorials/issues/2
\`The server indexes the entire Bitcoin blockchain, and the resulting index enables fast queries for any given user wallet, allowing the user to keep real-time track of his balances and his transaction history using the Electrum wallet. Since it runs on the user's own machine, there is no need for the wallet to communicate with external Electrum servers, thus preserving the privacy of the user's addresses and balances.\` - [https:/github.com/romanz/electrs](https:/github.com/romanz/electrs)
Tested on the
* Odroid HC1 and XU4 (~18 hours)
@@ -13,8 +17,6 @@ Requires 47 Gb diskpace (March 2019).
The install instructions are adapted to the RaspiBlitz are in this script, take a look: [1_electrs_on_RaspiBlitz.sh](1_electrs_on_RaspiBlitz.sh)
The script is a collection of commands. The whole setup has multiple components and dependencies which can change when updated or modified by the maintainers. If you run into problems try to run the commands manually one-by-one, spot which is causing the problem and copy the output. Open an issue here with the details and I will be happy to help to solve it. Bear in mind that this guide and the parts used are free-opensource projects, you use them at your own responsibility and there are no guarantees of any kind.
To download and run on the RaspiBlitz::
`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/electrs/1_electrs_on_RaspiBlitz.sh && bash 1_electrs_on_RaspiBlitz.sh`
@@ -22,16 +24,9 @@ This will only run the server until the terminal window is open.
To restart electrs manually run (with your PASSWORD_B filled in) or install the Electrs systemd service (next step):
`$ /home/admin/electrs/target/release/electrs --index-batch-size=10 --jsonrpc-import --db-dir /mnt/hdd/electrs/db --electrum-rpc-addr="0.0.0.0:50001" --cookie="raspibolt:PASSWORD_B" -vvvv`
### To connect the Electrum wallet use these commands and ports:
For an unencrypted TCP connection (suitable inside a secure LAN):
`electrum --oneserver --server RASPIBLITZ_IP:50001:t`
To connect through SSL (requires setting up the Nginx server):
`electrum --oneserver --server YOUR_DOMAIN:50002:s`
---
## RaspiBlitz: Set up the Electrs systemd service
Set up the systemd service to run electrs continuously in the background.
@@ -41,15 +36,53 @@ Take a look: [2_electrs_systemd_service.sh](2_electrs_systemd_service.sh)
To download and run:
`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/electrs/2_electrs_systemd_service.sh && bash 2_electrs_systemd_service.sh`
If running the always-on electrs service is taking up too much RAM of your RPi stop it with:
If running the always-on electrs service is taking up too much RAM of your RPi3 stop it with:
`$ sudo systemctl stop electrs`
To stop running on boot:
`$ sudo systemctl disable electrs`
(To re-enable and start use the `enable` and `start`commands)
To check if the indexing is running use:
---
## Install Electrum wallet on your desktop
**Warning: Electrum versions older than 3.3.4 are susceptible to phishing. Do not download Electrum from another source than electrum.org, and learn to verify GPG signatures.**
Follow the instructions on https://electrum.org/#download
### Linux desktop: install, configure and run the Electrum wallet
The instruction are in the script: [4_electrum_install.sh](4_electrum_install.sh)
Tested on Ubuntu 18.04.
To download and run on the Linux desktop:
`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/electrs/4_electrum_install.sh && bash 4_electrum_install.sh`
### Connect the Electrum wallet to Electrs:
For an unencrypted TCP connection (suitable inside a secure LAN):
`electrum --oneserver --server RASPIBLITZ_IP:50001:t`
To connect through SSL (requires setting up the Nginx server):
`electrum --oneserver --server YOUR_DOMAIN:50002:s`
### Check if Electrs is working:
Electrs will only start serving on the port 50001 when it has finished indexing.
To check if the indexing is running run in the RaspiBlitz terminal:
`$ sudo systemctl status electrs` or `htop`
To chack if it is serving on the port 50001:
`$ lsof -i`
Look for the output:
```
electrs 2532 admin 17u IPv4 32885 0t0 TCP *:50001 (LISTEN)
```
---
## Remote connection options to Electrs
@@ -87,11 +120,13 @@ To download and run on the RaspiBlitz:
---
## Linux desktop: install, configure and run the Electrum wallet
The instruction are in the script: [4_electrum_install.sh](4_electrum_install.sh)
## Further help:
Tested on Ubuntu 18.04.
The script is a collection of commands. The whole setup has multiple components and dependencies which can change when updated or modified by the maintainers.
To download and run on the Linux desktop:
`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/electrs/4_electrum_install.sh && bash 4_electrum_install.sh`
If you run into problems:
* try to run the commands manually one-by-one, spot which is causing the problem and copy the output
* open an issue here with the details and I will be happy to help to solve it
* join the Community Raspiblitz Telegram group on https://t.me/raspiblitz
Bear in mind that this guide and the parts used are free-opensource projects, you use them at your own responsibility and there are no guarantees of any kind.