From a5ed99983be4ba72e6d0ea4a722946a6b4fd290c Mon Sep 17 00:00:00 2001 From: BrickBera <128406734+BrickBera@users.noreply.github.com> Date: Tue, 10 Oct 2023 15:16:45 -0400 Subject: [PATCH] fix(script): fix scripts in docker (#1213) ### Summary by CodeRabbit - Refactor: Updated the initialization script in `e2e/testapp/docker/seed/scripts/seed0-init-step2.sh` to directly use `/.polard` as the home directory path, enhancing the script's simplicity and readability. - Chore: Added a license header to `e2e/testapp/docker/seed/scripts/set-moniker.sh` for legal compliance. - Bug Fix: Modified the `sed` command in `set-moniker.sh` to correctly replace the `moniker` value in the configuration file, improving the script's functionality and reliability. --- .../docker/seed/scripts/seed0-init-step2.sh | 2 -- .../docker/seed/scripts/set-moniker.sh | 27 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 e2e/testapp/docker/seed/scripts/set-moniker.sh diff --git a/e2e/testapp/docker/seed/scripts/seed0-init-step2.sh b/e2e/testapp/docker/seed/scripts/seed0-init-step2.sh index 9dc9be441..164d4f5ca 100644 --- a/e2e/testapp/docker/seed/scripts/seed0-init-step2.sh +++ b/e2e/testapp/docker/seed/scripts/seed0-init-step2.sh @@ -28,8 +28,6 @@ if [ -z "$KEYALGO" ]; then KEYALGO="secp256k1" fi -HOMEDIR="/.polard" - polard genesis collect-gentxs --home "$HOMEDIR" polard genesis validate-genesis --home "$HOMEDIR" diff --git a/e2e/testapp/docker/seed/scripts/set-moniker.sh b/e2e/testapp/docker/seed/scripts/set-moniker.sh new file mode 100644 index 000000000..b6914761f --- /dev/null +++ b/e2e/testapp/docker/seed/scripts/set-moniker.sh @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: BUSL-1.1 +# +# Copyright (C) 2023, Berachain Foundation. All rights reserved. +# Use of this software is govered by the Business Source License included +# in the LICENSE file of this repository and at www.mariadb.com/bsl11. +# +# ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY +# TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER +# VERSIONS OF THE LICENSED WORK. +# +# THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF +# LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF +# LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). +# +# TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +# AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +# EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +# TITLE. + +if [ -z "$HOMEDIR" ]; then + HOMEDIR="/.polard" +fi +CONFIG_TOML=$HOMEDIR/config/config.toml + +MONIKER=$1 +sed -i "s/^moniker = .*/moniker = \"$MONIKER\"/" "$CONFIG_TOML"