And now at node-toolbox/kill_and_restart.sh at main · safenetforum-community/node-toolbox · GitHub for all to play with.
@Southside, while I was still thinking how to go about this - yes, I am that slow - I found your addition toolbox.sh
with TUI and all, great. I have played with dialog and zenity, not with whiptail yet.
What is the proper workflow for contributing to the Github project on safenetforum-community? I use git all the time, but Github not so much.
Edit:
- Connect my IntelliJ to my Github ID
- Clone project to local repo (done!)
- Create and checkout my own branch for my contributions
- Commit changes
… not sure, just push my branch to Github and do pull requests there somehow?
Right now toolbox.sh is simply your scripts cutnpasted with the start of a whiptail menu system plonked at the top --LOTS of work to do on this and PRs very welcome, as always.
I separated out kill_and_restart.sh as I thought it was better stand alone. I may do similarly for the other two scripts in toolbox - OR I might put a common menu system at the top and the ability to call each script as a function - your input welcome here (and anyone elses)
Im not sure we have a proper workflow - you are very welcome to start a new repo yourself or fork whats already there and improve and expand via PR. If you use Git all the time, you are way ahead of me
I just completed my first version of snnm cli tool and opened a pull-request. Linux only, experimental.
The code is available here.
Paste it in a file snnm
, chmodx +x snnm
,
and the run a node like this: ./snnm -p 33300 -d yourdiscordid -s
(snnm = SAFE node node manager )
I get various errors - possibly because I already have nodes running?
I have tested this on Rocky Linux only and it seems to work. Second, starting with a system without any peer-id directories is better. Maybe there are ways of running nodes that prevent my scripts identifying port or even pid for each peer id.
If you have old peer-ids without any nodes running -y function can move old peer-id directories to an archive folder. Be careful though with that. Don’t want to move stuff with nodes running. Third, check -h for help, and look at the code too.
Thank you for this
I ve been distracted all day and night with other stuff.
I merged the PR and promise to take a good look at it tomorrow
Safenode-manager is creating non-peer-id directories and is storing files in the node/ directory resulting in errors. That leads to errors when using snnm. The latest version in my personal fork includes a fix.
For lack of a better thread, I’ll ask here: Every time I start Terminal in my laptop it says first:
bash: export: `/home/toivo/.config/safe/env': not a valid identifier
It doesn’t seem to matter, but would be nice to get rid of that. Can someone help me, please?
(Not sure if that’s it but the begin and end single quotes look different.)
A-ha. But that line is a result of a command I did months ago. How can I undo that export
?
It should be in your .bashrc file. You can edit it (carefully) and fix it
I deleted the ~/.local/share/safe/node folder and restarted node launcher. Then
./snnm.sh -p 33300 -d JPL
Updating cache with current sn status for new peer ids...
lsof: status error on /home/user/.local/share/safe/node//logs/safenode.log: No such file or directory
There is no real checking of inputs on the cli aaaand no checking of the accuracy of my posts either(!). To start a node you need an additional ‘-s’. I have corrected it in my post. I’m sorry for that.
I got an error on a freshly downloaded client:
Error:
0: Main secret key not found: "/home/thisisnotbetarewardsnet/.local/share/safe/node/downloads/wallet/main_secret_key"
Location:
sn_cli/src/bin/subcommands/wallet.rs:32
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Error:
0: I/O error: Not a directory (os error 20)
1: Not a directory (os error 20)
Location:
sn_cli/src/bin/subcommands/wallet.rs:32
Also, all nodes report zero balance, but some of them received cashnotes:
thisisnotbetarewardsnet@autonomi:~$ du ~/.local/share/safe/node/ | sort -n | grep notes
28 /home/thisisnotbetarewardsnet/.local/share/safe/node/safenode17/wallet/cash_notes
28 /home/thisisnotbetarewardsnet/.local/share/safe/node/safenode21/wallet/cash_notes
28 /home/thisisnotbetarewardsnet/.local/share/safe/node/safenode23/wallet/cash_notes
28 /home/thisisnotbetarewardsnet/.local/share/safe/node/safenode24/wallet/cash_notes
28 /home/thisisnotbetarewardsnet/.local/share/safe/node/safenode26/wallet/cash_notes
28 /home/thisisnotbetarewardsnet/.local/share/safe/node/safenode2/wallet/cash_notes
28 /home/thisisnotbetarewardsnet/.local/share/safe/node/safenode8/wallet/cash_notes
Is it because the notes are already sent to MaidSafe? Shouldn’t cash_notes disappear then?
A snnm update with a couple of fixes: The latest version v0.1.1 (edit: v0.1.2) is here in my private repo. Sorry, no time to do things more neatly.
It works fine for starting nodes. But this is still experimental and only for those who know what they are doing.
My setup is port ranges forwarded to each compute on the router and starting of nodes by port range like this: ./snnm -a 30000 -b 30009 -w 360 -d <discord-id> -s
for port in range [a,b]. I manage nodes by port number to keep things simple, not node numbers or peer-ids.
safenode-manager in user mode is actually using a registry similar to what I am doing using simple files to keep track of only pids and port numbers. I don’t use systemd. I will recover manually using ./snnm -w 180 -d drirmbda -r
. Stop port ranges similarly using -t
, and upgrade port ranges using -x
.
Do you have an equivalent of ‘interval’ for starting nodes? Either initially or after a reboot. Because that is very necessary to stop cpu and network being flogged when all nodes start at once.
Yup: -w seconds, see —help for all options.
- Pull logs and nanos gently to a local machine for offline processing.
Rocky Linux 9.4, bash
Great with vdash to view logs without stealing CPU cycles from safenodes.
sudo dnf -y install sshpass rsync #remote machine needs to have rsync installed too
mkdir -p $HOME/<myofflinefolder>/local/share/safe/node
sshpass -p 'passwordsecret' rsync -avz -e 'ssh -p <portnumber>' --bwlimit=100 --progress --exclude='record_store' <user>@<host>:/home/<user>/.local/share/safe/node/ $HOME/<myofflinefolder>/local/share/safe/node/
vdash $HOME/*/local/share/safe/node/*/logs/safenode.log
- Pull latest experimental version of snnm.
Rocky Linux 9.4, bash
Run./snnm --help
or set path to be able to usesnnm --help
cd "$HOME"
wget https://raw.githubusercontent.com/drirmbda/node-toolbox/drirmbda-dev/snnm -O snnm
echo "WARNING: snnm is experimental software, only for people who know what they are doing. Review the code before using at your own responsibility."
chmod +x snnm