Skip to content

How to resync the activenode

LocalCoin.is edited this page Jul 10, 2019 · 6 revisions

Resync activenode

Sometimes activenode could start skipping blocks.

You can check it there: https://llc.is/#/activenodes.

The main reason of this behavior is that activenode has lost connection to the mainnet and start sending activities to its own private network. It could be ddos attack on mainnet, or fault block from witness.

Use --resync-blockchain option to download a copy of blockchain from the mainnet.

Also you can use --replay-blockchain, it will check all blocks. It works much faster

If you was following this instructions - https://github.com/LocalCoinIS/LocalCoin-core/wiki/How-to-setup-Activenode-in-Ubuntu-18.04 stop your node service, that resync it, and restart service.

sudo systemctl stop llcnode
cd ~
cd myactivenode
./witness_node --replay-blockchain

Node will start downloading blocks, wait for it's end. Then press ctrl+c to exit and restart the service sudo systemctl start llcnode.

How create a resync crontab

If you want your node to be resynced using crontab edit your service file.

Edit your service file sudo nano /etc/systemd/system/llcnode.service

Add --replay-blockchain option to your exec (path and user must be from your environment):

[Unit]
Description=Graphene Witness Service
After=network.target

[Service]
User=root
Group=root
WorkingDirectory=/root/myactivenode
ExecStart=/root/myactivenode/witness_node --replay-blockchain

[Install]
WantedBy=multi-user.target

Save service but pressing ctrl+o and enter.

Restart your services - sudo systemctl daemon-reload.

Now, you service will be resyncing blockchain every time it starts. You can create a crontab event (use https://crontab.guru/):

sudo crontab -e
0 */6 * * * sudo systemctl restart llcnode

This crontab event will resync your node four times a day.

Clone this wiki locally