🔠Useful commands

THIS IS A NEW VERSION OF THE SERVER COMMANDS

If you are looking for the old version, you will find it here OLD - Useful server commands

Node service commands

Please look in Node Service Commands


Node info (peerID, balance, frame number...)

Please look in Check your node info


Config prover pause

To avoid being penalized, use this command to send a "pause" message to the network, if your node has crashed because of hardware failure and cannot recover. Change version-os-arch according to your needs.

cd $HOME/ceremonyclient/client && ./qclient-version-os-arch config prover pause --config $HOME/ceremonyclient/node/.config

Your qclient full binary name can be checked with ls $HOME/ceremonyclient/client


Kill node process

Use this in case you need to kill duplicated node processes that cause your node to crash.

pkill -SIGINT node

If this doesn't work, use pkill -SIGKILL node as a last resource.


Backup keys.yml and config.yml to a root/backup folder

This may be useful if you have to clean up your ceremonyclient folder and don't want to download locally your config.yml and keys.yml. You can just back up them remotely on a root/backup folder and copy them again in the node folder later on.

Copy the files from your node folder to the root/backup folder

mkdir -p /root/backup && cp /root/ceremonyclient/node/.config/config.yml /root/backup && cp /root/ceremonyclient/node/.config/keys.yml /root/backup

Copy the files back from root/backup to your node folder (a copy will also remain in the root/backup folder)

cp /root/backup/{config.yml,keys.yml} /root/ceremonyclient/node/.config/

Check total nodes connected to the network

Install grpcURL

go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest

Run

/root/go/bin/grpcurl -plaintext -max-msg-sz 5000000 localhost:8337 quilibrium.node.node.pb.NodeService.GetPeerInfo | grep peerId | wc -l

Node flags

You can append these flags to your node binary to execute various functions


Clean folders from repo files

Be careful! The below commands will delete some node files with no possibility of recovery

If you run your node and qclient via binary files, you don't need all the repo files, but if you installed your node a long time ago, you may still have those files there.

Which files do you actually require?

/root/ceremonyclient/
├── client/
│   ├── qclient-version-os-arch
│   ├── qclient-version-os-arch.dgst
│   ├── qclient-version-os-arch.dgst.sig.1
│   └── qclient-version-os-arch.dgst.sig... (other signatures files)
│
└── node/
    ├── .config/
    │   ├── keys.yml    (Keys)
    │   ├── config.yml  (Keys and configs)
    │   ├── store       (Proofs archive)
    │   │
    │   ├── MIGRATIONS        
    │   ├── RELEASE_VERSION
    │   ├── REPAIR  
    │   └── SELF_TEST
    │
    ├── node-version-os-arch
    ├── node-version-os-arch.dgst
    ├── node-version-os-arch.dgst.sig.1
    ├── node-version-os-arch.dgst.sig... (other signatures files)
    └── release_autorun.sh (optional)

If you have other extra files that you want to keep, you will need to modify the commands below according to your needs.

STEP 1 - Take a backup of your entire ceremonyclient folder

cp -rp $HOME/ceremonyclient $HOME/ceremonyclient.bak

STEP 2 - Delete all repo files in the ceremonyclient folder, excluding node and client folders

The below command is safe to run, it will just show what will be deleted, without deleting anything:

find $HOME/ceremonyclient -mindepth 1 -not \( -path "$HOME/ceremonyclient/node*" -o -path "$HOME/ceremonyclient/client*" \) -print

If the output looks good, run the actual command and delete the files:

find $HOME/ceremonyclient -mindepth 1 -not \( -path "$HOME/ceremonyclient/node*" -o -path "$HOME/ceremonyclient/client*" \) -delete

STEP 3 - Delete all repo files from the /client folder

The below command is safe to run, it will just show what will be deleted, without deleting anything:

find $HOME/ceremonyclient/client -mindepth 1 -not -name "qclient*" -print

If the output looks good, run the actual command and delete the files:

find $HOME/ceremonyclient/client -mindepth 1 -not -name "qclient*" -exec rm -rf {} +

STEP 4 - Delete all repo files from the /node folder

The below command is safe to run, it will just show what will be deleted, without deleting anything:

find $HOME/ceremonyclient/node -mindepth 1 -not \( \
    -path "*/\.config*" \
    -o -name "node-[0-9]*.*" \
    -o -name "release_autorun.sh" \
\) -print

If the output looks good, run the actual command and delete the files:

find $HOME/ceremonyclient/node -mindepth 1 -not \( \
    -path "*/\.config*" \
    -o -name "node-[0-9]*.*" \
    -o -name "release_autorun.sh" \
\) -exec rm -rf {} +

STEP 5 - Restart your node and check the log

If everything in your log looks correct, and you are sure you have not deleted unwanted files, you can proceed to delete your ceremonyclient folder backup. It is a good idea, though, to keep the backup for a while in case you discover later that you have deleted something you wanted to keep.

To delete the ceremonyclient backup, you can use this simple command:

rm -r $HOME/ceremonyclient.bak


Last updated