Setting up Snark Stopper
v1.2.4
Last updated
Was this helpful?
v1.2.4
Last updated
Was this helpful?
The script will be useful for those who run the Block Producer and Snark Worker on the same server. Worker uses all your CPU cores 100%, which negatively affects the block producer. The script allows you to stop the Worker Snark 3 minutes before the block is produced and turn it on again after 10 minutes.
Check the config file. There are several options that you can remap.
Unblock the private network:
Now you need to add your public key and Worker fee to the stopper config. Open the config with the command:
In the WORKER_PUB_KEY: YOUR_PUBLIC_KEY
line, change YOUR_PUBLIC_KEY
to $MINA_PUBLIC_KEY
In the line WORKER_FEE: 1
, replace the commission value, for example, from 1 to 0.025
Done.
Logs:
Download the config file:
Now you need to add your public key and Worker commission to the stopper config. Open the config with the command:
In the WORKER_PUB_KEY: YOUR_PUBLIC_KEY
line, change YOUR_PUBLIC_KEY
to $MINA_PUBLIC_KEY
In the line WORKER_FEE: 1
, replace the commission value, for example, from 1 to 0.025
Run container:
Logs:
If the snark-stopper can't connect to port 3085
:
Check port availability:
Output should be something like this:
Connection to localhost 3085 port [tcp/*] succeeded!
If the connection hangs, then the following options are possible:
Access to port 3085
is blocked via ufw\iptables
You did not add a docker container flag -p 127.0.0.1:3085:3085
Node is not synced yet. For this reason the stopper can't connect
Port responds, but the stopper still can't connect:
it's because of the blocking of private subnets that the docker uses.
Update docker image
After running the command below, go to step 2
Delete the config file and container and download the new image:
Then we continue from point 1 or 2.