Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Genesis v1.0.0 #22

Merged
merged 4 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -99,7 +108,7 @@ sh utils/key/create.sh <key_alias> <private_eth_key>

> _<private_eth_key>_ 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:

Expand All @@ -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:

Expand All @@ -122,7 +131,7 @@ sh setup/create-validator.sh <moniker> <key_alias>
```
> 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.
5 changes: 2 additions & 3 deletions setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -56,6 +53,8 @@ This script takes care of the needed steps to join the network via State Sync:
sh setup/state-sync.sh <moniker>
```
> 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

Expand Down
5 changes: 0 additions & 5 deletions setup/dependencies.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions setup/state-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion setup/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions utils/.install/.versionmap
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion utils/tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions utils/tools/restate-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading