From 8ba0af7605cbec830aeb62fc9e515dc39299e825 Mon Sep 17 00:00:00 2001 From: ZENODE Date: Thu, 18 Jan 2024 17:27:32 +0100 Subject: [PATCH 1/4] Update README.md Signed-off-by: ZENODE --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 69598296d4..9ae7c6162c 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,16 @@ This script assumes that you are currently operating on the Evmos fork of Genesi sh setup/upgrade.sh ``` -### 4. Create or import a key (optional) +### 4. Daemon check + +If you can't access the `genesisd` command at this point, then you may need to execute: + +``` +. ~/.bashrc +``` +> Or the equivalent: `source ~/.bashrc` + +### 5. Create or import a key (optional) A key is necessary to interact with the network/node. If you haven't already created one, either import one or generate a new one, using: @@ -99,7 +108,7 @@ sh utils/key/create.sh > __ is the private key for a (wallet) address you already own. -### 5. Node syncing +### 6. Node syncing If everything went well, you should now be able to run your node using: @@ -113,7 +122,7 @@ and see its status with: journalctl -fu tgenesisd -ocat ``` -### 6. Become a validator (optional) +### 7. Become a validator (optional) Once your node is _up-and-running_, _fully synced_ and you have a _key_ created or imported, you could become a validator using: @@ -122,7 +131,7 @@ sh setup/create-validator.sh ``` > This is a wizard and shall prompt the user only the required fields to create an on-chain validator. -### 7. Explore utilities (optional) +### 8. Explore utilities (optional) > [!TIP] > The [/utils](/utils)-folder contains useful utilities one could use to manage their node (e.g. for fetching latest seeds and peers, fetching the genesis state, quickly shifting your config's ports, recalibrating your state sync etc.). To learn more about these, see the [README](utils/README.md) in the folder. From 484f02213dd2e6c64130e6e9f336b91ac2859cdb Mon Sep 17 00:00:00 2001 From: ZENODE Date: Thu, 18 Jan 2024 17:29:07 +0100 Subject: [PATCH 2/4] Update README.md Signed-off-by: ZENODE --- setup/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setup/README.md b/setup/README.md index 471b05972e..b981d59bfe 100644 --- a/setup/README.md +++ b/setup/README.md @@ -4,9 +4,6 @@ This script installs all the dependencies (and system configurations) that are necessary for the binary to run. Since this file already gets called from within the other scripts, it is not required to call this yourself. -> [!WARNING] -> Running this script has to be done with `bash`, as the sourcing of the _~/.bashrc_-file may lead to implications if it's run with `sh`. - ## upgrade.sh > [!WARNING] @@ -56,6 +53,8 @@ This script takes care of the needed steps to join the network via State Sync: sh setup/state-sync.sh ``` > If you wish to change the default _[height_interval]_ of `2000`, run [utils/tools/restate-sync.sh](/utils/tools/restate-sync.sh) _[height_interval]_ yourself _after_ having run _setup/state-sync.sh_; see [utils/README.md](/utils) for more information. +> +> If you can't access the `genesisd` command afterwards, execute the `. ~/.bashrc` _or_ `source ~/.bashrc` command in your terminal. ## create-validator.sh From 15f9761bec252bc07223ca435094e74deb2e3cbd Mon Sep 17 00:00:00 2001 From: zenodeapp Date: Thu, 18 Jan 2024 17:30:57 +0100 Subject: [PATCH 3/4] Sourcing dependencies instead --- setup/dependencies.sh | 5 ----- setup/state-sync.sh | 7 +++++-- setup/upgrade.sh | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/setup/dependencies.sh b/setup/dependencies.sh index 2e59fae635..e5d55b0533 100644 --- a/setup/dependencies.sh +++ b/setup/dependencies.sh @@ -1,8 +1,5 @@ #!/bin/bash -# This should be run with 'bash', as the sourcing of the .bashrc file may lead to implications -# if it's run with 'sh'. - # Helper-function: adds a line to a file if it doesn't already exist (to prevent duplicates) add_line_to_file() { local line="$1" @@ -31,8 +28,6 @@ snap refresh go --channel=1.20/stable --classic # Add GOPATH export PATH=$PATH:$(go env GOPATH)/bin add_line_to_file 'export PATH=$PATH:$(go env GOPATH)/bin' ~/.bashrc false -# Source the .bashrc file to let the changes take effect in the current shell session -. ~/.bashrc # Global change of open file limits add_line_to_file "* - nofile 50000" /etc/security/limits.conf false diff --git a/setup/state-sync.sh b/setup/state-sync.sh index ca152b2e12..40abe2c718 100644 --- a/setup/state-sync.sh +++ b/setup/state-sync.sh @@ -60,7 +60,7 @@ systemctl stop $BINARY_NAME cd $REPO_ROOT # System update and installation of dependencies -bash ./setup/dependencies.sh +. ./setup/dependencies.sh # Building binaries go mod tidy @@ -91,4 +91,7 @@ sh ./utils/fetch/rpcs.sh sh ./utils/service/install.sh # Recalibrate state sync -sh ./utils/tools/restate-sync.sh +if sh ./utils/tools/restate-sync.sh; then + echo "" + echo "PS: if you're unable to access the $BINARY_NAME command, run '. ~/.bashrc' or 'source ~/.bashrc'." +fi \ No newline at end of file diff --git a/setup/upgrade.sh b/setup/upgrade.sh index f8820f67e1..4c12b55463 100644 --- a/setup/upgrade.sh +++ b/setup/upgrade.sh @@ -43,7 +43,7 @@ systemctl stop $BINARY_NAME cd $REPO_ROOT # System update and installation of dependencies -bash ./setup/dependencies.sh +. ./setup/dependencies.sh # Create a backup of old config files cp $CONFIG_DIR/app.toml $CONFIG_DIR/app.toml.bak From 6a678c0f45364a624b16cd56bbe11c0648546b69 Mon Sep 17 00:00:00 2001 From: zenodeapp Date: Thu, 18 Jan 2024 17:31:24 +0100 Subject: [PATCH 4/4] Updated utils --- utils/.install/.versionmap | 4 ++-- utils/README.md | 2 +- utils/tools/README.md | 2 +- utils/tools/restate-sync.sh | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/utils/.install/.versionmap b/utils/.install/.versionmap index bbf9622e59..7a6b505c57 100644 --- a/utils/.install/.versionmap +++ b/utils/.install/.versionmap @@ -14,7 +14,7 @@ key/README.md v1.0.0 d service/install.sh v1.0.0 u service/uninstall.sh v1.0.0 u service/README.md v1.0.1 d -tools/restate-sync.sh v1.0.0 u +tools/restate-sync.sh v1.0.1 u tools/port-shifter.sh v1.0.1 u -tools/README.md v1.0.0 d +tools/README.md v1.0.1 d LICENSE v1.0.0 a diff --git a/utils/README.md b/utils/README.md index bc5a92ae32..ab668ad1f3 100644 --- a/utils/README.md +++ b/utils/README.md @@ -103,7 +103,7 @@ sh service/uninstall.sh > [!CAUTION] > Only use this if the network your node is connected to supports state-sync! -This tool recalibrates your state-sync configurations to a more recent height. **WARNING: this wipes your entire data folder, but will backup and restore the priv_validator_state.json file**. It uses the script(s) from the [`restate-sync`](https://github.com/zenodeapp/restate-sync/tree/v1.0.0) repository (`v1.0.0`). If in doubt whether this is safe, you could always check the repository to see how it works. +This tool recalibrates your state-sync configurations to a more recent height. **WARNING: this wipes your entire data folder, but will backup and restore the priv_validator_state.json file**. It uses the script(s) from the [`restate-sync`](https://github.com/zenodeapp/restate-sync/tree/v1.0.1) repository (`v1.0.1`). If in doubt whether this is safe, you could always check the repository to see how it works. ``` sh tools/restate-sync.sh [height_interval] [rpc_server_1] [rpc_server_2] diff --git a/utils/tools/README.md b/utils/tools/README.md index f53452dc56..c003b0cc0a 100644 --- a/utils/tools/README.md +++ b/utils/tools/README.md @@ -5,7 +5,7 @@ > [!CAUTION] > Only use this if the network your node is connected to supports state-sync! -This tool recalibrates your state-sync configurations to a more recent height. **WARNING: this wipes your entire data folder, but will backup and restore the priv_validator_state.json file**. It uses the script(s) from the [`restate-sync`](https://github.com/zenodeapp/restate-sync/tree/v1.0.0) repository (`v1.0.0`). If in doubt whether this is safe, you could always check the repository to see how it works. +This tool recalibrates your state-sync configurations to a more recent height. **WARNING: this wipes your entire data folder, but will backup and restore the priv_validator_state.json file**. It uses the script(s) from the [`restate-sync`](https://github.com/zenodeapp/restate-sync/tree/v1.0.1) repository (`v1.0.1`). If in doubt whether this is safe, you could always check the repository to see how it works. ``` sh tools/restate-sync.sh [height_interval] [rpc_server_1] [rpc_server_2] diff --git a/utils/tools/restate-sync.sh b/utils/tools/restate-sync.sh index f643aaf1ec..8bb4b59ef0 100644 --- a/utils/tools/restate-sync.sh +++ b/utils/tools/restate-sync.sh @@ -18,11 +18,11 @@ ROOT=$(cd "$(dirname "$0")"/.. && pwd) SAVE_AS="$ROOT/tools/_restate-sync.sh" # Repository where the port shifter resides -VERSION=v1.0.0 # Added versioning for non-breaking changes and security measures +VERSION=v1.0.1 # Added versioning for non-breaking changes and security measures EXTERNAL_REPO=https://raw.githubusercontent.com/zenodeapp/restate-sync/$VERSION # restate-sync.sh -# See https://github.com/zenodeapp/restate-sync/blob/v1.0.0/restate-sync.sh +# See https://github.com/zenodeapp/restate-sync/blob/v1.0.1/restate-sync.sh wget -O $SAVE_AS $EXTERNAL_REPO/restate-sync.sh # Execute script