624: Remove rendezvous point default r=da-kami a=thomaseizinger



Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Daniel Karzel <daniel@comit.network>
pull/625/head
bors[bot] 3 years ago committed by GitHub
commit 9eb82cd0a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -94,13 +94,11 @@ FLAGS:
-V, --version Prints version information
OPTIONS:
--rendezvous-point <rendezvous-point> Address of the rendezvous point you want to use to discover ASBs [default: /dnsaddr/rendezvous.coblox.tech/p2p/12D3KooWQUt9DkNZxEn2R5ymJzWj15MpG6mTW84kyd8vDaRZi46o]
--rendezvous-point <rendezvous-point> Address of the rendezvous point you want to use to discover ASBs
--tor-socks5-port <tor-socks5-port> Your local Tor socks5 proxy port [default: 9050]
```
This command only takes optional parameters and can be run as-is:
Running `swap --testnet list-sellers` will give you something like:
Running `swap --testnet list-sellers --rendezvous-point /dnsaddr/rendezvous.coblox.tech/p2p/12D3KooWQUt9DkNZxEn2R5ymJzWj15MpG6mTW84kyd8vDaRZi46o` will give you something like:
```
Connected to rendezvous point, discovering nodes in 'xmr-btc-swap-testnet' namespace ...

@ -1,10 +1,21 @@
#!/bin/bash
# This is a utility script to showcase how the swap CLI can discover sellers and then trigger a swap using the discovered sellers
#
# 1st param: Path to the "swap" binary (aka the swap CLI)
# 2nd param: Multiaddress of the rendezvous node to be used for discovery
# 3rd param: Your Monero stagenet address where the XMR will be received
# 4th param: Your bech32 Bitcoin testnet address that will be used for any change output (e.g. refund scenario or when swapping an amount smaller than the transferred BTC)
#
# Example usage:
# discover_and_take.sh "PATH/TO/swap" "/dnsaddr/rendezvous.coblox.tech/p2p/12D3KooWQUt9DkNZxEn2R5ymJzWj15MpG6mTW84kyd8vDaRZi46o" "YOUR_XMR_STAGENET_ADDRESS" "YOUR_BECH32_BITCOIN_TESTNET_ADDRESS"
CLI_PATH=$1
YOUR_MONERO_ADDR=$2
YOUR_BITCOIN_ADDR=$3
RENDEZVOUS_POINT=$2
YOUR_MONERO_ADDR=$3
YOUR_BITCOIN_ADDR=$4
CLI_LIST_SELLERS="$CLI_PATH --testnet --json --debug list-sellers"
CLI_LIST_SELLERS="$CLI_PATH --testnet --json --debug list-sellers --rendezvous-point $RENDEZVOUS_POINT"
echo "Requesting sellers with command: $CLI_LIST_SELLERS"
echo

@ -1,6 +1,5 @@
use crate::env::{Mainnet, Testnet};
use crate::fs::{ensure_directory_exists, system_config_dir, system_data_dir};
use crate::network::rendezvous::DEFAULT_RENDEZVOUS_ADDRESS;
use crate::tor::{DEFAULT_CONTROL_PORT, DEFAULT_SOCKS5_PORT};
use anyhow::{bail, Context, Result};
use config::ConfigError;
@ -249,7 +248,7 @@ pub fn query_user_for_initial_config(testnet: bool) -> Result<Config> {
.map(|str| str.parse())
.collect::<Result<Vec<Multiaddr>, _>>()?;
let electrum_rpc_url: Url = Input::with_theme(&ColorfulTheme::default())
let electrum_rpc_url = Input::with_theme(&ColorfulTheme::default())
.with_prompt("Enter Electrum RPC URL or hit return to use default")
.default(defaults.electrum_rpc_url)
.interact_text()?;
@ -290,24 +289,22 @@ pub fn query_user_for_initial_config(testnet: bool) -> Result<Config> {
}
let ask_spread = Decimal::from_f64(ask_spread).context("Unable to parse spread")?;
let rendezvous_address = Input::with_theme(&ColorfulTheme::default())
let rendezvous_point = Input::<Multiaddr>::with_theme(&ColorfulTheme::default())
.with_prompt("Do you want to advertise your ASB instance with a rendezvous node? Enter an empty string if not.")
.default(DEFAULT_RENDEZVOUS_ADDRESS.to_string())
.allow_empty(true)
.interact_text()?;
let rendezvous_point = if rendezvous_address.is_empty() {
None
} else {
Some(Multiaddr::from_str(&rendezvous_address)?)
};
println!();
Ok(Config {
data: Data { dir: data_dir },
network: Network {
listen: listen_addresses,
rendezvous_point,
rendezvous_point: if rendezvous_point.is_empty() {
None
} else {
Some(rendezvous_point)
},
external_addresses: vec![],
},
bitcoin: Bitcoin {
@ -358,7 +355,7 @@ mod tests {
},
network: Network {
listen: vec![defaults.listen_address_tcp, defaults.listen_address_ws],
rendezvous_point: Some(DEFAULT_RENDEZVOUS_ADDRESS.parse().unwrap()),
rendezvous_point: None,
external_addresses: vec![],
},
@ -401,7 +398,7 @@ mod tests {
},
network: Network {
listen: vec![defaults.listen_address_tcp, defaults.listen_address_ws],
rendezvous_point: Some(DEFAULT_RENDEZVOUS_ADDRESS.parse().unwrap()),
rendezvous_point: None,
external_addresses: vec![],
},

@ -1,6 +1,6 @@
use crate::env::GetConfig;
use crate::fs::system_data_dir;
use crate::network::rendezvous::{XmrBtcNamespace, DEFAULT_RENDEZVOUS_ADDRESS};
use crate::network::rendezvous::XmrBtcNamespace;
use crate::{env, monero};
use anyhow::{Context, Result};
use bitcoin::AddressType;
@ -336,8 +336,7 @@ enum RawCommand {
ListSellers {
#[structopt(
long,
help = "Address of the rendezvous point you want to use to discover ASBs",
default_value = DEFAULT_RENDEZVOUS_ADDRESS
help = "Address of the rendezvous point you want to use to discover ASBs"
)]
rendezvous_point: Multiaddr,

@ -1,9 +1,6 @@
use libp2p::rendezvous::Namespace;
use std::fmt;
pub const DEFAULT_RENDEZVOUS_ADDRESS: &str =
"/dnsaddr/rendezvous.coblox.tech/p2p/12D3KooWQUt9DkNZxEn2R5ymJzWj15MpG6mTW84kyd8vDaRZi46o";
#[derive(Debug, PartialEq, Clone, Copy)]
pub enum XmrBtcNamespace {
Mainnet,

Loading…
Cancel
Save