I tried the examples for rust’s libp2p (rust-libp2p/examples at master · libp2p/rust-libp2p · GitHub), but all of them are working with 2 terminals locally.
I tried to set up an example where I have 2 servers with open ports so it should be possible to connect to each other, but I really don’t know where to get started to make the following happening:
- Create a peer ID on node 1
- Let node 2 dial to that peer ID and set up a p2p connection (using whatever works, hole punching, relay etc)
I tried to modify the example code of the chat with no luck, I only was able to talk to the IP address of the other node directly by means of
cargo run --example chat -- /ip4/<external ip>/tcp/4001.
I assume since it’s a p2p library with a DHT, that this ought to be possible. I’m just a little stuck in the docs and code that is available as of now. I hope this makes our intentions clear, thanks a lot in advance.