Open Llibyddap opened 3 years ago
Here's what I resolved...
Automated Launch
The scripting above turned out to be too erratic and wouldn't work consistently. So rather than using systemd
, I reverted to crontab
execution. I added a single line to the crontab
for -u root
. The line ensures that guardian.sh
is called on boot or reboot of the server.
# crontab -e -u root
@reboot /etc/systemd/system/guardian.sh
The actual scripting called by crontab
simply dumps the password into the theta executable. Obviously not the best form, but it's reliable and now tested.
# /etc/systemd/system/guardian.sh
#!/bin/bash
printf 'super_secrete_password' | /root/theta_mainnet/bin/theta start --config=/root/theta_mainnet/guardian_mainnet/node
while true; do sleep 600; done
Don't forget to use your own super_secrete_password
. If there is a better solution on the exit
that would be great. I found that without leaving the script open it would eventually cause the exit
of theta
.
summary
fingerprint/key
After a dozen reboots I found that:
summary
fingerprint didn't changeSo, I still have this open question.
Running a guardian node on ubuntu 20.04 headless server. After going through the process of getting it to sync and working through the finickiness of the databases (see 42and 40) I'd like to understand (i) if there are any best practices for running as
systemd
and (ii) how does thesummary
fingerprint persists?Systemd The basic idea would be to create a system service. But I think it probably needs to run a
bash
orexpect
script to pass the node passphrase... Here's the idea:(Yes, I know... it's running as root...) This would be the script that is run in
expect
and would look to initialize the node on restart.And to be complete - run it with:
Although this is how I've done similar automation on my servers with persistent services - I have some concerns about how the
start
/restart
of the system will work relative to the DB.summary
fingerprint/key During various iterations of my install I noticed that thesummary
key changed with each 'build'. If the db is deleted due to a corruption, does that create a newsummary
fingerprint such that the corrupted node has to be unstaked and then the new node restaked after theWithdrawnReturn
Height is reached?Thought I would start here before I begin hacking away.