atomicals-electrumx

1. Install atomicals-electrumx

2. Download ElectrumX-Data-807483

Note: This a public snapshot on iCloud. It's not uploaded or maintained by AnyNodes. https://www.icloud.com/iclouddrive/038z4LfgnnZtwLz5Kc3ERyQHw#ElectrumX-Data-807483

This step will download index db data till the block height 807,483. It can reduce the sync duration.

The backup data height is 807,483. It is where Atomicals started to index. If Atomicals upgrade their protocol, they will also start index from here.

To download the snapshot from the above iCloud url to your server, you need to generate the url with headers which includes a bearer token that valid about 40 minutes. Google how to generate the url.

We also uploaded the same copy to AnyNodes server. The following script will download the snapshot from https://anynodes.org/snapshots/atomicals/ElectrumX-Data-807483.zip

# switch to electrumx_user
su - electrumx_user

# the usual curl or wget are too slow to download large files. 
# thus we need to use the multi threads downloading tool aria2. 
# it will shrink the download duration from about 2 hours to 20 minutes.
# also install 7-zip which is faster than zip
sudo apt install aria2 p7zip-full -y

# download the backup data
# replace the value for direct_download_link if you want to use iCloud url
cd ~
direct_download_link='https://anynodes.org/snapshots/atomicals/ElectrumX-Data-807483.zip'
aria2c -x 16 -s 16 -o ElectrumX-Data-807483.zip $direct_download_link

mkdir -p ElectrumX-db-backup
# extract the .zip file. it will take about 15 minutes.
sudo 7z x /home/electrumx_user/ElectrumX-Data-807483.zip -o/home/electrumx_user/ElectrumX-db-backup -aoa

# change owner to electrumx_user
sudo chown -R electrumx_user:electrumx_user /home/electrumx_user/.electrumx/

# move files to db folder
sudo rm -rf /home/electrumx_user/.electrumx/db/*
sudo mv /home/electrumx_user/ElectrumX-db-backup/ElectrumX-Data-807483/* /home/electrumx_user/.electrumx/db/

3. Run electrumx as a service

# create service
sudo tee /etc/systemd/system/electrumx.service > /dev/null <<EOL
[Unit]
Description=Electrum X Server
Requires=bitcoind.service
After=network.target

[Service]
User=electrumx_user
EnvironmentFile=/home/electrumx_user/.electrumx/electrumx.conf
ExecStart=/home/electrumx_user/atomicals-electrumx/electrumx_server
Restart=always
TimeoutSec=120
RestartSec=30

[Install]
WantedBy=multi-user.target
EOL

# start service
sudo systemctl daemon-reload
sudo systemctl enable electrumx
sudo systemctl start electrumx

# check status
sudo systemctl status electrumx
sudo journalctl -u electrumx -f

It will take 2 days to catch up the latest block from block 807483.

After sync up, the bitcoin full node and electrumx server occupy 743 GB disk space. This is the figure on Jan 30th, 2024.

4. Update

sudo systemctl stop electrumx

sudo su - electrumx_user

cd ~/atomicals-electrumx
git fetch --all
git describe --tags `git rev-list --tags --max-count=1`
git checkout <OUTPUT FROM PREVIOUS STEP> # for example 1.16.0

# install the latest atomicals-electrumx
sudo python3 setup.py install
sudo systemctl start electrumx

# check status
sudo systemctl status electrumx
journalctl -u electrumx -f

If it does not work, may need to remove the current db, do step 2 again and start syncing from there.

Last updated