In the end, i decided to try setup electrumx from scratch and i think successfully setup it based on the log file.
Launching ElectrumX server...
INFO:electrumx:ElectrumX server starting
INFO:electrumx:logging level: INFO
INFO:Controller:Python version: 3.8.7 (default, Jan 31 2021, 21:48:01) [GCC 10.2.1 20201224]
INFO:Controller:software version: ElectrumX 1.16.0
INFO:Controller:aiorpcX version: 0.18.7
INFO:Controller:supported protocol versions: 1.4-1.4.2
INFO:Controller:event loop policy: None
INFO:Controller:reorg limit is 8,000 blocks
INFO:Daemon:daemon #1 at localhost:18332/ (current)
INFO:DB:switching current directory to /home/user/Desktop/electrumx/DB
INFO:DB:using leveldb for DB backend
INFO:DB:created new database
INFO:DB:creating metadata directory
INFO:DB:UTXO DB version: 8
INFO:DB:coin: Bitcoin
INFO:DB:network: testnet
INFO:DB:height: -1
INFO:DB:tip: 0000000000000000000000000000000000000000000000000000000000000000
INFO:DB:tx count: 0
INFO:DB:flushing DB cache at 1,200 MB
INFO:DB:sync time so far: 00s
INFO:History:history DB version: 1
INFO:History:flush count: 0
INFO:Prefetcher:catching up to daemon height 1,973,091 (1,973,092 blocks behind)
INFO:Prefetcher:verified genesis block with hash 000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943
INFO:BlockProcessor:our height: 9 daemon: 1,973,091 UTXOs 0MB hist 0MB
INFO:BlockProcessor:our height: 104,142 daemon: 1,973,091 UTXOs 58MB hist 111MB
This is how i do it. Hopefully i don't forget any step or copy wrong command
1. Install
daemontoolssudo apt install daemontools
2. Move to proper path
cd ~/Desktop
git clone https://github.com/kyuupichan/electrumx.git
cd electrumx
3. Configure Python virtual environment (optional)
python3.8 -m venv .venv
source .venv/bin/activate
mkdir ./DB
4. Install
electrumx (i think it's optional)
5. Create directory service
6. Copy the daemontools script
mkdir -p ./scripts/electrumx
cp -R ./contrib/daemontools ./scripts/electrumx
7. Configure ENV. Make sure to read this guide
https://electrumx.readthedocs.io/en/latest/environment.html#environmentcd ./scripts/electrumx/daemontools/env
nano DB_DIRECTORY
Here's value i used
FILENAME=VALUE
COIN=BITCOIN
DAEMON_URL=USERNAME:PASSWORD@LOCALHOST
DB_DIRECTORY=/home/user/Desktop/electrum/DB
NET=TESTNET
ELECTRUMX=/home/user/Desktop/electrumx/.venv/bin/electrumx_server
USERNAME=user
8. Configure log path. Change
/path/to/log/dir to
/home/user/Desktop/electrumx/scripts/electrumx/daemontools/logcd /home/user/Desktop/electrumx/scripts/electrumx/daemontools
nano run
9. Start svscan
cd /home/user/Desktop/electrumx
svscan ./service
If you can't have multiple terminal run this instead
cd /home/user/Desktop/electrumx
svscan ./service & disown
10. Add the service
cd /home/user/Desktop/electrumx/service
ln -s /home/user/Desktop/electrumx/scripts/electrumx/daemontools electrumx
11. To see output from Electrum
cd /home/user/Desktop/electrumx/scripts/electrumx/daemontools/log
tail current
P.S. It's very complicated compared with setup for
systemd system or using docker (
https://github.com/lukechilds/docker-electrumx).