-
Notifications
You must be signed in to change notification settings - Fork 34
Setup Electrum Node
This article describes the necessary steps set up an ECCoin electrumX server node.
If you want to host an electrumX server, please ensure that your machine has a static IPv4/IPv6 and has a 24/7 uptime.
An electrum node is simply a gateway to a bitcoin core based full node (like ECCoin). Thus you have to run a fully synced ECCoin daemon.
git clone https://github.com/project-ecc/eccoin
cd eccoin
./autogen.sh
./configure
make
If all these steps are executed successfully the eccoind
binary is located in src
.
Before you start the ECCoin daemon, be sure to add
txindex=1
rpcconnect=127.0.0.1
rpcallowip=127.0.0.1
to the ~/.eccoin/eccoin.conf
file!
Start the eccoind
and wait until the blockchain is synced (can take hours to days).
Install python3.6 (or higher) and virtualenv. For debian based distros run as root
apt install python3.7 virtualenv
Then run as normal user
virtualenv -p python3.7 ~/pyvirtualenv
source ~/pyvirtualenv/bin/activate # activates python virtual environment
pip install pylru plyvel aiorpcx aiohttp
git clone https://github.com/kyuupichan/electrumx.git
cd electrumx
mkdir dbdir
openssl genrsa -out server.key 2048
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 1825 -in server.csr -signkey server.key -out server.crt
source ~/pyvirtualenv/bin/activate # activates python virtual environment
python setup.py install
Create a script file called run_electrum.sh
and copy
#!/bin/bash
export DB_DIRECTORY=dbdir
export DAEMON_URL=http://<ECC_RPC_USER>:<ECC_RPC_PASSWORD>:<ECC_RPC_PORT>/
export COIN=ECCoin
export SERVICES=ssl://:50002
export REPORT_SERVICES=ssl://<YOUR_SERVERS_DOMAIN_NAME_OR_IP>:50002
export SSL_CERTFILE=$(pwd)/server.crt
export SSL_KEYFILE=$(pwd)/server.key
export DONATION_ADDRESS="<YOUR_ECC_DONATION_ADDRESS>"
./electrumx_server
The data for ECC_RPC_USER, ECC_RPC_PASSWORD and ECC_RPC_PORT can be found in your ~/.eccoin/eccoin.conf
file of the ECCoin daemon.
After that make the script executable by running
chmod +x run_electrum.sh
Now every time you want to start your electrumX instance, you have to enable the python virtual environment and then run the run_electrum.sh
script:
source ~/pyvirtualenv/bin/activate # activates python virtual environment
cd electrumx
run_electrum.sh
The above description is a general quick and dirty setup method. If you want a proper setup with automatic startup on server bootup, you should read the official systemd howto on the electrumX website: https://electrumx.readthedocs.io/en/latest/HOWTO.html#using-systemd