Jump to content
Sign in to follow this  
buzzkillb

ElectrumX Server Setup Guide [Docker]

Recommended Posts

I think this is an easier way to setup an electrumx server. It's not that bad once you go through the steps. Trying to be thorough.

Install docker

My github for this.
https://github.com/buzzkillb/docker-electrumx

We will end up running denariusd in a container and electrumx in a container.

First create a folder on your server or vps to store the denarius blockchain. This can be anywhere, but lets make this easy.

cd ~
mkdir .denarius
cd .denarius
nano denarius.conf

Sample denarius.conf, pay attention as we will need the rpcuser and rpcpassword.

rpcuser=denariusrpc
rpcpassword=MAKEUPSOMEPASSWORD
maxconnections=125
rpcport=32369
port=33369
daemon=0
listen=1
server=1
discover=1
txindex=1
bind=127.0.0.1:33369

We either sync from block 0 or use chaindata. You decide.

Now we can run the denariusd docker container.

docker run \
  --net=host \
  --name=denariusd \
  -t -d \
  -p 33369:33369 \
  -p 32369:32369 \
  -v ~/.denarius:/data \
  -P buzzkillb/denariusd:latest

To check the sync

docker logs denariusd -f

ctrl+c to exit out of that whenever

Now to run electrumx server (wait to be fully sync'd).

docker run \
  --name=electrumx \
  --net=host \
  --ulimit nofile=5120:5120 \
  -t -d \
  -v ~/electrumx:/data \
  -e DAEMON_URL=http://denariusrpc:[email protected]:32369 \
  -e COIN=Denarius \
  -p 50001:50001 \
  -p 50002:50002 \
  buzzkillb/docker-electrumx:latest

To watch these logs.

docker logs electrumx -f

Once running check it can be found.

openssl s_client -connect electrumx1.denarius.pro:50002

Working on an easy way to do the compaction.

If you stop the container and then run

docker run \
  --name=electrumx-compact \
  --net=host \
  --ulimit nofile=5120:5120 \
  -t -d \
  -v ~/electrumx:/data \
  -e DAEMON_URL=http://denariusrpc:[email protected]:32369 \
  -e COIN=Denarius \
  -p 50002:50002 \
  buzzkillb/docker-electrumx:dcompact

This will compact the database using Denarius environment variables.

With both containers electrumx and electrumx-compact both up, we can now add a cronjob to stop server, start compact, and restart server.

crontab -e

Run daily, this is overkill. Best to run every 14 days or less.

0 0 * * * docker stop electrumx >/dev/null 2>&1
1 0 * * * docker start electrumx-compact >/dev/null 2>&1
6 0 * * * docker start electrumx >/dev/null 2>&1

 

  • Like 1

Join Denarius Discord - https://discord.gg/JQEmXwb

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...