Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zenodeapp/cosmos-utils
This contains useful scripts for maintaining a Cosmos SDK based node setup. The utilities provided have an own versioning system so that those who make use of this could always pull the latest modules of interest without needing to incorporate the entire repository.
https://github.com/zenodeapp/cosmos-utils
blockchain cometbft cosmos-sdk maintenance node tendermint utilities utils validator wrapper
Last synced: 21 days ago
JSON representation
This contains useful scripts for maintaining a Cosmos SDK based node setup. The utilities provided have an own versioning system so that those who make use of this could always pull the latest modules of interest without needing to incorporate the entire repository.
- Host: GitHub
- URL: https://github.com/zenodeapp/cosmos-utils
- Owner: zenodeapp
- License: mit
- Created: 2024-01-15T06:11:12.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-01-23T11:19:30.000Z (12 months ago)
- Last Synced: 2024-01-26T13:21:44.680Z (11 months ago)
- Topics: blockchain, cometbft, cosmos-sdk, maintenance, node, tendermint, utilities, utils, validator, wrapper
- Language: Shell
- Homepage: https://zenode.app
- Size: 89.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Cosmos Utilities
This contains useful scripts for maintaining a Cosmos SDK based node setup. The utilities provided have an own versioning system so that those who make use of this could always pull the latest modules or jump onto different versions if they wish to do so.
This has been written by ZENODE and is licensed under the MIT-license (see [LICENSE](./LICENSE)).
> [!NOTE]
> If you wish to incorporate this into your own repository, see: [.install/README.md](./.install/README.md).## /backup
### [create.sh](./backup/create.sh)
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
### [peers.sh](./fetch/peers.sh)
This script fetches the (most recent) seeds and peers for the chain-id configured in the [\_variables.sh](./_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
```### [rpcs.sh](./fetch/rpcs.sh)
This script fetches the (most recent) rpc_servers (state sync) for the chain-id configured in the [\_variables.sh](./_variables.sh) file and adds it to the `rpc_servers` field in the config.toml file residing in the node's directory.
```
sh fetch/rpcs.sh
```### [state.sh](./fetch/state.sh)
This script fetches the (most recent) `genesis.json` file for the chain-id configured in the [\_variables.sh](./_variables.sh) file and places it inside of the /config-folder residing in the node's directory.
```
sh fetch/state.sh
```## /info
### [my-peer.sh](./info/my-peer.sh)
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
### [create.sh](./key/create.sh)
This script creates a _new_ key (or prompts to overwrite one if the _alias_ already exists).
```
sh key/create.sh
```### [import.sh](./key/import.sh)
This script imports an _existing_ key using the provided _private Ethereum key_.
```
sh key/import.sh
```## /service
### [install.sh](./service/install.sh)
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](./_variables.sh) to see which service gets installed.
```
sh service/install.sh
```### [uninstall.sh](./service/uninstall.sh)
This script uninstalls the daemon as a service. See the `$SERVICE_FILE` variable in [\_variables.sh](./_variables.sh) to see which service gets uninstalled.
```
sh service/uninstall.sh
```## /tools
### [restate-sync.sh](./tools/restate-sync.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.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]
```> [height_interval] is optional (default: 2000). This means it will set the trust_height to: latest_height - height_interval (rounded to nearest multiple of height_interval).
>
> [rpc_server_1] is optional (default: first rpc server configured in your config.toml file). If there is no rpc server configured, the script will abort.
>
> [rpc_server_2] is optional (default: rpc_server_1).> [!NOTE]
> Leaving the __-arguments empty will leave the rpc_servers field in your config.toml untouched.### [port-shifter.sh](./tools/port-shifter.sh)
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`](https://github.com/zenodeapp/port-shifter/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/port-shifter.sh
```> is how much you would like to increment the value of the ports based on the default port values.
— ZEN
Copyright (c) 2024 ZENODE