This guide assumes you are running Ubuntu 20.04 and above. For other operating systems, please modify accordingly.
The firod must be running with mobile=1 in the firo.conf. If this option was added later, you will need to reindex. If this is a masternode, the reindex might cause your masternode to be penalised or banned.
Also ensure that you already have rpcuser and rpcpassword in the same conf file.
Prerequisites:
sudo apt-get install git python3-setuptools
Clone and install electrumx-firo.
git clone https://github.com/firoorg/electrumx-firo
cd electrumx-firo
sudo python3 setup.py install
It is highly recommended to create a configuration directory and database directory separately.
In the example below, we create the .electrumx database and conf configuration directories. .electrumx will be used to store the database while conf for storing Electrumx configuration and certificates.
mkdir ~/.electrumx
mkdir ~/conf
cd conf
nano electrumx.conf
Please change USERNAME, path/To , RPCUSER, RPCPASSWORD to your relevant local values. Check firo.conf for the RPC values.
Press Ctrl+X to save and exit the editor.
# Enable the below if running testnet. Mainnet works without having to specify it
# NET = Testnet
COIN = Firo
# change RPC port from 8888 to 18888 if running testnet
DAEMON_URL = http://RPCUSER:RPCPASSWORD@localhost:8888/
# Set your database directory below:
DB_DIRECTORY = /path/To/.electrumx/
DB_ENGINE = leveldb
# Set your username that electrumx will run as below:
USERNAME = yourUsername
# Set the electrumx-firo that you cloned earlier:
ELECTRUMX = /path/To/electrumx-firo/electrumx_server
SERVICES = tcp://0.0.0.0:50001,ssl://0.0.0.0:50002
ANON_LOGS = electrumx
CACHE_MB = 2048
MAX_SESSIONS = 1024
# Set the path/To that you will put in the generated the certificates (usually conf directory):
SSL_CERTFILE = /path/To/server.crt
SSL_KEYFILE = /path/To/server.key
# Stack Wallet's server defaults
MAX_SEND=30000000
COST_SOFT_LIMIT=100000
COST_HARD_LIMIT=900000
CACHE_MB=4096
MAX_SESSIONS=1024
REQUEST_TIMEOUT=240
If you know how, you can use LetsEncrypt's certbot instead of a self-signed certificate.
openssl genrsa -out server.key 2048
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 1825 -in server.csr -signkey server.key -out server.crt
cd ~
sudo nano /etc/systemd/system/electrumx.service
We run electrumx_compact_history everytime before start to avoid these issues: kyuupichan/electrumx#185 , spesmilo/electrumx#88
Please change USERNAME and pathTo to your relevant local values.
[Unit]
Description=Electrumx
After=network.target
[Service]
[Unit]
Description=Electrumx
After=network.target
[Service]
# Path to your electrumx.conf (usually in conf directory):
EnvironmentFile=/pathTo/electrumx.conf
# Path to the electrumx-firo directory that you cloned earlier:
ExecStartPre=/pathTo/electrumx-firo/electrumx_compact_history
ExecStart=/pathTo/electrumx-firo/electrumx_server
ExecStop=/pathTo/electrumx-firo/electrumx_rpc -p 8000 stop
# The username you will run electrumx under:
User=USERNAME
LimitNOFILE=8192
TimeoutStopSec=30min
RuntimeMaxSec=604800s
Restart=always
[Install]
WantedBy=multi-user.target
Systemd daemon needs to be reloaded for configuration to take effect: sudo systemctl daemon-reload
Start Electrumx: sudo systemctl start electrumx.service
Enable startup at boot: sudo systemctl enable electrumx.service
View logs: sudo journalctl -u electrumx.service -f
View last 100 lines of logs: sudo journalctl -u electrumx.service -n 100
Got to Settings->Network->Add new node (Desktop wallet might differ a bit)
-
Node name: any you prefer
-
IP address: the IP address of the node/masternode/VPS/server that you just set up on
-
Port: 50001 if you setup without certificates, 50002 if you setup with certificates
-
Use SSL: check if you are using port 50002. Leave uncheck if you are using port 50001.
Gracias Anwar por la guía de electrumx-firo. Fue fundamental para montar mi nodo público carover0.xyz. ¡Gran trabajo!
❤️