-
Notifications
You must be signed in to change notification settings - Fork 10
ElectrumX Setup on Ubuntu
Dan Janosik edited this page Sep 7, 2020
·
2 revisions
-
Install
apt install python3-pip pip3 install plyvel git clone https://github.com/spesmilo/electrumx.git cd electrumx pip3 install . cp contrib/systemd/electrumx.service /etc/systemd/system/ mkdir /path/for/electrumx-data-dir
-
Edit
electrumx.service
... ExecStart=/path/to/electrumx/git/electrumx_server User=yourusername ...
-
Generate self-signed certificate (so Electrum wallet can connect over TLS):
cd /path/for/electrumx-data-dir openssl genrsa -out server.key 2048 openssl req -new -key server.key -out server.csr # leave everything blank if desired openssl x509 -req -days 1825 -in server.csr -signkey server.key -out server.crt
-
Create config file
/etc/electrumx.conf
. Populate with environment variables:COIN=BitcoinSegwit DB_DIRECTORY=/path/to/data-dir/ DAEMON_URL=bitcoin-rpc-username:[email protected] TOR_PROXY_HOST=127.0.0.1 PEER_DISCOVERY=self PEER_ANNOUNCE= SERVICES=tcp://:50001,ssl://:50002 SSL_CERTFILE=/path/for/electrumx-data-dir/server.crt SSL_KEYFILE=/path/for/electrumx-data-dir/server.key
-
Start and monitor
systemctl daemon-reload systemctl enable electrumx.service # start at boot service electrumx start journalctl -u electrumx -f
-
Test via commandline
### Via 50001 echo '{ "id": "1", "method": "blockchain.headers.subscribe"}' | nc 127.0.0.1 50001 ### Or, for SSL connection on 50002 openssl s_client -connect 127.0.0.1:50002 ### Then {"id":"1", "method":"server.version"} {"id":"1", "method":"blockchain.scripthash.get_history", "params":["956f9b4a458184b75680fe5737a0854208ad960923d3cfe5a1c07769a26ce5dc"]}