diff --git a/nodes/deploy/ethereum/deploy.bash b/nodes/deploy/ethereum/deploy.bash index 75d63649..8a8317d8 100755 --- a/nodes/deploy/ethereum/deploy.bash +++ b/nodes/deploy/ethereum/deploy.bash @@ -24,8 +24,9 @@ SCRIPT_DIR="$(realpath $(dirname $0))" # Node status server service file NODE_STATUS_SERVER_SERVICE_FILE="node-status.service" -# Ethereum geth service file +# Ethereum service files ETHEREUM_GETH_SERVICE_FILE="geth.service" +ETHEREUM_LIGHTHOUSE_BEACON_SERVICE_FILE="lighthousebeacon.service" set -eu @@ -74,3 +75,12 @@ cp "${SCRIPT_DIR}/${ETHEREUM_GETH_SERVICE_FILE}" "/etc/systemd/system/${ETHEREUM systemctl daemon-reload systemctl disable "${ETHEREUM_GETH_SERVICE_FILE}" echo -e "${PREFIX_WARN} Geth service updated, but not restarted!" + +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Ethereum Lighthouse service definition with ${ETHEREUM_LIGHTHOUSE_BEACON_SERVICE_FILE}" +chmod 644 "${SCRIPT_DIR}/${ETHEREUM_LIGHTHOUSE_BEACON_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${ETHEREUM_LIGHTHOUSE_BEACON_SERVICE_FILE}" "/etc/systemd/system/${ETHEREUM_LIGHTHOUSE_BEACON_SERVICE_FILE}" +systemctl daemon-reload +systemctl disable "${ETHEREUM_LIGHTHOUSE_BEACON_SERVICE_FILE}" +echo -e "${PREFIX_WARN} Lighouse service updated, but not restarted!" diff --git a/nodes/deploy/ethereum/geth.service b/nodes/deploy/ethereum/geth.service index 6d0240bd..3a4ad8cc 100644 --- a/nodes/deploy/ethereum/geth.service +++ b/nodes/deploy/ethereum/geth.service @@ -6,15 +6,9 @@ After=network.target [Service] Restart=on-failure -RestartSec=5s +RestartSec=10s EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env -ExecStart=/usr/bin/geth --syncmode snap --cache 4096 \ - --datadir /mnt/disks/nodes/ethereum \ - --txpool.globalslots 153600 --txpool.globalqueue 3072 \ - --http --http.api eth,web3,txpool \ - --http.addr "${AWS_LOCAL_IPV4}" \ - --http.port 8545 \ - --http.vhosts "*" +ExecStart=/usr/bin/geth --syncmode snap --cache 4096 --datadir /mnt/disks/nodes/ethereum --txpool.globalslots 153600 --txpool.globalqueue 3072 --http --http.api eth,web3,txpool --http.addr "${AWS_LOCAL_IPV4}" --http.port 8545 --http.vhosts "*" --authrpc.jwtsecret /home/ubuntu/moonstream-secrets/jwt.hex Type=simple User=ubuntu ExecStop=/bin/kill -s SIGINT -$MAINPID diff --git a/nodes/deploy/ethereum/lighthousebeacon.service b/nodes/deploy/ethereum/lighthousebeacon.service new file mode 100644 index 00000000..01b50f65 --- /dev/null +++ b/nodes/deploy/ethereum/lighthousebeacon.service @@ -0,0 +1,19 @@ +[Unit] +Description=Ethereum node Lighthouse client +StartLimitIntervalSec=500 +StartLimitBurst=5 +After=network.target + +[Service] +Restart=on-failure +RestartSec=10s +EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env +ExecStart=/home/ubuntu/lighthouse --network mainnet beacon_node --http --execution-endpoint http://localhost:8551 --execution-jwt /home/ubuntu/moonstream-secrets/jwt.hex --datadir /mnt/disks/nodes/ethereum/.lighthouse +Type=simple +User=ubuntu +ExecStop=/bin/kill -s SIGINT -$MAINPID +TimeoutStopSec=180 +SyslogIdentifier=lighthouse + +[Install] +WantedBy=multi-user.target