CLI: Relay Messages (#858)

* Relay Messages.

* Fix docs.

* Fix copyright date.

* copyright increment

Co-authored-by: adoerr <0xad@gmx.net>
This commit is contained in:
Tomasz Drwięga
2021-04-02 21:24:01 +02:00
committed by Bastian Köcher
parent 025a9cad59
commit da3f94d99f
4 changed files with 103 additions and 126 deletions
+2 -18
View File
@@ -27,6 +27,7 @@ use structopt::{clap::arg_enum, StructOpt};
mod init_bridge;
mod relay_headers;
mod relay_messages;
/// Parse relay CLI args.
pub fn parse_args() -> Command {
@@ -46,7 +47,7 @@ pub enum Command {
///
/// Ties up to `Messages` pallets on both chains and starts relaying messages.
/// Requires the header relay to be already running.
RelayMessages(RelayMessages),
RelayMessages(relay_messages::RelayMessages),
/// Initialize on-chain bridge pallet with current header data.
///
/// Sends initialization transaction to bootstrap the bridge with current finalized block data.
@@ -90,23 +91,6 @@ impl Command {
}
}
/// Start message relayer process.
#[derive(StructOpt)]
pub enum RelayMessages {
#[structopt(flatten)]
RialtoMillau(rialto_millau::RelayMessages),
}
impl RelayMessages {
/// Run the command.
pub async fn run(self) -> anyhow::Result<()> {
match self {
Self::RialtoMillau(arg) => arg.run().await?,
}
Ok(())
}
}
/// Send bridge message.
#[derive(StructOpt)]
pub enum SendMessage {