Save Alice's peer-id in the db for Bob

This allows loading the seller-peer-id from the database upon resuming a swap.
Thus, the parameters `--seller-peer-id` is removed for the `resume` command.
Other than the peer-id the multi address of a seller can change and thus is
still a parameter. This parameter might become optional once we add DHT support.
This commit is contained in:
Daniel Karzel 2021-03-30 15:40:59 +11:00 committed by Thomas Eizinger
parent bc442bcad3
commit d90496931b
No known key found for this signature in database
GPG key ID: 651AC83A6C6C8B96
4 changed files with 116 additions and 26 deletions

View file

@ -37,8 +37,15 @@ pub struct Arguments {
pub enum Command {
/// Start a XMR for BTC swap
BuyXmr {
#[structopt(
long = "seller-peer-id",
default_value = DEFAULT_ALICE_PEER_ID,
help = "The peer id of a specific swap partner can be optionally provided"
)]
alice_peer_id: PeerId,
#[structopt(flatten)]
connect_params: AliceConnectParams,
alice_multi_addr: AliceMultiaddress,
#[structopt(long = "electrum-rpc",
help = "Provide the Bitcoin Electrum RPC URL",
@ -60,7 +67,7 @@ pub enum Command {
swap_id: Uuid,
#[structopt(flatten)]
connect_params: AliceConnectParams,
alice_multi_addr: AliceMultiaddress,
#[structopt(long = "electrum-rpc",
help = "Provide the Bitcoin Electrum RPC URL",
@ -108,14 +115,7 @@ pub enum Command {
}
#[derive(structopt::StructOpt, Debug)]
pub struct AliceConnectParams {
#[structopt(
long = "seller-peer-id",
default_value = DEFAULT_ALICE_PEER_ID,
help = "The peer id of a specific swap partner can be optionally provided"
)]
pub peer_id: PeerId,
pub struct AliceMultiaddress {
#[structopt(
long = "seller-addr",
default_value = DEFAULT_ALICE_MULTIADDR,