Home Node startup script

Hi guys,

I’ve not had the time to run / maintain my nodes from home over these last few months and I now would like to spin some up again. Is there anyone that has a easy install script (for ubuntu) that creates a few containers and starts a set amount of nodes (with port forwarding) per container?

I got my own script but it had some issues and I’m not sure if I’m in the right mindset to figure it out at the moment.

3 Likes

Use formicaio from @bochaco

I like to use nohup with it.

After unzipping to ~/formicaio I run nohup ./formicaio start &

hit return, let it do its thing for a min and then go to
localhost:52100

Hit the + in the bottom right and start some nodes.

If I want to see whats happening at the app level then
tail -f ~/formicaio/nohup.out will tell me

4 Likes

I use ANM from the Autonomi community GitHub page. It gets the job done, automatic starts and upgrade of nodes, you can set limits for resource usage. You only need to make sure you have good margins because it only adds or remove 1 node per minute, so it might not react fast enough if things go south.

I don’t have the link right now but could provide it later if anyone else don’t have it.

2 Likes

Anm is a part of the NTracking github repo.

NTracking is a display dashboard for the nodes you can run with anm.

Anm works similarly to antctl in that it launches system processes. unlike antctl which does no monitoring, anm has timers and counters that you can set for different issues like memory/cpu/disk pressure.

on Ubuntu as a non root user with passwordless sudo, you run a bash command that will provide a text based menu for a few settings like reward wallet ID, max node count, starting port number and then creates a cluster configuration file which bootstraps a new cluster

then a cron that runs once a minute and if things look open for each of the limits, a node will be added. if upper limits including node count are reached, nodes are instead stopped or removed to get resources back in requested ranges.

you dont need to install ntracking to use anm.

6 Likes

@aatonnomicc can you help me with anm?

I have it running (on Debian) and first “Start nodes” everything seems fine until it says it is about to show the logfile. I’m not sure what it should show other than those first two lines of text, but the screen remains blank below. So I hit Ctrl-C and it hasn’t done anything. No nodes started, no logfile, and no config saved so Start nodes always goes through the setup.

I’m puzzled!

1 Like

Just to confirm, please paste output of

ls -al /var/antctl/

always assuming you have gone with the defaults…

Is /etc/cron.d/anm created? If so what does it contain?

1 Like

This contains an empty ‘log’ file.

$ cat /etc/cron.d/anm
* * * * * anm /bin/bash /usr/bin/anms.sh >> /var/antctl/log
1 Like

That’s all?

The cron job looks right. :white_check_mark:
Does /usr/bin/anms.sh exist?

If so what does it do if you run it manually?

I suspect this would be an @aatonnomicc al matter

1 Like

has anything happened in the log file ?

tail -f /var/antctl/log

if not was antup installed ? and are you a user with sudo privileges ?

after it starts it should write something to the log every 1 min

The logfile is empty, I saw it install things but haven’t checked specifically for antup, and yes the user can sudo.

Does the fact that running the “Start nodes” option always goes through the same setup mean it hasn’t written the config? I haven’t checked for that but remember something about it from the instructions.

What is supposed to happen in that final screen before I hit Ctrl-C?

the final screen is just the script exiting to tailing the log file.

tail -f /var/antctl/log

so if its not managing to print anything to that log file i think the cron job is not running.

log file should show something like this

07/10/2025 18:51

existing install found loading info


Version 2.0  DiscordUsername --owner timbobjohnes RewardsAddress --rewards-address 0xE02934823854092358903245803956830980396809386

Used CPU percent 35% Used MEM 60.1355% Used HD percent 2%

LoadAverage1 5.87 LoadAverage5 5.85 LoadAverage15 6.34

TotalNodes 750 RunningNodes 750 StoppedNodes 0

AddNewNode 1 NextNodeToStartOrAdd 751 NextNodeStopOrRemove 750

CpuCount 12 MaxLoadAverageAllowed 36.0 DesiredLoadAverage 30.0 NodeCap 750

Latest Ver 0.4.4 NodesLatestVersion 750 NodesToUpgrade 0 NextToUpgrade  751
Upgrade 0 Remove 0

AllowCpu 1 AllowMem 1 AllowHD 1 RemCpu 0 RemMem 0 RemHD 0
LoadAllow 1 LoadNotAllow 0 AllowNodeCap 0
DelayStart 2 DelayReStart 5 DelayUpgrade 2 DelayRemove 10
CounterStart 0 CounterUpgrade 0

CounterStart=0
CounterUpgrade=0

no upgrade requiered

no removal requiered

Node count Ok

antnode0001,12D3KooWLFHNtTs6bG89UB97Wv13Qu6gq6doaG3Bc3pqsrcHqpsj,0.4.4,RUNNING
antnode0002,12D3KooWJHHNucWsP4aXPsGPZTtqL8yYSYWBcmwZuUjuZETqrUYf,0.4.4,RUNNING


1 Like

other thought could be if the cron job is installed the main anm.sh script somehow was not installed

cat /usr/bin/anms.sh

Got it. cron wasn’t installed with Debian 12 so:

sudo apt install cron
crontab -e

And setup the cron job.

The logfile now looks more promising…

…but I’m getting mail about the cron job which contains:

/usr/bin/anms.sh: line 537: /var/antctl/override: No such file or directory
/usr/bin/anms.sh: line 150: /home/anm/.local/share/anm-wallet: No such file or directory
sudo: ufw: command not found
rm: cannot remove '/var/antctl/block': No such file or directory

I’ve about 13 messages so far and the latest is just:

/usr/bin/anms.sh: line 537: /var/antctl/override: No such file or directory

I’ll see how it pans out but it is happily starting nodes so :+1:

2 Likes

It appears to be starting nodes ok but I’m getting two messages per minute from cron. The first is:

Subject: Cron <anm@rescue> anm /bin/bash /usr/bin/anms.sh >> /var/antctl/log

/bin/sh: 1: anm: not found

The second is:

Subject: Cron <anm@rescue> /bin/bash /usr/bin/anms.sh >> /var/antctl/log

/usr/bin/anms.sh: line 537: /var/antctl/override: No such file or directory

Thoughts? :thinking:

from first message ufw is used to open and close ports so is best to install ufw

the anm-wallet message can be disregarded it was a file i used it for over riding the default wallet but is now redundant.

same for the over ride file it was for if something was to be over ridden from the default set up file.

the whole thing is a mess but it kind of works after a year of shoe horning extra things into it over beta a complete re write is needed to simplify it down to the basics.

which I am planing on starting when i get back to the boat and have some free time.

1 Like

Thanks. I think there are also issues with the os install so I’ll be updating that and setting up again. Thanks for the script and your help!

1 Like

It was built in Ubuntu server if that helps I know Debian works but requires some extra bits and bobs installed.

1 Like

Yeh, I’m going to switch to Ubuntu if I can figure out how!

1 Like

I am planing a rewrite on debian when i get to the boat.

most the stuff in anm is now redundant as adding or subtracting a node every minute is not responsive enough these days when we can run large node numbers it was made for the days of a few hundred nodes on a machine at best :rofl:

i still use it but just use the node cap to hard set the number of nodes manualy.

3 Likes

if it would be possible to set number or % of nodes to remove if limits got hit then that would be good. Also if it updated every 10 second or a choosen number then that would also be good.:folded_hands: