Skip to content

Commit

Permalink
Caplin: Added QUIC and Nat port map (#12551)
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulio2002 authored Oct 31, 2024
1 parent 41aa7c5 commit fe26f87
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cl/sentinel/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fe26f87

Please sign in to comment.