I am building a service where users from home (aka behind NATs) need to establish a direct p2p connection to another peers behind a NAT (also @ home).
Is it possible to leverage these NAT traversal methods mentioned here (NAT Traversal :: libp2p Documentation)?
Upnp, STUN, hole punching.
The only ping I was able to succeed was through relay nodes but never directly from peer to peer.
Are direct trans-NAT p2p connections currently supported in libp2p?
Right now I am using Kad DHT and bootstrap servers for peerdiscovery, is this smart?
You can follow the NAT traversal effort across implementations here NAT traversal tracking issue · Issue #312 · libp2p/specs · GitHub.
Long story short. Go-libp2p has most NAT hole punching capabilities. Rust-libp2p is catching up (NAT traversal · Issue #2052 · libp2p/rust-libp2p · GitHub) and most other implementations are still a bit behind.
Right now I am using Kad DHT and bootstrap servers for peerdiscovery, is this smart?
Depends on your use case. In case all of your nodes are behind NATs you might have a chicken-and-egg problem as none of them can serve as public relays.