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

feat: extra codec support and minor improvements #4

Merged
merged 3 commits into from
Jan 4, 2023
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
70 changes: 69 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,70 @@
# babylon-relayer
IBC relayer that supports relaying headers one-way periodically

Babylon relayer is an extended version of the IBC relayer specialised for timestamping Cosmos SDK chains.

## Requirements

- Go 1.19

## Development requirements

- Go 1.19

## Building

To build the chain, simply:
```console
make build
```

This will lead to the creation of a `babylon-relayer` executable under the `build/` directory.

## Installing

To build the chain and install a babylon executable:
```console
make install
```

## Testing

```console
make test
```

## Configuration

The configuration of Babylon relayer is exactly the same as the official IBC relayer.
Please read [the IBC relayer's documentation](https://github.com/cosmos/relayer/tree/main/docs).
This repo also provides some example configurations under the `example/` directory.

Note that some chains (e.g., Injective and EVMOS) impose extra codec formats for its RPC calls.
To support such chains, one needs to add an `"extra-codecs"` entry to its config json file.
An example can be found in `examples/chains/injective.json`.

## Usage

To add chains to `config.yaml`:
```console
babylon-relayer chains add-dir examples/chains
```

To add paths to `config.yaml`:
```console
babylon-relayer paths add-dir examples/paths
```

To restore secret keys from mnenomics:
```console
babylon-relayer keys restore $CHAIN $KEY_NAME $MNEMONICS
```

To create an IBC light client for a chain in Babylon:
```console
babylon-relayer tx client babylon $CHAIN $CHAIN
```

To start relaying headers of a chain to Babylon:
```console
babylon-relayer keep-update-client babylon $CHAIN $CHAIN --interval $INTERVAL
```
17 changes: 17 additions & 0 deletions examples/chains/akash.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "cosmos",
"value": {
"key": "akash-key",
"chain-id": "sandbox",
"rpc-addr": "http://rpc.sandbox.ny.aksh.pw:26657",
"grpc-addr": "",
"account-prefix": "akash",
"keyring-backend": "test",
"gas-adjustment": 1.5,
"gas-prices": "0.01akt",
"debug": true,
"timeout": "10s",
"output-format": "json",
"sign-mode": "direct"
}
}
17 changes: 17 additions & 0 deletions examples/chains/babylon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "cosmos",
"value": {
"key": "babylon-key",
"chain-id": "bbn-demo0",
"rpc-addr": "http://rpc0.demo.babylonchain.io:26657",
"grpc-addr": "",
"account-prefix": "bbn",
"keyring-backend": "test",
"gas-adjustment": 1.5,
"gas-prices": "0.002ubbn",
"debug": true,
"timeout": "10s",
"output-format": "json",
"sign-mode": "direct"
}
}
20 changes: 20 additions & 0 deletions examples/chains/injective.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"type": "cosmos",
"value": {
"key": "injective-key",
"chain-id": "injective-888",
"rpc-addr": "http://176.9.147.152:26657",
"grpc-addr": "http://176.9.147.152:9091",
"account-prefix": "inj",
"keyring-backend": "test",
"gas-adjustment": 1.5,
"gas-prices": "50000000000inj",
"debug": true,
"timeout": "10s",
"output-format": "json",
"sign-mode": "direct",
"extra-codecs": [
"injective"
]
}
}
17 changes: 17 additions & 0 deletions examples/chains/juno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "cosmos",
"value": {
"key": "juno-key",
"chain-id": "uni-5",
"rpc-addr": "https://rpc.uni.junonetwork.io:443",
"grpc-addr": "",
"account-prefix": "juno",
"keyring-backend": "test",
"gas-adjustment": 1.5,
"gas-prices": "0.1ujunox",
"debug": true,
"timeout": "10s",
"output-format": "json",
"sign-mode": "direct"
}
}
17 changes: 17 additions & 0 deletions examples/chains/osmosis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "cosmos",
"value": {
"key": "osmosis-key",
"chain-id": "osmo-test-4",
"rpc-addr": "https://osmosis-testnet-rpc.allthatnode.com:26657/",
"grpc-addr": "",
"account-prefix": "osmo",
"keyring-backend": "test",
"gas-adjustment": 1.5,
"gas-prices": "0.01uosmo",
"debug": true,
"timeout": "10s",
"output-format": "json",
"sign-mode": "direct"
}
}
17 changes: 17 additions & 0 deletions examples/chains/secret.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "cosmos",
"value": {
"key": "secret-key",
"chain-id": "pulsar-2",
"rpc-addr": "https://rpc.pulsar.scrttestnet.com:443",
"grpc-addr": "",
"account-prefix": "secret",
"keyring-backend": "test",
"gas-adjustment": 1.5,
"gas-prices": "0.1uscrt",
"debug": true,
"timeout": "10s",
"output-format": "json",
"sign-mode": "direct"
}
}
154 changes: 154 additions & 0 deletions examples/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
global:
api-listen-addr: :5183
timeout: 20s
memo: ""
light-cache-size: 10
chains:
akash:
type: cosmos
value:
key: akash-key
chain-id: sandbox
rpc-addr: http://rpc.sandbox.ny.aksh.pw:26657
account-prefix: akash
keyring-backend: test
gas-adjustment: 1.5
gas-prices: 1uakt
min-gas-amount: 0
debug: true
timeout: 10s
output-format: json
sign-mode: direct
extra-codecs: []
babylon:
type: cosmos
value:
key: babylon-key
chain-id: bbn-demo0
rpc-addr: http://rpc0.demo.babylonchain.io:26657
account-prefix: bbn
keyring-backend: test
gas-adjustment: 1.5
gas-prices: 0.002ubbn
min-gas-amount: 0
debug: true
timeout: 10s
output-format: json
sign-mode: direct
extra-codecs: []
injective:
type: cosmos
value:
key: injective-key
chain-id: injective-888
rpc-addr: http://176.9.147.152:26657
account-prefix: inj
keyring-backend: test
gas-adjustment: 1.5
gas-prices: 50000000000inj
min-gas-amount: 0
debug: true
timeout: 10s
output-format: json
sign-mode: direct
extra-codecs:
- injective
juno:
type: cosmos
value:
key: juno-key
chain-id: uni-5
rpc-addr: https://rpc.uni.junonetwork.io:443
account-prefix: juno
keyring-backend: test
gas-adjustment: 1.5
gas-prices: 0.1ujunox
min-gas-amount: 0
debug: true
timeout: 10s
output-format: json
sign-mode: direct
extra-codecs: []
osmosis:
type: cosmos
value:
key: osmosis-key
chain-id: osmo-test-4
rpc-addr: https://osmosis-testnet-rpc.allthatnode.com:26657/
account-prefix: osmo
keyring-backend: test
gas-adjustment: 1.5
gas-prices: 0.01uosmo
min-gas-amount: 0
debug: true
timeout: 10s
output-format: json
sign-mode: direct
extra-codecs: []
secret:
type: cosmos
value:
key: secret-key
chain-id: pulsar-2
rpc-addr: https://rpc.pulsar.scrttestnet.com:443
account-prefix: secret
keyring-backend: test
gas-adjustment: 1.5
gas-prices: 0.1uscrt
min-gas-amount: 0
debug: true
timeout: 10s
output-format: json
sign-mode: direct
extra-codecs: []
paths:
akash:
src:
chain-id: bbn-demo0
client-id: 07-tendermint-3
dst:
chain-id: sandbox
client-id: 07-tendermint-2
src-channel-filter:
rule: ""
channel-list: []
injective:
src:
chain-id: bbn-demo0
client-id: 07-tendermint-5
dst:
chain-id: injective-888
client-id: 07-tendermint-83
src-channel-filter:
rule: ""
channel-list: []
juno:
src:
chain-id: bbn-demo0
client-id: 07-tendermint-2
dst:
chain-id: uni-5
client-id: 07-tendermint-240
src-channel-filter:
rule: ""
channel-list: []
osmosis:
src:
chain-id: bbn-demo0
client-id: 07-tendermint-0
dst:
chain-id: osmo-test-4
client-id: 07-tendermint-3295
src-channel-filter:
rule: ""
channel-list: []
secret:
src:
chain-id: bbn-demo0
client-id: 07-tendermint-1
dst:
chain-id: pulsar-2
client-id: 07-tendermint-56
src-channel-filter:
rule: ""
channel-list: []
23 changes: 23 additions & 0 deletions examples/paths/akash.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"src": {
"chain-id": "bbn-demo0",
"port-id": "zoneconcierge",
"channel-id": "channel-0",
"order": "unordered",
"version": "zoneconcierge-1"
},
"dst": {
"chain-id": "sandbox",
"port-id": "zoneconcierge",
"channel-id": "channel-0",
"order": "unordered",
"version": "ics20-1"
},
"strategy": {
"type": "naive"
},
"src-channel-filter": {
"rule": null,
"channel-list": []
}
}
23 changes: 23 additions & 0 deletions examples/paths/injective.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"src": {
"chain-id": "bbn-demo0",
"port-id": "zoneconcierge",
"channel-id": "channel-0",
"order": "unordered",
"version": "zoneconcierge-1"
},
"dst": {
"chain-id": "injective-888",
"port-id": "zoneconcierge",
"channel-id": "channel-0",
"order": "unordered",
"version": "ics20-1"
},
"strategy": {
"type": "naive"
},
"src-channel-filter": {
"rule": null,
"channel-list": []
}
}
Loading