Chat Application using Libp2p: Talking from a peer on MOON with a peer on EARTH using Libp2p

In this tutorial, we will build an InterPlanatery Chat Application in which we will setup 2 libp2p peers(Moon peer and Earth peer) and give them the power to chat.

Check out the full tutorial here:

Here is a short demo:

hello-libp2p-js

1 Like

Nice Tutorial ! I would like to expand that moon earth example to dial an other peer in the same network. Is there an extension to use UPnP ?

Thanks !

1 Like

Glad that you liked the tut.
About the UPnP, here are some details: https://github.com/libp2p/go-libp2p/issues/375

1 Like

Thank you for your reply, I actually find the discussion even more confusing. Is there any way of connecting two peers without a relay and if so, is there any code that shows how to do it?

Thanks !

1 Like

Are you using UPnP to go around the problem of Nat Traversal?
I mean is there any specific reason that you want to use UPnP, or do you just want to try it out?

1 Like

I wanted to test different scenarios, to try out how well the NAT traversal works.

  1. Connect two peers behind same NAT with libp2p
  2. Connect two peers behind different NATs (possible with UPnP ?!)
  3. Connect peers behind multiple NATs (relaying over relaying nodes)

I personally find it challenging to understand how this can be done with libp2p because there are no examples of those “real-world” challenges. The chat tutorial only takes two processes and lets them communicate with each other without using any NAT.

Maybe we can work on a branch to show a simple chat, that implements all those NAT traversal examples in JS.

1 Like

Sure.
Can you send me your email or Github handle? I will add you to the SimpleAsWater Org and we can take it forward from there.