From fe26f876c005dc8b6d35ce5983f660e2cdcd1963 Mon Sep 17 00:00:00 2001 From: Giulio rebuffo Date: Fri, 1 Nov 2024 00:27:39 +0100 Subject: [PATCH] Caplin: Added QUIC and Nat port map (#12551) --- cl/sentinel/config.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cl/sentinel/config.go b/cl/sentinel/config.go index 22af4b5bada..34d0ba80acb 100644 --- a/cl/sentinel/config.go +++ b/cl/sentinel/config.go @@ -21,6 +21,8 @@ import ( "fmt" "net" + libp2pquic "github.com/libp2p/go-libp2p/p2p/transport/quic" + "github.com/libp2p/go-libp2p" mplex "github.com/libp2p/go-libp2p-mplex" "github.com/libp2p/go-libp2p/core/crypto" @@ -107,16 +109,15 @@ func buildOptions(cfg *SentinelConfig, s *Sentinel) ([]libp2p.Option, error) { libp2p.ListenAddrs(listen), libp2p.UserAgent("erigon/caplin"), libp2p.Transport(tcp.NewTCPTransport), + libp2p.Transport(libp2pquic.NewTransport), libp2p.Muxer("/mplex/6.7.0", mplex.DefaultTransport), libp2p.DefaultMuxers, + libp2p.NATPortMap(), + libp2p.Ping(false), } options = append(options, libp2p.Security(noise.ID, noise.New), libp2p.DisableRelay()) - if cfg.EnableUPnP { - options = append(options, libp2p.NATPortMap()) // Allow to use UPnP - } - if cfg.HostAddress != "" { options = append(options, libp2p.AddrsFactory(func(addrs []multiaddr.Multiaddr) []multiaddr.Multiaddr { external, err := multiAddressBuilder(cfg.HostAddress, cfg.TCPPort)