From 7834843e74885b95f2b0d4927f78e659839f898d Mon Sep 17 00:00:00 2001 From: Pietro Abate Date: Fri, 14 Mar 2025 15:06:30 +0100 Subject: [PATCH 1/5] packages: specify datadir in octez-baker startup script --- scripts/packaging/octez/debian/octez-baker@.service | 2 +- scripts/packaging/octez/scripts/systemd-octez-bakers.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/packaging/octez/debian/octez-baker@.service b/scripts/packaging/octez/debian/octez-baker@.service index c922a3139f25..d21b1937f574 100644 --- a/scripts/packaging/octez/debian/octez-baker@.service +++ b/scripts/packaging/octez/debian/octez-baker@.service @@ -12,7 +12,7 @@ Restart=on-failure User=tezos # We wrap the command in /bin/sh to identify the baker associated to $PROTOCOL -ExecStart=/bin/sh -c "/usr/bin/octez-baker-%i --base-dir /var/tezos/.tezos-client run with local node $DATADIR --liquidity-baking-toggle-vote $LQVOTE $RUNTIME_OPTS $BAKING_KEY" +ExecStart=/bin/sh -c "/usr/bin/octez-baker-%i --base-dir $HOME/.tezos-client run with local node $DATADIR --liquidity-baking-toggle-vote $LQVOTE $RUNTIME_OPTS $BAKING_KEY" ExecStartPre=+touch /var/log/tezos/baker-%i.log ExecStartPre=+chown tezos:tezos /var/log/tezos/baker-%i.log diff --git a/scripts/packaging/octez/scripts/systemd-octez-bakers.sh b/scripts/packaging/octez/scripts/systemd-octez-bakers.sh index f884f5bf43e7..f85b0182ff6d 100755 --- a/scripts/packaging/octez/scripts/systemd-octez-bakers.sh +++ b/scripts/packaging/octez/scripts/systemd-octez-bakers.sh @@ -23,7 +23,7 @@ for file in /usr/bin/octez-baker-P*; do systemctl start "octez-baker@$proto" elif [ "$1" = "stop" ]; then systemctl stop "octez-baker@$proto" - if grep -q '--dal-node' /etc/default/octez-baker; then + if grep -q "\-\-dal-node" /etc/default/octez-baker; then systemctl stop octez-dal-node fi fi -- GitLab From 6a7dc4c7a723c0e3de1401d84fd6dbc43b202499 Mon Sep 17 00:00:00 2001 From: Pietro Abate Date: Fri, 14 Mar 2025 15:16:57 +0100 Subject: [PATCH 2/5] packages: make sure to detext errors in baker service --- scripts/packaging/octez/debian/octez-baker.service | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/packaging/octez/debian/octez-baker.service b/scripts/packaging/octez/debian/octez-baker.service index 15b26a76118c..6562dd0263d6 100644 --- a/scripts/packaging/octez/debian/octez-baker.service +++ b/scripts/packaging/octez/debian/octez-baker.service @@ -4,7 +4,6 @@ After=network.target [Service] Type=oneshot -ExecStart=/bin/true RemainAfterExit=yes Restart=on-failure TimeoutStartSec=300 @@ -16,8 +15,8 @@ EnvironmentFile=-/etc/default/octez-baker # The baker is started only if the node is up and running ExecStartPre=/usr/share/octez-baker/wait-for-node-up.sh -ExecStartPre=/usr/share/octez-baker/systemd-octez-bakers.sh start -ExecStopPost=/usr/share/octez-baker/systemd-octez-bakers.sh stop +ExecStart=/usr/share/octez-baker/systemd-octez-bakers.sh start +ExecStop=/usr/share/octez-baker/systemd-octez-bakers.sh stop [Install] WantedBy=multi-user.target -- GitLab From 5fb12f69616019063cafc68c133b54c907c182e2 Mon Sep 17 00:00:00 2001 From: Pietro Abate Date: Thu, 13 Mar 2025 12:01:44 +0100 Subject: [PATCH 3/5] packages: refactor tests scripts --- docs/introduction/install-bin-deb.sh | 66 +------------------ .../packages/debian-systemd-tests.Dockerfile | 4 +- .../packaging/tests/deb/install-bin-deb.sh | 7 +- .../tests/deb/upgrade-systemd-test.sh | 27 ++++---- scripts/packaging/tests/tests-common.inc.sh | 66 +++++++++++++++++++ 5 files changed, 90 insertions(+), 80 deletions(-) create mode 100644 scripts/packaging/tests/tests-common.inc.sh diff --git a/docs/introduction/install-bin-deb.sh b/docs/introduction/install-bin-deb.sh index 8228d2569ede..a55adee7031d 100755 --- a/docs/introduction/install-bin-deb.sh +++ b/docs/introduction/install-bin-deb.sh @@ -18,70 +18,8 @@ else PREFIX= fi -#shellcheck disable=SC2317 -# Function to run apt-get with retries and exponential backoff for a specific error -apt_get_with_retries() { - set +x - # Maximum retries - max_retries=5 - # Initial delay in seconds - delay=1 - - # Loop for retries - for i in $(seq 1 "$max_retries"); do - - set +e - # Run apt-get and capture the output and exit status - output=$(apt-get "$@" 2>&1) - status=$? - set -e - - # Check if apt-get succeeded - if [ "$status" -eq 0 ]; then - echo "$output" - set -x - return 0 - fi - - case "$output" in - *"Mirror sync in progress"*) - retry=1 - ;; - *"Unknown error executing apt-key"*) - retry=1 - ;; - *) - retry=0 - ;; - esac - - #shellcheck disable=SC2181 - if [ "$retry" -eq 1 ]; then - # If the specific error occurs, retry with exponential backoff - echo "-----------" - echo "Attempt $i of $max_retries..." - echo "Error detected. Retrying in $delay seconds..." - echo "$output" - echo "-----------" - sleep "$delay" - # Exponential backoff (doubling the delay) - # 1 + 3 + 9 + 27 + 81 = 31, so we wait 121s maximum - # in total with max_retries = 5. - delay=$((delay * 3)) - else - # If the error is not the one we are looking for, exit with failure - echo "apt-get failed with an unexpected error. Exiting." - echo "$output" - exit 1 - fi - done - - echo "apt-get failed after $max_retries attempts." - exit 1 -} - -# Replace apt-get with the new function -alias apt-get="apt_get_with_retries" +# include apt-get function with retry +. scripts/packaging/tests/tests-common.inc.sh . scripts/ci/octez-packages-version.sh diff --git a/images/packages/debian-systemd-tests.Dockerfile b/images/packages/debian-systemd-tests.Dockerfile index 5923f9aba319..59dfcb674c55 100644 --- a/images/packages/debian-systemd-tests.Dockerfile +++ b/images/packages/debian-systemd-tests.Dockerfile @@ -12,10 +12,10 @@ COPY scripts/ci/systemd-entrypoint.service /etc/systemd/system/bash.service #hadolint ignore=DL3045 COPY scripts/ci/systemd-entrypoint.sh /entrypoint.sh #hadolint ignore=DL3045 -COPY docs/introduction/install-bin-deb.sh docs/introduction/install-bin-deb.sh -#hadolint ignore=DL3045 COPY scripts/ci/octez-packages-version.sh scripts/ci/octez-packages-version.sh #hadolint ignore=DL3045 +COPY scripts/packaging/tests/tests-common.inc.sh scripts/packaging/tests/tests-common.inc.sh +#hadolint ignore=DL3045 COPY script-inputs/active_protocol_versions_without_number script-inputs/active_protocol_versions_without_number RUN chown root:root /entrypoint.sh \ && chmod 755 /entrypoint.sh \ diff --git a/scripts/packaging/tests/deb/install-bin-deb.sh b/scripts/packaging/tests/deb/install-bin-deb.sh index c74c4e306dfc..74b0f14657c7 100755 --- a/scripts/packaging/tests/deb/install-bin-deb.sh +++ b/scripts/packaging/tests/deb/install-bin-deb.sh @@ -8,6 +8,9 @@ DISTRO=$1 RELEASE=$2 DATADIR=${3:-} +# include apt-get function with retry +. scripts/packaging/tests/tests-common.inc.sh + # For the upgrade script in the CI, we do not want debconf to ask questions export DEBIAN_FRONTEND=noninteractive @@ -19,7 +22,7 @@ sudo curl "$REPO/$DISTRO/octez.asc" | sudo gpg --dearmor -o /etc/apt/trusted.gpg # [add next repository] repository="deb $REPO/$DISTRO $RELEASE main" echo "$repository" | sudo tee /etc/apt/sources.list.d/octez-next.list -sudo apt-get update +apt-get update # [ preeseed octez ] if [ -z "$PREFIX" ]; then @@ -43,7 +46,7 @@ EOF sudo debconf-get-selections | grep octez fi -sudo apt-get install -y octez-baker +apt-get install -y octez-baker if [ -n "$DATADIR" ]; then echo "Setup Custom data dir" diff --git a/scripts/packaging/tests/deb/upgrade-systemd-test.sh b/scripts/packaging/tests/deb/upgrade-systemd-test.sh index f63fe7d378c1..66313b13badb 100755 --- a/scripts/packaging/tests/deb/upgrade-systemd-test.sh +++ b/scripts/packaging/tests/deb/upgrade-systemd-test.sh @@ -8,6 +8,9 @@ REPOOLD="https://storage.googleapis.com/$GCP_LINUX_PACKAGES_BUCKET/old/$CI_COMMI DISTRO=$1 RELEASE=$2 +# include apt-get function with retry +. scripts/packaging/tests/tests-common.inc.sh + # For the upgrade script in the CI, we do not want debconf to ask questions export DEBIAN_FRONTEND=noninteractive @@ -22,12 +25,12 @@ sudo curl "$REPOOLD/$DISTRO/octez.asc" | sudo gpg --dearmor -o /etc/apt/trusted. reposityory="deb $REPOOLD/$DISTRO $RELEASE main" echo "$reposityory" | sudo tee /etc/apt/sources.list.d/octez-current.list -sudo apt-get update +apt-get update # [install octez] -sudo apt-get install -y octez-client -sudo apt-get install -y octez-node -sudo apt-get install -y octez-baker +apt-get install -y octez-client +apt-get install -y octez-node +apt-get install -y octez-baker dpkg -l octez-\* # [setup Octez node] @@ -60,25 +63,25 @@ sudo su tezos -c "octez-node config show" # [add next repository] repository="deb $REPO/$DISTRO $RELEASE main" echo "$repository" | sudo tee /etc/apt/sources.list.d/octez-next.list -sudo apt-get update +apt-get update # [upgrade octez] # --force-overwrite is necessary because legacy package shipped the zcash # parameters as part of the octez-node package. -sudo apt-get upgrade -y -o DPkg::options::="--force-overwrite" octez-baker +apt-get upgrade -y -o DPkg::options::="--force-overwrite" octez-baker cat /etc/default/octez-node cat /etc/default/octez-baker -sudo systemctl restart octez-node.service -sudo systemctl status octez-node.service +systemctl restart octez-node.service +systemctl status octez-node.service -sudo systemctl enable octez-baker -sudo systemctl restart octez-baker.service +systemctl enable octez-baker +systemctl restart octez-baker.service -sudo systemctl status octez-baker.service +systemctl status octez-baker.service -sudo systemctl status octez-baker.service +systemctl status octez-baker.service ERR=0 diff --git a/scripts/packaging/tests/tests-common.inc.sh b/scripts/packaging/tests/tests-common.inc.sh new file mode 100644 index 000000000000..a70ab48ce94f --- /dev/null +++ b/scripts/packaging/tests/tests-common.inc.sh @@ -0,0 +1,66 @@ +#!/bin/sh + +#shellcheck disable=SC2317 +# Function to run apt-get with retries and exponential backoff for a specific error +apt_get_with_retries() { + set +x + # Maximum retries + max_retries=5 + # Initial delay in seconds + delay=1 + + # Loop for retries + for i in $(seq 1 "$max_retries"); do + + set +e + # Run apt-get and capture the output and exit status + output=$(apt-get "$@" 2>&1) + status=$? + set -e + + # Check if apt-get succeeded + if [ "$status" -eq 0 ]; then + echo "$output" + set -x + return 0 + fi + + case "$output" in + *"Mirror sync in progress"*) + retry=1 + ;; + *"Unknown error executing apt-key"*) + retry=1 + ;; + *) + retry=0 + ;; + esac + + #shellcheck disable=SC2181 + if [ "$retry" -eq 1 ]; then + # If the specific error occurs, retry with exponential backoff + echo "-----------" + echo "Attempt $i of $max_retries..." + echo "Error detected. Retrying in $delay seconds..." + echo "$output" + echo "-----------" + sleep "$delay" + # Exponential backoff (doubling the delay) + # 1 + 3 + 9 + 27 + 81 = 31, so we wait 121s maximum + # in total with max_retries = 5. + delay=$((delay * 3)) + else + # If the error is not the one we are looking for, exit with failure + echo "apt-get failed with an unexpected error. Exiting." + echo "$output" + exit 1 + fi + done + + echo "apt-get failed after $max_retries attempts." + exit 1 +} + +# Replace apt-get with the new function +alias apt-get="apt_get_with_retries" -- GitLab From 44b441fea70b6ab68a9d429daaac56d8c8f1e552 Mon Sep 17 00:00:00 2001 From: Pietro Abate Date: Thu, 13 Mar 2025 14:54:50 +0100 Subject: [PATCH 4/5] packages: add wait-for-node in rpm install test --- scripts/packaging/tests/rpm/rpm-install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/packaging/tests/rpm/rpm-install.sh b/scripts/packaging/tests/rpm/rpm-install.sh index f3a04668c6d2..57769dfd85da 100755 --- a/scripts/packaging/tests/rpm/rpm-install.sh +++ b/scripts/packaging/tests/rpm/rpm-install.sh @@ -57,6 +57,10 @@ if [ "$(ps --no-headers -o comm 1)" = "systemd" ]; then systemctl enable octez-node systemctl start octez-node + # give some time to the node to create the identity + # otherwise the octez-client call below will give an error + /usr/share/octez-baker/wait-for-node-up.sh + systemctl enable octez-baker systemctl start octez-baker.service -- GitLab From fb5ede3f01cb3e9e3f483bd28f5eaebf6171c1f7 Mon Sep 17 00:00:00 2001 From: Pietro Abate Date: Thu, 13 Mar 2025 15:08:47 +0100 Subject: [PATCH 5/5] packages: refactor of systemd tests --- .../packages/debian-systemd-tests.Dockerfile | 2 + images/packages/rpm-systemd-tests.Dockerfile | 2 + .../octez/debian/octez-baker.default | 2 +- .../octez/debian/octez-baker.postinst | 12 ++--- scripts/packaging/octez/debian/rules | 2 + .../octez/scripts/systemd-octez-bakers.sh | 4 ++ .../packaging/tests/deb/install-bin-deb.sh | 36 ++------------- scripts/packaging/tests/rpm/rpm-install.sh | 35 +++----------- .../tests/tests-systemd-common.inc.sh | 46 +++++++++++++++++++ 9 files changed, 72 insertions(+), 69 deletions(-) create mode 100644 scripts/packaging/tests/tests-systemd-common.inc.sh diff --git a/images/packages/debian-systemd-tests.Dockerfile b/images/packages/debian-systemd-tests.Dockerfile index 59dfcb674c55..8cf113db8241 100644 --- a/images/packages/debian-systemd-tests.Dockerfile +++ b/images/packages/debian-systemd-tests.Dockerfile @@ -16,6 +16,8 @@ COPY scripts/ci/octez-packages-version.sh scripts/ci/octez-packages-version.sh #hadolint ignore=DL3045 COPY scripts/packaging/tests/tests-common.inc.sh scripts/packaging/tests/tests-common.inc.sh #hadolint ignore=DL3045 +COPY scripts/packaging/tests/tests-systemd-common.inc.sh scripts/packaging/tests/tests-systemd-common.inc.sh +#hadolint ignore=DL3045 COPY script-inputs/active_protocol_versions_without_number script-inputs/active_protocol_versions_without_number RUN chown root:root /entrypoint.sh \ && chmod 755 /entrypoint.sh \ diff --git a/images/packages/rpm-systemd-tests.Dockerfile b/images/packages/rpm-systemd-tests.Dockerfile index f6f18c227b6d..0e21c97fcc3c 100644 --- a/images/packages/rpm-systemd-tests.Dockerfile +++ b/images/packages/rpm-systemd-tests.Dockerfile @@ -16,6 +16,8 @@ COPY scripts/ci/systemd-entrypoint.sh /entrypoint.sh COPY scripts/ci/octez-packages-version.sh scripts/ci/octez-packages-version.sh #hadolint ignore=DL3045 COPY script-inputs/active_protocol_versions_without_number script-inputs/active_protocol_versions_without_number +#hadolint ignore=DL3045 +COPY scripts/packaging/tests/tests-systemd-common.inc.sh scripts/packaging/tests/tests-systemd-common.inc.sh RUN chown root:root /entrypoint.sh \ && chmod 755 /entrypoint.sh \ && chown root:root /etc/systemd/system/bash.service \ diff --git a/scripts/packaging/octez/debian/octez-baker.default b/scripts/packaging/octez/debian/octez-baker.default index 9e6e89537f5f..1d5ddc13c9c9 100644 --- a/scripts/packaging/octez/debian/octez-baker.default +++ b/scripts/packaging/octez/debian/octez-baker.default @@ -4,4 +4,4 @@ # Other options # Keep the daemon process alive -RUNTIME_OPTS="--keep-alive" +RUNTIME_OPTS="--keep-alive --dal-node http://127.0.0.1:10732" diff --git a/scripts/packaging/octez/debian/octez-baker.postinst b/scripts/packaging/octez/debian/octez-baker.postinst index 95060727a1fb..19d2317a4275 100755 --- a/scripts/packaging/octez/debian/octez-baker.postinst +++ b/scripts/packaging/octez/debian/octez-baker.postinst @@ -42,10 +42,10 @@ configure) true) db_get octez-baker/dal-node-url DALURL=${RET} - echo "RUNTIME_OPTS=\"--dal-node $DALURL\"" >> /etc/default/octez-baker + echo "RUNTIME_OPTS=\"--keep-alive --dal-node $DALURL\"" >> /etc/default/octez-baker ;; false) - echo "RUNTIME_OPTS=--without-dal" >> /etc/default/octez-baker + echo "RUNTIME_OPTS=--keep-alive --without-dal" >> /etc/default/octez-baker ;; esac @@ -78,12 +78,12 @@ configure) true) db_get octez-baker/dal-node-url DALURL=${RET} - echo "RUNTIME_OPTS=\"--dal-node $DALURL\"" >> /etc/default/octez-baker - echoerr "RUNTIME_OPTS=--dal-node $DALURL" + echo "RUNTIME_OPTS=\" --keep-alive --dal-node $DALURL\"" >> /etc/default/octez-baker + echoerr "RUNTIME_OPTS=--keep-alive --dal-node $DALURL" ;; false) - echo "RUNTIME_OPTS=--without-dal" >> /etc/default/octez-baker - echoerr "RUNTIME_OPTS=--without-dal" + echo "RUNTIME_OPTS=--keep-alive --without-dal" >> /etc/default/octez-baker + echoerr "RUNTIME_OPTS=--keep-alive --without-dal" ;; esac diff --git a/scripts/packaging/octez/debian/rules b/scripts/packaging/octez/debian/rules index 0dcda9ed861d..141457694cb8 100755 --- a/scripts/packaging/octez/debian/rules +++ b/scripts/packaging/octez/debian/rules @@ -43,6 +43,8 @@ override_dh_installlogrotate: override_dh_install: dh_install + mkdir -p debian/octez-baker/etc/default/ + cp debian/octez-baker.octez-accuser.default debian/octez-baker/etc/default/octez-accuser dh_installdebconf override_dh_fixperms: diff --git a/scripts/packaging/octez/scripts/systemd-octez-bakers.sh b/scripts/packaging/octez/scripts/systemd-octez-bakers.sh index f85b0182ff6d..ee5e7d10b6a7 100755 --- a/scripts/packaging/octez/scripts/systemd-octez-bakers.sh +++ b/scripts/packaging/octez/scripts/systemd-octez-bakers.sh @@ -20,9 +20,13 @@ for file in /usr/bin/octez-baker-P*; do systemctl start octez-dal-node fi systemctl enable "octez-baker@$proto" + systemctl enable "octez-accuser@$proto" systemctl start "octez-baker@$proto" + systemctl start "octez-accuser@$proto" + elif [ "$1" = "stop" ]; then systemctl stop "octez-baker@$proto" + systemctl stop "octez-accuser@$proto" if grep -q "\-\-dal-node" /etc/default/octez-baker; then systemctl stop octez-dal-node fi diff --git a/scripts/packaging/tests/deb/install-bin-deb.sh b/scripts/packaging/tests/deb/install-bin-deb.sh index 74b0f14657c7..901537ee51dc 100755 --- a/scripts/packaging/tests/deb/install-bin-deb.sh +++ b/scripts/packaging/tests/deb/install-bin-deb.sh @@ -57,36 +57,6 @@ if [ -n "$DATADIR" ]; then echo "DATADIR=/custom/.tezos-node" >> /etc/default/octez-node fi -sudo systemctl start octez-node.service -sudo systemctl status octez-node.service - -# give some time to the node to create the identity -# otherwise the octez-client call below will give an error -/usr/share/octez-baker/wait-for-node-up.sh - -sudo su tezos -c "octez-client gen keys alice" -key=$(sudo su tezos -c "octez-client show address alice" | grep Hash: | awk '{ print $2 }') -echo "BAKER_KEY=$key" >> /etc/default/octez-baker - -sudo systemctl enable octez-baker -sudo systemctl start octez-baker.service - -sudo systemctl status octez-baker.service - -sudo systemctl status octez-baker.service - -sudo su tezos -c "octez-node config show" - -echo "-----------------------" -cat /etc/default/octez-node - -echo "-----------------------" -cat /etc/default/octez-baker - -echo "-----------------------" -tail /var/log/tezos/node.log - -echo "-----------------------" -for logfile in /var/log/tezos/baker-P*.log; do - tail "$logfile" -done +# This file include the systemd tests and diagnistic common +# to both rpm and deb +. scripts/packaging/tests/tests-systemd-common.inc.sh diff --git a/scripts/packaging/tests/rpm/rpm-install.sh b/scripts/packaging/tests/rpm/rpm-install.sh index 57769dfd85da..b7d4f7c8b400 100755 --- a/scripts/packaging/tests/rpm/rpm-install.sh +++ b/scripts/packaging/tests/rpm/rpm-install.sh @@ -43,6 +43,9 @@ echo "SNAPSHOT_NO_CHECK=" >> /etc/default/octez-node #shellcheck disable=SC1091 . /etc/default/octez-node +echo "RUNTIME_OPTS=\"--keep-alive --dal-node http://127.0.0.1:10732\"" >> /etc/default/octez-baker +echo "LQVOTE=off" >> /etc/default/octez-baker + rm -f "$DATADIR/config.json" su tezos -c "/usr/bin/octez-node config init \ --data-dir=$DATADIR \ @@ -54,34 +57,8 @@ su tezos -c "/usr/bin/octez-node config init \ # if systemd is available we test the service scripts if [ "$(ps --no-headers -o comm 1)" = "systemd" ]; then - systemctl enable octez-node - systemctl start octez-node - - # give some time to the node to create the identity - # otherwise the octez-client call below will give an error - /usr/share/octez-baker/wait-for-node-up.sh - - systemctl enable octez-baker - systemctl start octez-baker.service - - systemctl status octez-baker.service - - sudo su tezos -c "octez-node config show" - - echo "-----------------------" - cat /etc/default/octez-node - - echo "-----------------------" - cat /etc/default/octez-baker - - echo "-----------------------" - tail /var/log/tezos/node.log - - echo "-----------------------" - for logfile in /var/log/tezos/baker-P*.log; do - if [ -e "$logfile" ]; then - tail "$logfile" - fi - done + # This file include the systemd tests and diagnistic common + # to both rpm and deb + . scripts/packaging/tests/tests-systemd-common.inc.sh fi diff --git a/scripts/packaging/tests/tests-systemd-common.inc.sh b/scripts/packaging/tests/tests-systemd-common.inc.sh new file mode 100644 index 000000000000..76dff7855d36 --- /dev/null +++ b/scripts/packaging/tests/tests-systemd-common.inc.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +set -eu + +systemctl start octez-node.service + +# give some time to the node to create the identity +# otherwise the octez-client call below will give an error +/usr/share/octez-baker/wait-for-node-up.sh + +su tezos -c "octez-client gen keys alice" +key=$(su tezos -c "octez-client show address alice" | grep Hash: | awk '{ print $2 }') +echo "BAKER_KEY=$key" >> /etc/default/octez-baker + +systemctl start octez-baker.service + +su tezos -c "octez-node config show" + +echo "-----------------------" +cat /etc/default/octez-node + +echo "-----------------------" +cat /etc/default/octez-baker + +systemctl status octez-node.service +echo "Log: /var/log/tezos/node.log" +echo "-----------------------" +tail /var/log/tezos/node.log + +systemctl status octez-baker.service + +for logfile in /var/log/tezos/baker-P*.log; do + proto=$(basename "$logfile" | sed -E 's/baker-(P[^.]+).log/\1/') + systemctl status "octez-baker@$proto.service" + echo "Log: $logfile" + echo "-----------------------" + tail "$logfile" +done + +for logfile in /var/log/tezos/accuser-P*.log; do + proto=$(basename "$logfile" | sed -E 's/accuser-(P[^.]+).log/\1/') + systemctl status "octez-accuser@$proto.service" + echo "Log: $logfile" + echo "-----------------------" + tail "$logfile" +done -- GitLab