mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-05-19 15:10:34 -04:00
parent
d53c12d64e
commit
2633e8e6bf
4 changed files with 9 additions and 6 deletions
|
@ -46,8 +46,8 @@ pub mod transport {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
identity: &identity::Keypair,
|
identity: &identity::Keypair,
|
||||||
maybe_tor_client: Option<Arc<TorClient<TokioRustlsRuntime>>>,
|
maybe_tor_client: Option<Arc<TorClient<TokioRustlsRuntime>>>,
|
||||||
num_intro_points: u8,
|
|
||||||
register_hidden_service: bool,
|
register_hidden_service: bool,
|
||||||
|
num_intro_points: u8,
|
||||||
) -> Result<OnionTransportWithAddresses> {
|
) -> Result<OnionTransportWithAddresses> {
|
||||||
let (maybe_tor_transport, onion_addresses) = if let Some(tor_client) = maybe_tor_client {
|
let (maybe_tor_transport, onion_addresses) = if let Some(tor_client) = maybe_tor_client {
|
||||||
let mut tor_transport = libp2p_community_tor::TorTransport::from_client(
|
let mut tor_transport = libp2p_community_tor::TorTransport::from_client(
|
||||||
|
|
|
@ -165,7 +165,8 @@ pub async fn main() -> Result<()> {
|
||||||
namespace,
|
namespace,
|
||||||
&rendezvous_addrs,
|
&rendezvous_addrs,
|
||||||
tor_client,
|
tor_client,
|
||||||
config.tor,
|
config.tor.register_hidden_service,
|
||||||
|
config.tor.hidden_service_num_intro_points,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
for listen in config.network.listen.clone() {
|
for listen in config.network.listen.clone() {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use crate::asb::config::TorConf;
|
|
||||||
use crate::asb::{LatestRate, RendezvousNode};
|
use crate::asb::{LatestRate, RendezvousNode};
|
||||||
use crate::libp2p_ext::MultiAddrExt;
|
use crate::libp2p_ext::MultiAddrExt;
|
||||||
use crate::network::rendezvous::XmrBtcNamespace;
|
use crate::network::rendezvous::XmrBtcNamespace;
|
||||||
|
@ -25,7 +24,8 @@ pub fn asb<LR>(
|
||||||
namespace: XmrBtcNamespace,
|
namespace: XmrBtcNamespace,
|
||||||
rendezvous_addrs: &[Multiaddr],
|
rendezvous_addrs: &[Multiaddr],
|
||||||
maybe_tor_client: Option<Arc<TorClient<TokioRustlsRuntime>>>,
|
maybe_tor_client: Option<Arc<TorClient<TokioRustlsRuntime>>>,
|
||||||
tor_conf: TorConf,
|
register_hidden_service: bool,
|
||||||
|
num_intro_points: u8,
|
||||||
) -> Result<(Swarm<asb::Behaviour<LR>>, Vec<Multiaddr>)>
|
) -> Result<(Swarm<asb::Behaviour<LR>>, Vec<Multiaddr>)>
|
||||||
where
|
where
|
||||||
LR: LatestRate + Send + 'static + Debug + Clone,
|
LR: LatestRate + Send + 'static + Debug + Clone,
|
||||||
|
@ -56,8 +56,8 @@ where
|
||||||
let (transport, onion_addresses) = asb::transport::new(
|
let (transport, onion_addresses) = asb::transport::new(
|
||||||
&identity,
|
&identity,
|
||||||
maybe_tor_client,
|
maybe_tor_client,
|
||||||
tor_conf.hidden_service_num_intro_points,
|
register_hidden_service,
|
||||||
tor_conf.register_hidden_service,
|
num_intro_points,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let swarm = SwarmBuilder::with_existing_identity(identity)
|
let swarm = SwarmBuilder::with_existing_identity(identity)
|
||||||
|
|
|
@ -253,6 +253,8 @@ async fn start_alice(
|
||||||
XmrBtcNamespace::Testnet,
|
XmrBtcNamespace::Testnet,
|
||||||
&[],
|
&[],
|
||||||
None,
|
None,
|
||||||
|
false,
|
||||||
|
1,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
swarm.listen_on(listen_address).unwrap();
|
swarm.listen_on(listen_address).unwrap();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue