Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Setup Electrum Node

Markus Nebel edited this page May 27, 2019 · 1 revision

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.


General

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.

Building 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).

Prepare python

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

Setting up ElectrumX

Prepare environment

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

Prepare launcher

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

Starting ElectrumX Server

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

Advanced Setup

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