Forum Home
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular

    [Guide] Setup Feathercoin Electrum-X Server Centos 7

    Guides
    centos 7 full node howto electrum electrumx
    3
    5
    7725
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AcidD
      AcidD Moderators last edited by AcidD

      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-server

      This 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/7

      I 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 :-)

      • FTC Block Explorer + API @ https://fsight.chain.tips
      • FTC Beer Money: 6x4LEQV88zRnBvZoH6ZNK6SeRxx4KiTyJs
      • FTC bech32 address: fc1q4tclm3cv4v86ez6el76ewmharexfapxhek5a03
      • BTC bech32 address: bc1qk8umuccapuafspk9e5szahvp0detafuzugv4ay

      1 Reply Last reply Reply Quote 5
      • lclc_
        lclc_ last edited by

        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 ? :)

        https://www.bitcoinassociation.ch/ || https://feathercoin.foundation/

        P 1 Reply Last reply Reply Quote 2
        • P
          peschu @lclc_ last edited by

          @lclc_ said in [[Guide] Setup Feathercoin Electrum-X Server Centos 7]

          I guess it’s from @peschu ? :)

          Yes! :) I used the naming convention of feathercoin servers. the datacenter is located in the us…looks a bit more international ;-)

          lclc_ 1 Reply Last reply Reply Quote 4
          • lclc_
            lclc_ @peschu last edited by

            @peschu very nice. Thanks for supporting the network, providing more choice and making Feathercoin more decentralized with that :)

            https://www.bitcoinassociation.ch/ || https://feathercoin.foundation/

            1 Reply Last reply Reply Quote 3
            • AcidD
              AcidD Moderators last edited by

              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
              
              • FTC Block Explorer + API @ https://fsight.chain.tips
              • FTC Beer Money: 6x4LEQV88zRnBvZoH6ZNK6SeRxx4KiTyJs
              • FTC bech32 address: fc1q4tclm3cv4v86ez6el76ewmharexfapxhek5a03
              • BTC bech32 address: bc1qk8umuccapuafspk9e5szahvp0detafuzugv4ay

              1 Reply Last reply Reply Quote 3
              • First post
                Last post