Author

Topic: Need help setting up ElectrumX (Read 2210 times)

legendary
Activity: 1666
Merit: 1000
April 25, 2017, 07:03:24 AM
#6
Just looking through logs and saw this post linking to my Electrum DB backups.

I am not updating leveldb as often and shifted more towards RocksDB.  Further, with the very short sync time for building the ElectrumX DB (versus the prior python electrum-server) the need for DB downloads is far diminished.

That said, I'll keep posting them every few weeks if that helps.

You're doing a great job Smiley
It's been a while since i last setup electrumx, but IIRC, your backups did shave a couple of days off my initial sync... It's true the sync time is a lot lower compared to the "old" electrum server, i still think it's still relatively slow, and your backups do help new users Smiley

Happy to help  Smiley
hero member
Activity: 896
Merit: 1005
April 24, 2017, 07:09:45 AM
#5
Just looking through logs and saw this post linking to my Electrum DB backups.

I am not updating leveldb as often and shifted more towards RocksDB.  Further, with the very short sync time for building the ElectrumX DB (versus the prior python electrum-server) the need for DB downloads is far diminished.

That said, I'll keep posting them every few weeks if that helps.

You're doing a great job Smiley
It's been a while since i last setup electrumx, but IIRC, your backups did shave a couple of days off my initial sync... It's true the sync time is a lot lower compared to the "old" electrum server, i still think it's still relatively slow, and your backups do help new users Smiley
legendary
Activity: 1666
Merit: 1000
April 23, 2017, 07:18:16 AM
#4
Just looking through logs and saw this post linking to my Electrum DB backups.

I am not updating leveldb as often and shifted more towards RocksDB.  Further, with the very short sync time for building the ElectrumX DB (versus the prior python electrum-server) the need for DB downloads is far diminished.

That said, I'll keep posting them every few weeks if that helps.
hero member
Activity: 896
Merit: 1005
February 01, 2017, 09:26:19 AM
#3
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 Smiley
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 Smiley

It was pretty much installing bitcoind.

Code:
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:
Code:
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#prerequisites
I 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).

Code:
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
Code:
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:

Code:
[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

Code:
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

Code:
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 Wink
systemctl start electrumx
systemctl stop electrumx
service electrumx status
journalctl -u electrumx -f
systemctl enable electrumx
tail -f /var/log/syslog | grep -i electrumx
copper member
Activity: 1498
Merit: 1499
No I dont escrow anymore.
legendary
Activity: 2954
Merit: 4158
February 01, 2017, 09:14:51 AM
#1
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.
Jump to: