Nodectl


Nodectl - Node Version details (sudo nodectl -cv)

nodeadmin@Constellation-Node:/scripts$ sudo nodectl -cv
[sudo] password for nodeadmin:
  A new version of [nodectl] was detected........ v2.17.5
  To upgrade issue: sudo nodectl upgrade_nodectl

  ========================================
  =             CHECK VERSIONS           =
  ========================================

  PROFILE                    CLUSTER                    JAR FILE                
  dag-l0                     mainnet                    cl-node.jar             
  TESS INSTALLED             NODECTL INSTALLED          NODECTL CONFIG          
  v3.0.2                     v2.17.3                    v2.1.1                  
  TESS LATEST                NODECTL LATEST STABLE      CONFIG LATEST           
  v3.0.2                     v2.17.5                    v2.1.1                  
  TESS VERSION MATCH         NODECTL VERSION MATCH      NODECTL CONFIG MATCH    
  True                       False                      True
  NODECTL CODE NAME          NODECTL PRERELEASE
  Princess Warrior           False

  nodectl installed: Running on node.
  nodectl latest stable: Recommended version.
  nodectl latest: Newest, may be experimental and not
  stable.
  nodectl config: nodectl's configuration version.

  ========================================
  =             CHECK VERSIONS           =
  ========================================

  PROFILE                    CLUSTER                    JAR FILE                
  dag-l1                     mainnet                    cl-dag-l1.jar           
  TESS INSTALLED             NODECTL INSTALLED          NODECTL CONFIG          
  v3.0.2                     v2.17.3                    v2.1.1                  
  TESS LATEST                NODECTL LATEST STABLE      CONFIG LATEST           
  v3.0.2                     v2.17.5                    v2.1.1                  
  TESS VERSION MATCH         NODECTL VERSION MATCH      NODECTL CONFIG MATCH    
  True                       False                      True
  NODECTL CODE NAME          NODECTL PRERELEASE
  Princess Warrior           False

  nodectl installed: Running on node.
  nodectl latest stable: Recommended version.
  nodectl latest: Newest, may be experimental and not stable.
  nodectl config: nodectl's configuration version.
  This node's restart service does not need to be restarted because pid [782965] was found already.

nodectl - Refresh Binarines (sudo nodectl refresh_binaries)

sudo nodectl refresh_binaries

nodectl - Install new node via command line with PK12 option

If your P12 password is not working its due to a bug.  Run the following command to do the install.

sudo nodectl install --quick-install --p12-migration-path /root/your.p12 --p12-passphrase 'AbcXyzab1$$'

IMPORTANT!! Once you run this command your passphrase will be in the history file.  Run the following to clear history

history -c && history -w

nodectl configure -e (Go into the node control configuration)

1. sudo nodectl configure -e

2. Select No unless support asks

image.png

3. Press enter on this one... just an FYI.

image.png

4. Select what item you want to configure.  The hot ones are in red...especially Auto Restart

 

image.png


Make scripts to make your life easier!

This will create the folder for you to store your scrips in.

  1. Open terminal
  2. sudo mkdir /scripts
  3. chmod 770 /scripts
  4. chown root:nodeadmin /scripts

Create scripts

Scripts are easy to create with nano.  They are just the same one line command you would usually run. 

  1. cd /scripts
  2. nano l1.sh  (This will leave and stop L1.  Stop means the JAVA process will be stopped)
    Your script should contain two lines (two separate commands)

    image.png

  3. Now press CTRL-X, Y to save and it wants to know the filename and press enter.
    image.png
  4. now is you do a ls you will notice the file is not green.  Its not in executable status.  You must run chmod +x l1.sh
  5. run ls -l to see the details

    image.png

You are done! you created your first script.  Now all you do is login, cd /scripts and then type ./l1.sh and it will submit the two commands you put in your script.  Now that you made your first create another called j1.sh (that joins it).  You can stack scripts also.  This is what I do.

# cd /scripts
# ./l1.sh ; ./l0.sh ; ./j0.sh 

So this command leaves L1, Leaves L0, and then join's L0.  That way you run one command, walk away for a cup of coffee and it should be in DIP when you return.

CHECK OUT HOW TO USE IN CRONTAB! which is the Linux scheduler.  If there's issues with L1 for example you can schedule your script to run at midnight to freshen it up.   Debug related URLs | KB-DAG


Crontab example

image.png

As of 6/2025 I am running this every 3 hours until L1 is fixed.  Which is the leave L1 script I created.

0 */3 * * * /scripts/l1.sh

nodectl ipv6 disable --ni --sysctl

Disables IP6! you don't need it as its not really used for most networks.  Maybe colleges mainly and the fed's

nodectl -csl -p dag-l0

Check if you are on the seelist

 

Get back to Ready/Ready

Try1:

1. run sudo nodectl leave -p dag-l1 ; sudo nodectl stop -p dag-l1 ; sudo nodectl leave -p dag-l0 ;sudo nodectl stop -p dag-l0
2. Shut down your VM from the cloud side.  This way it really shuts down, clears out its memory file and the VM executable.  Basically a power off if it were a physical machine.
3. Power back on and login
4. run sudo nodectl execute_starchiver --datetime -p dag-l0
5. Wait 5 minutes
6. sudo nodectl upgrade --ni

Explanation - We are basically stopping L1/L0 cleanly and then shutting down the node.  Your nodes are processes on a Virtualization HyperVisor called KVM.  If you reboot then that processes never goes away. If you power off you get a clean process and the memory file is normally recreated. After that you Starchiver it, wait 5 minutes and upgrade nodectl. Let me know how it goes as I'm trying to find that as close to perfect procedure.  

 

1. Shutdown vs. Reboot Behavior