Disclaimer: i didn't install electumx on a plain vanilla server (the server was installed several months before installing electrumx and already had a complete python3 environment on it at the time of electrumx installation), it was a while ago so i cannot remember all the steps, so in the end, steps might still be missing and i take no reponsability if something goes horribly wrong...
Good luck!I need someone to give me the commands and provide me help to setup my own ElectrumX server. I will offer 0.01BTC as a bounty.
I have electrumX running on ubuntu 16.04.1. It's already running for 1-2 weeks (don't remember exactly).
My installation was done on a server that was previously configured for python development, so i don't know if a plain vanilla installation will be sufficient (it's possible that i manually installed python3, the python development environment, even some dependancies a long time ago). I do remember it wasn't that easy to get everything running, and i cannot give you a full log of the installation... So i'm going to give you whatever i remember, hope that's enough.
BTW: i'm not doing this for the reward... I'm running electrumx for the community, and have over 200 connected concurrent sessions 24/7, so extra electrumx servers would be welcome to lower the load
BTW²=> don't expect much donations tough... I ran a regular electrum server for a while, and an electrumx server now, and the donations don't even cover 1% of the costs... Only run one to support the community
It was pretty much installing bitcoind.
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt update
sudo apt install bitcoind
you might even need something like apt-get install software-properties-common in order to install add-apt-repository
I have the following bitcoind.conf:
rpcuser=altcoinhosting
rpcpassword=[not going to tell you my password]
daemon=1
txindex=1
addressindex=1
spentindex=1
server=1
Afterwards, i installed the prereqs from
https://github.com/kyuupichan/electrumx/blob/master/docs/HOWTO.rst#prerequisitesI installed most of them using pip, altough some of them were rather tricky (you need a correct environment, sometimes even -dev packages to get all the dependancies running).
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip install [name of the prereq here]
in case of an error => google is your friend
I don't know if i installed all prereqs using pip, you can also do
apt-cache search prereqname
apt-get install nameofthepackagefrompreviouscommand
Then i created a user with sudo privileges, i cloned the electrumx repo (don't forget to apt-get install git) and did sudo python setup.py install
I also used the same user to start the bitcoind, i added a startup of the bitcoind to my crontab (@reboot bitcoind -daemon)
I then followed the instructions for using systemd (
https://github.com/kyuupichan/electrumx/blob/master/docs/HOWTO.rst#using-systemd)
you have to edit /etc/systemd/system/electrumx.service and setup the correct user
Here is mine:
[Unit]
Description=Electrumx
After=network.target
[Service]
EnvironmentFile=/etc/electrumx.conf
ExecStart=/usr/local/bin/electrumx_server.py
User=electrumx
LimitNOFILE=8192
TimeoutStopSec=30min
[Install]
WantedBy=multi-user.target
next, i made 2 files:
/etc/electrumx.conf
DB_DIRECTORY = /electrumx
DAEMON_URL = http://altcoinhosting:[not going to tell you my password]@localhost:8332/
ELECTRUMX = /usr/local/bin/electrumx_server.py
USERNAME = electrumx
COIN = Bitcoin
NET = mainnet
DB_ENGINE = leveldb
REORG_LIMIT = 200
DONATION_ADDRESS = 1d92FUSg7wUafUi77R6yjUpZVhTMKpzuQ
BANNER_FILE = /etc/electrumx.banner
HOST = [private info, but the ip of my server]
TCP_PORT = 50001
SSL_PORT = 50002
SSL_CERTFILE = /etc/server.crt
SSL_KEYFILE = /etc/server.key
IRC = 1
REPORT_HOST = [private info, but the fqdn of my server]
In order to generate the server.crt and server.key => Not completely secure, but otherwise you have to type in your password each time you start the service
openssl genrsa -des3 -out serversecure.key 2048
openssl rsa -in serversecure.key -out server.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
is a second file /etc/electrumx.banner
You can write whatever you want in there, it will be shown in the console window
You can read the BANNER_FILE section of
https://github.com/kyuupichan/electrumx/blob/master/docs/ENVIRONMENT.rst to look at the variables you're allowed to use inside this banner file...
Now, let bitcoind sync, you can monitor by using tail -f ~/.bitcoin/debug.log
I personally use leveldb, and my data directory is /electrumx (make sure it's owned by your normal user).
After bitcoind is sync'ed, you could fire up electrumx by "systemctl start electrumx", but it takes ages to sync... A trick is:
=> go
https://jdubya.info/electrum/ElectrumX/, copy the link for the latest leveldb database,
=> go to /electrumx (or whereever your datafolder is) => download the latest tar.gz, unpack in the root of the folder
If you're unsure where to unpack, let electrumx sync for 10-15 minutes, stop electrumx (systemctl stop electrumx), look at the directory structure and overwrite with the downloaded, unpacked files.
Last but not least, these commands will come in handy
systemctl start electrumx
systemctl stop electrumx
service electrumx status
journalctl -u electrumx -f
systemctl enable electrumx
tail -f /var/log/syslog | grep -i electrumx