forked from spesmilo/electrumx
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Phuoc Do edited this page Nov 5, 2021
·
10 revisions
Welcome to the electrumx wiki!
This instruction is for Ubuntu. Adapt it for your own OS. If you have question, you can ask questions in Bitflate Discord channel. https://discord.gg/utnEyp8
- Download the latest release from: https://github.com/bitflate/bitflate/releases.
- Follow the steps to setup Bitcoin Core on your server. For example, v0.20.2: https://bitflate.org/post/2021/01/24/bitflate-binaries-v0.20.2.html
- Run your Bitflate Core daemon with -txindex=1 option to index the blockchain.
- Obtain SSL certificate. You can get a free and renewable certifcate from Let's Encrypt. https://letsencrypt.org/
- Create an electrumx user on your server. In this example, we assume the user's folder is /home/electrumx.
- Clone Bitflate ElectrumX Server from GitHub: https://github.com/bitflate/electrumx
- Build and install the project:
cd electrumx && sudo python3 setup.py install && pip3 install . --upgrade
- Create service directories:
mkdir -p scripts service data/electrumx-server var/log/electrumx
- Copy daemontools into 690A script directory:
cp -R /home/electrumx/electrumx/contrib/daemontools scripts/electrumx
- Create COIN file:
echo "Bitflate" > scripts/electrumx/env/COIN
- Create script files:
# Configure RPC user credentials to match your Bitflate Core client
RPC_USER=user
RPC_PASS=pass
RPC_IP=127.0.0.1
RPC_PORT=7332
NETWORK=mainnet
PORT_01=50001
PORT_02=50002
EXTERNAL_IP=$(curl ifconfig.me)
# Write configuration details to ElectrumX script files
echo "http://$RPC_USER:$RPC_PASS@$RPC_IP:$RPC_PORT/" > scripts/electrumx/env/DAEMON_URL
echo "/home/electrumx/electrumx/data/electrumx-server/" > scripts/electrumx/env/DB_DIRECTORY
echo "/home/electrumx/electrumx/electrumx_server" > scripts/electrumx/env/ELECTRUMX
echo "%(asctime)s %(levelname)s:%(name)s:%(message)s" > scripts/electrumx/env/LOG_FORMAT
echo "128" > scripts/electrumx/env/MAX_SESSIONS # might want less on testnet, something like 32
echo "$NETWORK" > scripts/electrumx/env/NET
echo "tcp://$EXTERNAL_IP:$PORT_01,ssl://$EXTERNAL_IP:$PORT_02" > scripts/electrumx/env/REPORT_SERVICES
echo "tcp://:$PORT_01,ssl://:$PORT_02,rpc://" > scripts/electrumx/env/SERVICES
# Enable firewall access for ElectrumX ports and reload ufw
sudo ufw allow $PORT_01 # ElectrumX
sudo ufw allow $PORT_02 # ElectrumX
sudo ufw reload
# Change log dir path
sed -i scripts/electrumx/log/run -e "s/\/path\/to\/log\/dir/\/home\/electrumx\/electrumx\/var\/log\/electrumx/"
- Copy your cert files into scripts directory
echo "/home/electrumx/server.crt" > scripts/electrumx/env/SSL_CERTFILE
echo "/home/electrumx/server.key" > scripts/electrumx/env/SSL_KEYFILE
- Set electrumx username
echo "electrumx" > scripts/electrumx/env/USERNAME
- Start service scanner
ln -s /home/electrumx/electrumx/scripts/electrumx/ /home/electrumx/electrumx/service/electrumx
svscan /home/electrumx/electrumx/service
- Start the service
svc -u /home/electrumx/electrumx/service/electrumx
- View log file
tail -f var/log/electrumx/current
- Copy config to system directory
cp contrib/systemd/electrumx.service /etc/systemd/system/
- Create
/etc/electrumx.conf
file with your options
# Bitflate Core RPC user
RPC_USER=user
RPC_PASS=pass
RPC_IP=127.0.0.1
NETWORK=mainnet
PORT_01=50001
PORT_02=50002
EXTERNAL_IP=[Your External IP]
DB_DIRECTORY=/home/electrumx/electrumx/data/electrumx-server/
COIN=Bitflate
USERNAME=electrumx
BANNER_FILE=/home/electrumx/electrumx/banner
DAEMON_URL=http://user:pass@127.0.0.1:7332/
ELECTRUMX=/home/electrumx/electrumx/electrumx_server
LOG_FORMAT=%(asctime)s %(levelname)s:%(name)s:%(message)s
MAX_SESSIONS=128
NET=mainnet
REPORT_SERVICES=tcp://[Your External IP]:50001,ssl://[Your External IP]:50002
SERVICES=tcp://:50001,ssl://:50002,rpc://
SSL_CERTFILE=/path/to/certs/fullchain.pem
SSL_KEYFILE=/path/to/certs/privkey.pem
- Start ElectrumX service
systemctl start electrumx
- Stop ElectrumX service
systemctl stop electrumx
- View Log
journalctl -u electrumx -f