package config
import "github.com/libp2p/go-libp2p/config"
Index ¶
- func PrivKeyToStatelessResetKey(key crypto.PrivKey) (quic.StatelessResetKey, error)
- func PrivKeyToTokenGeneratorKey(key crypto.PrivKey) (quic.TokenGeneratorKey, error)
- type AddrsFactory
- type AutoNATConfig
- type Config
- type NATManagerC
- type Option
- type RoutingC
- type Security
Functions ¶
func PrivKeyToStatelessResetKey ¶
func PrivKeyToTokenGeneratorKey ¶
Types ¶
type AddrsFactory ¶
type AddrsFactory = bhost.AddrsFactory
AddrsFactory is a function that takes a set of multiaddrs we're listening on and returns the set of multiaddrs we should advertise to the network.
type AutoNATConfig ¶
type AutoNATConfig struct { ForceReachability *network.Reachability EnableService bool ThrottleGlobalLimit int ThrottlePeerLimit int ThrottleInterval time.Duration }
AutoNATConfig defines the AutoNAT behavior for the libp2p host.
type Config ¶
type Config struct { // UserAgent is the identifier this node will send to other peers when // identifying itself, e.g. via the identify protocol. // // Set it via the UserAgent option function. UserAgent string // ProtocolVersion is the protocol version that identifies the family // of protocols used by the peer in the Identify protocol. It is set // using the [ProtocolVersion] option. ProtocolVersion string PeerKey crypto.PrivKey QUICReuse []fx.Option Transports []fx.Option Muxers []tptu.StreamMuxer SecurityTransports []Security Insecure bool PSK pnet.PSK DialTimeout time.Duration RelayCustom bool Relay bool // should the relay transport be used EnableRelayService bool // should we run a circuitv2 relay (if publicly reachable) RelayServiceOpts []relayv2.Option ListenAddrs []ma.Multiaddr AddrsFactory bhost.AddrsFactory ConnectionGater connmgr.ConnectionGater ConnManager connmgr.ConnManager ResourceManager network.ResourceManager NATManager NATManagerC Peerstore peerstore.Peerstore Reporter metrics.Reporter MultiaddrResolver network.MultiaddrDNSResolver DisablePing bool Routing RoutingC EnableAutoRelay bool AutoRelayOpts []autorelay.Option AutoNATConfig EnableHolePunching bool HolePunchingOptions []holepunch.Option DisableMetrics bool PrometheusRegisterer prometheus.Registerer DialRanker network.DialRanker SwarmOpts []swarm.Option DisableIdentifyAddressDiscovery bool EnableAutoNATv2 bool UDPBlackHoleSuccessCounter *swarm.BlackHoleSuccessCounter CustomUDPBlackHoleSuccessCounter bool IPv6BlackHoleSuccessCounter *swarm.BlackHoleSuccessCounter CustomIPv6BlackHoleSuccessCounter bool UserFxOptions []fx.Option bool }
Config describes a set of settings for a libp2p node
This is *not* a stable interface. Use the options defined in the root package.
func (*Config) Apply ¶
Apply applies the given options to the config, returning the first error encountered (if any).
func (*Config) NewNode ¶
NewNode constructs a new libp2p Host from the Config.
This function consumes the config. Do not reuse it (really!).
type NATManagerC ¶
type NATManagerC func(network.Network) bhost.NATManager
NATManagerC is a NATManager constructor.
type Option ¶
Option is a libp2p config option that can be given to the libp2p constructor (`libp2p.New`).
type RoutingC ¶
type RoutingC func(host.Host) (routing.PeerRouting, error)
type Security ¶
Source Files ¶
config.go host.go log.go quic.go
- Version
- v0.42.0 (latest)
- Published
- Jun 18, 2025
- Platform
- linux/amd64
- Imports
- 51 packages
- Last checked
- 1 month ago –
Tools for package owners.