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

[WIP] Relayer ADR and diagrams #28

Merged
merged 9 commits into from
May 19, 2020
Merged
Show file tree
Hide file tree
Changes from 8 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
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"