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.
# switch to electrumx_usersu-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 zipsudoaptinstallaria2p7zip-full-y# download the backup data# replace the value for direct_download_link if you want to use iCloud urlcd~direct_download_link='https://anynodes.org/snapshots/atomicals/ElectrumX-Data-807483.zip'aria2c-x16-s16-oElectrumX-Data-807483.zip $direct_download_linkmkdir-pElectrumX-db-backup# extract the .zip file. it will take about 15 minutes.sudo7zx/home/electrumx_user/ElectrumX-Data-807483.zip-o/home/electrumx_user/ElectrumX-db-backup-aoa# change owner to electrumx_usersudochown-Relectrumx_user:electrumx_user/home/electrumx_user/.electrumx/# move files to db foldersudorm-rf/home/electrumx_user/.electrumx/db/*sudomv/home/electrumx_user/ElectrumX-db-backup/ElectrumX-Data-807483/*/home/electrumx_user/.electrumx/db/
3. Run electrumx as a service
# create servicesudotee/etc/systemd/system/electrumx.service>/dev/null<<EOL[Unit]Description=Electrum X ServerRequires=bitcoind.serviceAfter=network.target[Service]User=electrumx_userEnvironmentFile=/home/electrumx_user/.electrumx/electrumx.confExecStart=/home/electrumx_user/atomicals-electrumx/electrumx_serverRestart=alwaysTimeoutSec=120RestartSec=30[Install]WantedBy=multi-user.targetEOL# start servicesudosystemctldaemon-reloadsudosystemctlenableelectrumxsudosystemctlstartelectrumx# check statussudosystemctlstatuselectrumxsudojournalctl-uelectrumx-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
sudosystemctlstopelectrumxsudosu-electrumx_usercd~/atomicals-electrumxgitfetch--allgitdescribe--tags`gitrev-list--tags--max-count=1`gitcheckout<OUTPUTFROMPREVIOUSSTEP># for example 1.16.0# install the latest atomicals-electrumxsudopython3setup.pyinstallsudosystemctlstartelectrumx# check statussudosystemctlstatuselectrumxjournalctl-uelectrumx-f
If it does not work, may need to remove the current db, do step 2 again and start syncing from there.