Skip to content

Commit

Permalink
refactor(examples): add rendezvous point fixed keypair
Browse files Browse the repository at this point in the history
Related: #4380.

Pull-Request: #4681.
  • Loading branch information
bgins authored Oct 17, 2023
1 parent 203e11c commit f582507
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/rendezvous/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ use std::time::Duration;
async fn main() -> Result<(), Box<dyn Error>> {
env_logger::init();

let mut swarm = libp2p::SwarmBuilder::with_new_identity()
// Results in PeerID 12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN which is
// used as the rendezvous point by the other peer examples.
let keypair = libp2p::identity::Keypair::ed25519_from_bytes([0; 32]).unwrap();

let mut swarm = libp2p::SwarmBuilder::with_existing_identity(keypair)
.with_tokio()
.with_tcp(
tcp::Config::default(),
Expand Down

0 comments on commit f582507

Please sign in to comment.