Replace the roles on the CLI by swap direction (buy-/sell-xmr)

The user should not be exposed to the cryptographic roles, thus we opted to remove them from the CLI.
We opted for using buy-xmr and sell-xmr for indicating the swap direction.
Eventually we could try to imply the role from currency params of send and receive.
This makes the CLI impl more complex though, because we have to cater for the allowed combinations.
It can be done in a later iteration.
This commit is contained in:
Daniel Karzel 2020-12-10 18:06:56 +11:00
parent e04db656e6
commit e377779200
2 changed files with 6 additions and 6 deletions

View File

@ -52,7 +52,7 @@ async fn main() -> Result<()> {
let rng = &mut OsRng;
match opt {
Options::Alice {
Options::SellXmr {
bitcoind_url,
bitcoin_wallet_name,
monero_wallet_rpc_url,
@ -61,7 +61,7 @@ async fn main() -> Result<()> {
send_monero,
receive_bitcoin,
} => {
info!("running swap node as Alice ...");
info!("running swap node as Alice for selling XMR ...");
let behaviour = alice::Behaviour::default();
let alice_peer_id = behaviour.peer_id().clone();
@ -142,7 +142,7 @@ async fn main() -> Result<()> {
)
.await?;
}
Options::Bob {
Options::BuyXmr {
alice_addr,
alice_peer_id,
bitcoind_url,
@ -152,7 +152,7 @@ async fn main() -> Result<()> {
send_bitcoin,
receive_monero,
} => {
info!("running swap node as Bob ...");
info!("running swap node as Bob for buying XMR ...");
let behaviour = bob::Behaviour::default();
let local_key_pair = behaviour.identity();

View File

@ -6,7 +6,7 @@ use uuid::Uuid;
#[derive(structopt::StructOpt, Debug)]
#[structopt(name = "xmr-btc-swap", about = "Trustless XMR BTC swaps")]
pub enum Options {
Alice {
SellXmr {
#[structopt(
short = "b",
long = "bitcoind",
@ -40,7 +40,7 @@ pub enum Options {
#[structopt(short = "r", long = "receive-sats", parse(try_from_str = parse_sats))]
receive_bitcoin: bitcoin::Amount,
},
Bob {
BuyXmr {
#[structopt(short = "a", long = "alice-addr")]
alice_addr: Multiaddr,