Directory contains necessary scripts that if run from crontab, can make sure that a system running price feed using setzer, and geth --light or parity --light will become more reliable.
- mail command must be operational to send email to arbitrary address.
- setzer must be installed
- seth must be installed
- geth must be installed (if you install parity, the scripts wont restart it)
- hostname command must be installed (package hostname under ubuntu)
Lets assume the git clone base directory is DIR.
- Edit
alert.conf
and updateEMAIL
, andACC
variables. (See Setup settings for details!) - Install all the packages under Prerequisities.
mkdir /root/.scripts
# create dir for scriptscp $DIR/\*.sh /root/.scripts
# copy all script files from DIR to /root/.scriptscp setzer-bot.service /etc/systemd/system/ && systemctl daemon-reload && systemctl enable setzer-bot && systemctl start setzer-bot
# create setzer-bot service (this one automatically restarts setzer if it stops), and starts at boot time automatically
cp UTC--xxxx /root/.ethereum/keystore/
#Add your ethereum feed account keystore to geth client.- Add and edit the file called
/root/.scripts/p.txt
and enter your ethereum feed account password. cp geth.service /etc/systemd/system/ && systemctl daemon-reload && systemctl enable geth && systemctl start geth
#create service for geth (this one automatically restarts geth if process gets terminated), and starts at boot time automatically- Use
crontab_example
to edit crontab filecrontab -e
-
cp UTC--xxxx /root/.local/share/io.parity.ethereum/keys/ethereum/
#Add your ethereum feed account keystore to geth client. -
Add and edit the file called
/root/.scripts/p.txt
and enter your ethereum feed account password. -
cp parity.service /etc/systemd/system/ && systemctl daemon-reload && systemctl enable parity && systemctl start parity
#create service for parity (this one automatically restarts parity if process gets terminated), and starts at boot time automatically -
Use
crontab_example
to edit crontab filecrontab -e
-
You are all set. :)
Note: You can install both geth and parity clients at the same time.
#allowed maximum time the scripts wait before rendering node unavailable
export RPC_TIMEOUT=50s
Note: in previous implementations $ALERT_NODE_TIMEOUT
was used. But in current implementation we just use setzer's $RPC_TIMEOUT
for the same purpose.
PLEASE EDIT THIS FILE BEFORE USING SCRIPTS
#email for alerts
export EMAIL="YOUR EMAIL ADDRESS"
#ethereum account for paying feed
export ACC="YOUR FEED ACCOUNT ADDRESS"
#balance threshold in Ether under which alert is sent
export THRESHOLD=0.01
#disk space in percentage to send alert
export DISK_SPACE_THRESHOLD=90
#parity rpc port number (should be different from GETH_RPC_PORT)
export PARITY_RPC_PORT=8545
#parity node port number, where parity expects outher nodes
#should be different from GETH_NODE_PORT
export PARITY_NODE_PORT=30303
#geth rpc port
export GETH_RPC_PORT=8555
#geth node port number, where geth expects outher nodes
#should be different from PARITY_NODE_PORT
export GETH_NODE_PORT=30305
Alerts email address if balance of feeds account is below THRESHOLD Ether defined in alert.conf
.
Script should be run every hour.
Alerts user if geth client stops updating blocks (ie. geth is not operational). Script should be run every hour. (Note: should not be called more often, because it takes geth sometimes 40 minutes to even start syncing blocks.)
Alerts user if parity client stops updating blocks (ie. parity is not operational).
Script should be run every hour.
Alerts EMAIL if free disk space is under DISK_SPACE_THRESHOLD in alert.conf
.
This script should be run once every hour.
This script alerts EMAIL
if feed update count did not increase. (Meaning the feed has not been updated since last run of this script.)
This script should be run in every 6 hours.
This script alerts EMAIL
if there is only 1 ethereum client to connect to.
This script should be run in every 30 minutes.