buzzkillb Posted April 7, 2019 Report Share Posted April 7, 2019 To run ElectrumX, use Ubuntu 16.04 and have the denariusd daemon already setup. I tried this first in a VM. #install python 3.7 sudo apt update sudo apt install software-properties-common sudo add-apt-repository ppa:deadsnakes/ppa sudo apt update sudo apt install python3.7 #install pip sudo apt-get install python-pip sudo apt-get install python3-pip #prepare for installing electrumx (this could use some pruning) sudo apt-get install python3.7 python3.7-dev python3-pip libleveldb-dev libssl-dev python3-distutils sudo -H python3.7 -m pip install plyvel pylru aiorpcx aiohttp sudo apt-get install build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev cmake liblz4-dev sudo python3.7 -m pip install --upgrade pip setuptools wheel sudo apt-get install python3.7-dev sudo python3.7 -m pip install --upgrade aiohttp pylru leveldb plyvel aiorpcx ecdsa tribus_hash #Use electrumx installer script wget https://raw.githubusercontent.com/bauerj/electrumx-installer/master/bootstrap.sh -O - | bash #Use service electrumx start to start electrumx once it's configured #Generating TLS certificates                                                                          #electrumx has been installed successfully. Edit /etc/electrumx.conf to configure it. Replace denariusrpc and the password with your stuff configured in denarius.conf in ~/.denarius/denarius.conf Don't forget to have txindex=1 in your denarius.conf as well. sudo nano /etc/electrumx.conf #electrumx.conf # default /etc/electrumx.conf for systemd COIN = Denarius # REQUIRED DB_DIRECTORY = /db # Bitcoin Node RPC Credentials DAEMON_URL = http://RPCUSERNAME:[email protected]:32369/ # See http://electrumx.readthedocs.io/en/latest/environment.html for # information about other configuration settings you probably want to consider. DB_ENGINE=leveldb SSL_CERTFILE=/etc/electrumx/server.crt SSL_KEYFILE=/etc/electrumx/server.key TCP_PORT=50001 SSL_PORT=50002 # Listen on all interfaces: HOST= #run electrumx server service electrumx start #check its running journalctl -u electrumx -f #test openssl s_client -connect IPGoesHere:50002  2 Quote Link to comment Share on other sites More sharing options...
Ghost Posted April 7, 2019 Report Share Posted April 7, 2019 Great guide, we need to start building a list of available servers, the more the better. 2 Quote Founder of BlockForums.org - PM me for any help - Join our Discord Server: https://discord.gg/UPpQy3n Link to comment Share on other sites More sharing options...
buzzkillb Posted April 14, 2019 Author Report Share Posted April 14, 2019 Thanks to @manosv for the nice little kill cronjob to make sure the daemon isnt crashed out. Make sure you know where your denariusd is located for proper path. crontab -e 25 */1 * * * /usr/local/bin/denariusd stop 26 */1 * * * /usr/bin/killall -q -9 denariusd 27 */1 * * * /usr/local/bin/denariusd  2 Quote Link to comment Share on other sites More sharing options...
manosv Posted May 5, 2019 Report Share Posted May 5, 2019 (edited) I found my electrumx server crashed this morning.Apparently its a problem that happens with coin that have a short block intervals the flush_count would overflow after 65536 which is about 455 days in Bitcoin if we were indexing a fully synced node. However this is not the case if the node is not fully synced and ElectrumX manages to catch up the full node. In that scenario ElectrumX will quickly exhaust the 16bit space of the flush_countvariable as it flushes to disk after each block. according to this thread : https://github.com/kyuupichan/electrumx/issues/185  to fix it you have to do the following:  service electrumx stop su electrumx #This is critical for not messing with the permissions export DB_DIRECTORY='/db' export COIN=Denarius export DB_ENGINE=leveldb then issue the command: electrumx_compact_history after compacting happens then start it again with: exit #to become root again service electrumx start Apparently this has to happen every 65536 blocks for bitcoin this is every 455 days for Denarius though is way shorter than that 65536 * 20seconds  =15 days !!!! Thats why you had a problem Carsen to keep them up and running  Edited May 5, 2019 by manosv 1 1 Quote Link to comment Share on other sites More sharing options...
manosv Posted May 5, 2019 Report Share Posted May 5, 2019 (edited) So to automate all this i made the following script service electrumx stop export DB_DIRECTORY='/db' export COIN=Denarius export DB_ENGINE=leveldb electrumx_compact_history chown -R electrumx:electrumx /db service electrumx start name it whatever you want i went with compact_electrum_database.sh make it executable chmod +x compact_electrum_database.sh So then all we have to do is to make an entry to crontab to run automatically every lets say 12 days issue the command as root crontab -e and insert the following to run it automatically At 00 minutes past 1:00 on every 12 days of every month 0 1 */12 * * /root/compact_electrum_database.sh >/dev/null 2>&1 save it and you are good to go Edited May 5, 2019 by manosv 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.