Description of the issue
Electrumx has one critical issue(https://github.com/kyuupichan/electrumx/issues/185), when servers started to get desynchronized with Crown chain after about a month of work and Electrum Crown wallet start to show that server is lagging
Please note that on this problem is currently working Electrumx creator, so I will import changes after the final fix is done. But for now we need to maintain servers as soon as the problem occurs.
Identification of issue
To be sure that you have the same problem as described in the issue above do the following steps:
- Type the following command to show server logs
journalctl -u electrumx.service --no-pager -n 100
where electrumx.service
is the service name and it can be different for your case
2. You will see the following lines in the logs:
electrumx_server.py[1755]: flush_id = pack('>H', self.flush_count)
electrumx_server.py[1755]: struct.error: 'H' format requires 0 <= number <= 65535
How to fix
The following actions is needed to bring servers into the working state
- Download the electrumx repo
(only python3.6 version is supported)
:
git clone -b crown https://github.com/Crowndev/electrumx.git;
cd electrumx
- Adapt it according to your configuration:
# Configure it for your case, the value should be the same as set in /etc/electrumx.conf
environ['DB_DIRECTORY'] = '/db'
As marked in comment the value of DB_DIRECTORY should be taken from electrumx config file, which is mainly located in /etc/electrumx.conf
- Stop the electrumx server before running the script
systemctl stop electrumx.service
where electrumx.service
is the service name
- Run the script
python compact_history.py
wait untill the script is finished, it may take long(up to 6 hour, depends on hardware capability)
- Rerun electrumx server
systemctl restart electrumx.service
- Wait a minute and test that error lines are disappeared from the server log.
journalctl -u electrumx.service --no-pager -n 100