mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-12-25 15:39:25 -05:00
Print peer ID on debog when starting CLI
In order to add more context to the debug logs we print Bob's peer ID. This allows identifying peer related logs on the ASB.
This commit is contained in:
parent
9e82e7b116
commit
0f11ab051e
@ -174,6 +174,8 @@ async fn main() -> Result<()> {
|
|||||||
|
|
||||||
let alice_peer_id = db.get_peer_id(swap_id)?;
|
let alice_peer_id = db.get_peer_id(swap_id)?;
|
||||||
let mut swarm = swarm::bob(&seed, alice_peer_id)?;
|
let mut swarm = swarm::bob(&seed, alice_peer_id)?;
|
||||||
|
let bob_peer_id = swarm.local_peer_id();
|
||||||
|
tracing::debug!("Our peer-id: {}", bob_peer_id);
|
||||||
swarm
|
swarm
|
||||||
.behaviour_mut()
|
.behaviour_mut()
|
||||||
.add_address(alice_peer_id, alice_multiaddr);
|
.add_address(alice_peer_id, alice_multiaddr);
|
||||||
|
@ -19,8 +19,10 @@ where
|
|||||||
{
|
{
|
||||||
let identity = seed.derive_libp2p_identity();
|
let identity = seed.derive_libp2p_identity();
|
||||||
let transport = transport::build(&identity)?;
|
let transport = transport::build(&identity)?;
|
||||||
|
let peer_id = identity.public().into_peer_id();
|
||||||
|
tracing::debug!("Our peer-id: {}", peer_id);
|
||||||
|
|
||||||
let swarm = SwarmBuilder::new(transport, behaviour, identity.public().into_peer_id())
|
let swarm = SwarmBuilder::new(transport, behaviour, peer_id)
|
||||||
.executor(Box::new(|f| {
|
.executor(Box::new(|f| {
|
||||||
tokio::spawn(f);
|
tokio::spawn(f);
|
||||||
}))
|
}))
|
||||||
|
Loading…
Reference in New Issue
Block a user