[User Guide] Automatic Docker Container Controller! ๐Ÿ‘จ๐Ÿผโ€๐Ÿ’ป

Welcome to the Node Controller :man_technologist:t3:

Run multiple nodes on one server?
Having issues with RAM or CPU usage?

Use this script to automatically start and stop your nodes based on how close to COMMITTEE they are. The following script will check each node via the Node Monitor API (monitor.incognito.org) and handle starting and stopping for you.

Getting Started

:star: Download the node_controller.sh script to your server.

sudo wget https://raw.githubusercontent.com/lukemax47/node_controller/main/node_controller.sh

:star: Edit the node_keys list with all of your Public Validator Keys (same keys used on monitor.incognito.org)

sudo nano node_controller.sh

:star: Adjust the epoch triggers (optional) - Currently set to turn on <5 epochs

if [ "$epoch" -gt 11 ] - epochs over # to shut off container

elif [ "$epoch" -lt 10 ] - epochs under # to turn on container

:star: Make the script executable

sudo chmod +x node_controller.sh

:star: Add this script to your crontab to automatically run
(Example: 0 */2 * * * /home/server/node_controller.sh)

sudo crontab -e

Thatโ€™s it! :rocket:

Your nodes will now automatically start and stop with no interaction on your part. Feel free to leave any comments, questions, suggestions, etc in the comments below.

2 Likes

Thanks @Jared for sharing this script . Very handy indeed. However , does this mean when the node is stopped , when it is restarted it will take some time to sync with the blockchain. This in its own right will cause extra load on the CPU, right?

Just trying to figure out what the trade offs are before I implement this script.

Yes, the nodes will start syncing with the network again from where they were at, when they were turned off.

For my setup, turning the node back on under 10 epochs seems to give plenty of time to sync to Latest.

Hi Jared,
Itโ€™s a great script, thanks!

May it be improved by adding also something to save space on disk like this one does? The author said that he doesnโ€™t maintain the code anymore.

Hello @GGolov,

My scripts work best with that users size reduction script.

The developer of that script didnโ€™t say they were stopping development but instead they would no longer assist user requests and individual support. They update it quite often and I use it daily.

1 Like

Yes but he also said he isnโ€™t making it for the community anymore but his own uses. It is designed to do things differently now and you can use it if you know whY to do, but for most regular users like me, you need to be on his older code for it to work right.

1 Like

Understood, Iโ€™ll add this to my list of scripts to potentially put together.

Eventually, I plan to combine them all together into one main script to control and automate everything.