You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: hyperspace/README.md
+33-15
Original file line number
Diff line number
Diff line change
@@ -4,31 +4,29 @@
4
4
The relayer is designed to be:
5
5
6
6
### 1. Stateless
7
-
This means that the relayer does not perform **any form** of data caching. The relayer therefore relies heavily on
7
+
This means that the relayer does not perform **any form** of data caching. The relayer, therefore, relies heavily on
8
8
the nodes it's connected to for sourcing data as needed. This design choice eliminates a class of bugs that could come from cache invalidation.
9
9
10
10
### 2. Event Driven
11
-
The relayer follows an eventdriven model, where it waits idly until it receives a finality notification from any of the chains it's connected to. The finality notification represents new IBC messages and events that have finalized and ready to be sent to the connected counterparty chain.
11
+
The relayer follows an event-driven model, where it waits idly until it receives a finality notification from any of the chains it's connected to. The finality notification represents new IBC messages and events that have been finalized and are ready to be sent to the connected counterparty chain.
12
12
13
13
## Relayer Loop
14
14
15
15
The relayer has a single entry point, which is the [`relay`](/hyperspace/core/src/lib.rs#L20) function, this function takes two [`Chain`](/hyperspace/primitives/src/lib.rs#L346) implementations
16
16
alongside optional metric handlers and starts the relayer loop.
17
17
18
18
The relayer loops awaits finality events from the finality subscription of the chain handlers.
19
-
Whenever a finality event is received, the latest ibc events are queried using `query_latest_ibc_events`.
19
+
Whenever a finality event is received, the latest IBC events are queried using `query_latest_ibc_events`.
20
20
These events are then parsed into the appropriate outgoing IBC messages, and sent off to the counterparty chain.
21
-
22
-
The `query_ready_and_timed_out_packets` which queries a chain and
21
+
The `query_ready_and_timed_out_packets` queries a chain and
23
22
produces all packet messages that have passed the connection delay check.
24
-
It also returns timedout packet messages that have passed the connection delay check.
23
+
It also returns timed-out packet messages that have passed the connection delay check.
25
24
26
25
### Connection delay and Packet Timeout
27
26
28
27
The relayer needs to submit packets with a proof fetched at a height where the equivalent client consensus state on the
29
-
counterparty chain has satisfied the connection delay.
30
-
Since the relayer has no cache of the block heights at which packets events were emitted, it has to go through a more
31
-
rigorous process to identify when the connection delay has been satisfied for some arbitrary consensus height.
28
+
counterparty chain has satisfied the connection delay.
29
+
Since the relayer has no cache of the block heights at which packet events were emitted, it has to go through a more rigorous process to identify when the connection delay has been satisfied for some arbitrary consensus height.
32
30
The following pseudocode describes how connection delays and packet timeouts are handled:
33
31
34
32
```rust
@@ -144,15 +142,32 @@ if the estimate exceeds the latter then the ibc messages are split into smaller
144
142
these chunks are then submitted as individual transactions.
145
143
146
144
147
-
## CLI Interface
145
+
## Running the relayer
146
+
147
+
### How to build Hyperspace
148
148
149
-
The CLI interface can be used to start the relayer from a config file and also performing the IBC setup on both chains.
149
+
```
150
+
make build-release-hyperspace
151
+
```
152
+
153
+
The binary will leave in the root directory of `centauri` repository,
154
+
on:
155
+
```
156
+
./target/release/hyperspace
157
+
```
158
+
159
+
### Running Hyperspace - CLI Interface
160
+
161
+
The CLI interface can be used to start the relayer from a config file and also perform the IBC setup on both chains. It assumes that `hyperspace` was already built.
162
+
163
+
A template configuration file (which is needed to run the CLI) can be found
164
+
[here](./config.toml)
150
165
151
166
-[`relay`](/hyperspace/core/src/command.rs#L24)
152
-
This command accepts a path to a config file and spawns the relayer alongside a prometheus server for monitoring.
167
+
This command accepts a path to a config file and spawns the relayer alongside a Prometheus server for monitoring.
153
168
The config file must have all the parameters necessary for the chain clients to work correctly.
0 commit comments