Skip to content

Latest commit

 

History

History
106 lines (63 loc) · 3.49 KB

README.md

File metadata and controls

106 lines (63 loc) · 3.49 KB

Utilities

This contains useful scripts for maintaining a Cosmos SDK based node setup and comes from the cosmos-utils repository.

This has been written by ZENODE and is licensed under the MIT-license (see LICENSE).

_variables.sh

This holds all the repository-specific variables shared with most of the scripts. This makes it easier to adjust the chain-id, binary name or node directory without having to change it in a lot of different files.

/backup

This script creates a backup for the current node-setup, if one existed.

sh backup/create.sh [backup_dir_path]

[backup_dir_path] is optional (defaults: to a directory in the $HOME folder with a unique name based on the system's current time).

/fetch

This script fetches the (most recent) seeds and peers for the chain-id configured in the _variables.sh file and adds it to the seeds and persistent_peers fields in the config.toml file residing in the node's directory.

sh fetch/peers.sh

This script fetches the (most recent) genesis.json file for the chain-id configured in the _variables.sh file and places it inside of the /config-folder residing in the node's directory.

sh fetch/state.sh

/info

This script will print out your peer-id: node-id@ip-address:port. This is useful for sharing your node with others so that they can add you as a persistent peer.

Bear in mind that the port being echo'd is extracted from the config.toml-file. So if you start the node on a different port without explicitly stating this in the config.toml-file, then the outputted port may not represent the actual port this node uses.

sh info/my-peer.sh

Add a --local flag to echo a local IP address, instead of your (public) external address.

/key

This script creates a new key (or prompts to overwrite one if the alias already exists).

sh key/create.sh <key_alias>

This script imports an existing key using the provided private Ethereum key.

sh key/import.sh <key_alias> <private_eth_key>

/service

This script installs the daemon as a service, which will automatically start the node whenever the device reboots. See the $SERVICE_DIR and $SERVICE_FILE variables in _variables.sh to see which service gets installed.

sh service/install.sh

This script uninstalls the daemon as a service. See the $SERVICE_FILE variable in _variables.sh to see which service gets uninstalled.

sh service/uninstall.sh

/tools

This script is useful if you quickly want to replace the ports in the client.toml, config.toml and app.toml files. It uses the script(s) from the port-shifter repository (v1.0.1). If in doubt whether this is safe, you could always check the repository to see how it works.

sh tools/port-shifter.sh <port_increment_value>

<port_increment_value> is how much you would like to increment the value of the ports based on the default port values.


— ZEN

Copyright (c) 2024 ZENODE