forked from akash-network/cosmos-omnibus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hard-nett
committed
Dec 28, 2024
1 parent
7034d44
commit 9529bc3
Showing
15 changed files
with
5,718 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# O-Line Playbook | ||
Useful scripts & configurations for setting up public RPC nodes. | ||
|
||
## What's Included? | ||
### Reverse Proxy | ||
- **Nginx Template** RPC,API,GRPC,SEED | ||
- **Caddy Template** | ||
|
||
### Relayer | ||
- [**Keep Alive**](./relayer/keepalive/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# relayer-keepalive | ||
|
||
This is a script to keep IBC | ||
light clients alive using the open-source IBC relayer | ||
[Hermes](https://hermes.informal.systems). | ||
|
||
See the IBC-Go docs on [light client | ||
pauses](https://ibc.cosmos.network/main/ibc/proposals.html). Essentially, if a | ||
client is not used for a period of time (its "trust period"), it will be paused, | ||
requiring a governance proposal to restart it. This script will check the light | ||
clients specified and use Hermes to update recently inactive clients, keeping | ||
them alive to prevent needing to restart them via governance proposals. If it | ||
fails to do so for any reason, it will send a notification to a Discord channel | ||
for troubleshooting. | ||
|
||
## Usage | ||
|
||
1. Install [Hermes](https://hermes.informal.systems) and configure it. | ||
|
||
2. Install the dependencies: | ||
|
||
```sh | ||
npm install | ||
``` | ||
|
||
3. Create `config.toml` from `config.toml.example` and fill in the values, | ||
configuring the same chains as in your Hermes config as well as the polytone | ||
client connections to keep alive. Chain names must match known chain names | ||
from the [Chain Registry](https://github.com/cosmology-tech/chain-registry)'s | ||
list of chains in | ||
[chains.ts](https://github.com/cosmology-tech/chain-registry/blob/main/packages/chain-registry/src/chains.ts). | ||
|
||
```toml | ||
[[chains]] | ||
name = "<CHAIN A NAME>" | ||
rpc = "<CHAIN A RPC>" | ||
notify_balance_threshold = 1000000 | ||
|
||
[[chains]] | ||
name = "<CHAIN B NAME>" | ||
rpc = "<CHAIN B RPC>" | ||
notify_balance_threshold = 1000000 | ||
|
||
[[connections]] | ||
chain_a = "<CHAIN A NAME>" | ||
client_a = "<CHAIN A IBC CLIENT>" | ||
|
||
chain_b = "<CHAIN B NAME>" | ||
client_b = "<CHAIN B IBC CLIENT>" | ||
``` | ||
|
||
4. Create a Discord webhook by following this guide: | ||
|
||
https://discordjs.guide/popular-topics/webhooks.html#creating-webhooks | ||
|
||
Then, add the webhook URL to `config.toml`. | ||
|
||
5. Run the script: | ||
|
||
```sh | ||
npm run keepalive | ||
``` | ||
|
||
Set up a cron job to run this script periodically. For example, to run it | ||
every 3 days: | ||
|
||
```sh | ||
0 0 */3 * * cd /path/to/polytone-keepalive && npm run keepalive | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
mnemonic = "" | ||
|
||
[discord] | ||
webhook_url = "" | ||
notify_user_ids = [ | ||
"", | ||
"" | ||
] | ||
|
||
[[chains]] | ||
name = "juno" | ||
rpc = "https://juno-rpc.reece.sh" | ||
notify_balance_threshold = 1000000 | ||
|
||
[[chains]] | ||
name = "junotestnet" | ||
rpc = "https://uni-rpc.reece.sh" | ||
notify_balance_threshold = 1000000 | ||
|
||
[[connections]] | ||
chain_a = "juno" | ||
client_a = "07-tendermint-XXX" | ||
|
||
chain_b = "junotestnet" | ||
client_b = "07-tendermint-XXX" |
Oops, something went wrong.