[Guide] Setup Feathercoin Electrum-X Server Centos 7
-
Hey Guys,
This guide has been adapted from guide @lclc_ wrote for Ubuntu here:
https://forum.feathercoin.com/topic/9626/guide-setup-an-electrumx-feathercoin-serverThis guide assumes you are running a full node already, if you need to get a full node setup on Centos 7 Please follow the guide I wrote here:
https://forum.feathercoin.com/topic/8392/guide-create-a-full-node-and-build-feathercoin-v0-16-on-centos-7/7I also assume you have another user besides root, for this guide I use the user “electrumx”
Install Firewalld + Fail2Ban
yum -y install epel-release yum -y install firewalld fail2ban-firewalld
Configure fail2ban
The configuration files for fail2ban are stored in /etc/fail2ban/. In order to avoid problems when updating fail2ban, lets add our local changes to a jail_ssh.local file located in that directory. Open a new text file /etc/fail2ban/jail_ssh.local using an editor you are comfortable with.
sudo vi /etc/fail2ban/jail_ssh.local
Paste the following two lines into the file and save it.
[sshd] enabled = true
Start up the fail2ban.service using systemctl.
sudo systemctl start fail2ban.service
sudo systemctl enable fail2ban.service
ElectrumX-Server
Start by grabbing the source files from git
cd /usr/src git clone https://github.com/kyuupichan/electrumx.git cd electrumx
Dependencies
sudo yum -y update sudo yum -y install yum-utils sudo yum -y groupinstall development sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm
sudo yum -y install python36u python36u-devel leveldb-devel python36u-pip python36u-setuptools sudo pip3.6 install --upgrade pip sudo pip3.6 install plyvel
Install electrum-x server
sudo python3.6 setup.py install
Make a db folder for your electrum-x server
mkdir -p /home/electrumx/.electrumx/db
Create an SSL certificate for Electrum-X to use
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 openssl rsa -passin pass:x -in server.pass.key -out /home/electrumx/.electrumx/server.key
rm server.pass.key
Don’t set a password in the next step !
openssl req -new -key /home/electrumx/.electrumx/server.key -out /home/electrumx/.electrumx/server.csr
openssl x509 -req -days 1825 -in /home/electrumx/.electrumx/server.csr -signkey /home/electrumx/.electrumx/server.key -out /home/electrumx/.electrumx/server.crt
Create Banner File for Elexctrum-X Server
Edit the below and then paste into your console/terminal, (adjust as needed) :
cat << EOT > /home/electrumx/.electrumx/banner_file.txt **** Feathercoin.Network - Hosted for the community **** Feathercoin Version: \$DAEMON_VERSION Feathercoin Subversion: \$DAEMON_SUBVERSION ElectrumX Server Version: \$SERVER_VERSION ElectrumX Server Subversion: \$SERVER_SUBVERSION EOT
Create electrumx config
Create the following file and be sure to edit the below info with your own details.
DAEMON_URL = make sure you put your own rpc username/password
DONATION_ADDRESS = make sure you put your own donation addresss
REPORT_HOST = the public domain name you’re going to use (eg. Electrum.Feathercoin.com)cat << EOT > /home/electrumx/.electrumx/electrumx.conf COIN = Feathercoin DB_DIRECTORY = /home/electrumx/.electrumx/db DAEMON_URL = http://YourFeathercoinRPCUser:[email protected] NET = mainnet DB_ENGINE = leveldb HOST = TCP_PORT = 50001 SSL_PORT = 50002 SSL_CERTFILE=/home/electrumx/.electrumx/server.crt SSL_KEYFILE=/home/electrumx/.electrumx/server.key BANNER_FILE = /home/electrumx/.electrumx/banner_file.txt DONATION_ADDRESS = YourDonationAddressHere REPORT_HOST = ElectrumX.YourDomainName.com EOT
Setup systemd file (auto-start on boot & auto-restart)
Create the following file:
sudo bash -c " cat << EOT > /etc/systemd/system/electrumx.service [Unit] Description=Electrumx After=network.target [Service] User=electrumx Group=electrumx EnvironmentFile=/home/electrumx/.electrumx/electrumx.conf ExecStart=/usr/bin/electrumx_server.py LimitNOFILE=8192 TimeoutStopSec=30min [Install] WantedBy=multi-user.target EOT"
Install systemd script
sudo systemctl daemon-reload
Start systemd service
sudo systemctl start electrumx.service
Enable autostart on boot for systemd service
sudo systemctl enable electrumx.service
Check systemd service is running fine
sudo systemctl status electrumx.service sudo journalctl -u electrumx -f
Watch the DB sync process and check for errors
sudo tail -f -n 50 /var/log/messages
Open Ports for Electrum-X Server
sudo firewall-cmd --zone=public --add-port=50001/tcp --permanent sudo firewall-cmd --zone=public --add-port=50002/tcp --permanent
sudo firewall-cmd --reload sudo firewall-cmd --list-all
I hope this helps someone.
Credit to @lclc_ for most of the steps :-)
-
Nice! Thanks for the guide.
I already see one more new ElectrumX server in my client: electrumx-us-1.realbotlife.com
I guess it’s from @peschu ? :)
-
-
@peschu very nice. Thanks for supporting the network, providing more choice and making Feathercoin more decentralized with that :)
-
This guide works perfectly on a $5/mo Digital Ocean Droplet. it’s fantastic and cheap and a great way to support the network as you run a full node plus electrumx!
one note, building Feathercoin Core 0.16 on the small droplet, you usually run out of memory during the build
run the below to increase swap.
free dd if=/dev/zero of=/var/swap.img bs=1024k count=1000 mkswap /var/swap.img swapon /var/swap.img free make -f makefile.unix