From 0456be944d1a083621367b64ff0f34a954efc1f6 Mon Sep 17 00:00:00 2001 From: OjusWiZard Date: Mon, 9 Dec 2024 17:53:52 +0530 Subject: [PATCH 1/2] Fix: Not unstake when `--attended=false` Signed-off-by: OjusWiZard --- README.md | 1 + run_service.sh | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 26fd3a1f..b5df5aac 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,7 @@ Agent runners are recommended to create a [backup](https://github.com/valory-xyz ### Skip user prompts You can optionally pass `--attended=false` or export the environment variable `ATTENDED=false` to skip asking for inputs from the user. +Note: In this case, if the service is staked then it will not update on-chain, to avoid unstaking. ## Observe your agents diff --git a/run_service.sh b/run_service.sh index 36e8be25..69776196 100755 --- a/run_service.sh +++ b/run_service.sh @@ -1027,13 +1027,17 @@ if [ "$local_service_hash" != "$remote_service_hash" ] || [ "$on_chain_agent_id" echo "" response="y" - if [ "${USE_STAKING}" = true ] && [ "$ATTENDED" = true ]; then + if [ "${USE_STAKING}" = true ]; then echo "If your service is in a staking program, updating your on-chain service requires that it is first unstaked." echo "Unstaking your service will retrieve the accrued staking rewards." echo "" - echo "Do you want to continue updating your service? (yes/no)" - read -r response - echo "" + if [ "$ATTENDED" = true ]; then + echo "Do you want to continue updating your service? (yes/no)" + read -r response + echo "" + else + response="n" + fi fi if [[ ! "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then From 407738d0cc95f8f8ca65b63b07f1758b73fd64f3 Mon Sep 17 00:00:00 2001 From: Ojuswi Rastogi <55619686+OjusWiZard@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:28:17 +0530 Subject: [PATCH 2/2] Update README.md Co-authored-by: jmoreira-valory <96571377+jmoreira-valory@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b5df5aac..69960ca2 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ Agent runners are recommended to create a [backup](https://github.com/valory-xyz ### Skip user prompts You can optionally pass `--attended=false` or export the environment variable `ATTENDED=false` to skip asking for inputs from the user. -Note: In this case, if the service is staked then it will not update on-chain, to avoid unstaking. +Note: In this case, if the service is staked, then it will not update the on-chain service, to avoid unstaking. If you choose a staking contract with different parameters (e.g., different bond), then you have to execute the attended mode of the script to update the on-chain service. ## Observe your agents