configpeer=enode://2439c1223fd90c2bba0e921bbd07cedc47465@x.x.x.x:30303
cd $HOME
sudo systemctl stop autonityd
sudo systemctl disable autonityd
rm -rf /etc/systemd/system/autonityd.service
cd $HOME
your_ip="$(curl ifconfig.me)"
sudo tee /etc/systemd/system/autonityd.service > /dev/null << EOF
[Unit]
Description=Autonityd Node
After=network-online.target
StartLimitIntervalSec=0
[Service]
User=$USER
Restart=always
RestartSec=3
LimitNOFILE=65535
ExecStart=autonity \
--datadir ${HOME}/autonity-client/autonity-chaindata \
--piccadilly \
--http \
--http.addr 0.0.0.0 \
--http.api aut,eth,net,txpool,web3,admin \
--http.vhosts \* \
--ws \
--ws.addr 0.0.0.0 \
--ws.api aut,eth,net,txpool,web3,admin \
--nat extip:$your_ip \
--bootnodes $configpeer
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable autonityd
sudo systemctl restart autonityd
sudo journalctl -u autonityd -f -o cat