Skip to content

Commit

Permalink
[WIP] Relayer ADR and diagrams (#28)
Browse files Browse the repository at this point in the history
* relayer ADR and diagrams

* some review comments

* Relayer ADR updates, move to Rust structs, small config changes

* cargo fmt

* clean figure

* add client heights diagram and explanation, some doc corrections

* corrections on event handling diagram, added also consensus state events

* small fixes before merge
  • Loading branch information
ancazamfir committed May 19, 2020
1 parent b64f8d9 commit 8e73a85
Show file tree
Hide file tree
Showing 7 changed files with 830 additions and 14 deletions.
807 changes: 807 additions & 0 deletions docs/architecture/adr-002-ibc-relayer.md

Large diffs are not rendered by default.

Binary file added docs/architecture/assets/IBC_client_heights.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/architecture/assets/IBC_relayer.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/architecture/assets/IBC_relayer_threads.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions relayer/relay/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ pub struct ChainConfig {
pub rpc_addr: net::Address,
pub account_prefix: String,
pub key_name: String,
pub store_prefix: String,
pub client_ids: Vec<String>,
#[serde(default = "default::gas")]
pub gas: u64,
Expand Down Expand Up @@ -110,8 +111,10 @@ impl Default for Direction {

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct RelayPath {
pub src_port: Option<String>, // default from any source port
pub dest_port: Option<String>, // default from any dest port
pub src_port: Option<String>, // default from any source port
pub dest_port: Option<String>, // default from any dest port
pub src_channel: Option<String>, // default from any source port
pub dest_channel: Option<String>, // default from any dest port
#[serde(default)]
pub direction: Direction, // default bidirectional
}
Expand Down Expand Up @@ -142,6 +145,7 @@ mod tests {
);

let config = parse(path);
println!("{:?}", config);
assert!(config.is_ok());
}
}
29 changes: 17 additions & 12 deletions relayer/relay/tests/config/fixtures/relayer_conf_example.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# This is an IBC relayer sample configuration

title = "IBC Relayer Config Example"

[global]
Expand All @@ -11,6 +9,7 @@ strategy = "naive"
rpc_addr = "localhost:26657"
account_prefix = "cosmos"
key_name = "testkey"
store_prefix = "ibc"
client_ids = ["clA1", "clA2"]
gas = 200000
gas_adjustement = 1.3
Expand All @@ -19,10 +18,10 @@ strategy = "naive"

[[chains]]
id = "chain_B"
# rpc_addr = "localhost:26557"
rpc_addr = "localhost:26657"
rpc_addr = "localhost:26557"
account_prefix = "cosmos"
key_name = "testkey"
store_prefix = "ibc"
client_ids = ["clB1"]
gas = 200000
gas_adjustement = 1.3
Expand All @@ -32,19 +31,25 @@ strategy = "naive"
[[connections]]

[connections.src]
client_id = "clA1"
connection_id = "conn1-idA-clA1"
client_id = "clB1"
connection_id = "connAtoB"

[connections.dest]
client_id = "clB1"
connection_id = "conn1-idB-clB1"
client_id = "clA1"
connection_id = "connBtoA"

[[connections.paths]]
src_port = "app1-port-A"
dest_port = "app1-port-B"
src_port = "portA1"
dest_port = "portB1"
direction = "unidirectional"

[[connections.paths]]
src_port = "app2-port-A"
dest_port = "app2-port-B"
src_port = "portA2"
dest_port = "portB2"
direction = "bidirectional"

[[connections.paths]]
src_port = "portA3"
dest_port = "portB3"
src_channel = "chan3onA"
dest_channel = "chan3onB"

0 comments on commit 8e73a85

Please sign in to comment.