Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildMultiAddress ¶
BuildMultiAddress creates a multiaddr from the given peer data
func CheckAddress ¶
CheckAddress checks that some address is accessible and returns error accordingly
Types ¶
type Config ¶
type Config struct { StaticConfig // PrivateKey is used as the private key of the peer PrivateKey crypto.PrivKey // Reporter to use to collect metrics Reporter metrics.Reporter AddrsFactory bhost.AddrsFactory ConnectionGater connmgr.ConnectionGater ConnManager connmgr.ConnManager ResourceManager network.ResourceManager Peerstore peerstore.Peerstore Routing func(h host.Host) (routing.Routing, error) Pubsub *PubsubConfig }
Config contains both dynamic (libp2p components) and static information (json/yaml). TODO: complete more fields from https://pkg.go.dev/github.com/libp2p/go-libp2p/config#Config
func (*Config) Libp2pOptions ¶
Libp2pOptions returns a list of libp2p options for the given config
type PubsubConfig ¶
type PubsubConfig struct { // Config is the general configuration in the pubsub router level Config *PubsubTopicConfig `json:"config" yaml:"config"` // Topics is the configuration for topics Topics []PubsubTopicConfig `json:"topics" yaml:"topics"` }
func (*PubsubConfig) GetTopicCfg ¶
func (pcfg *PubsubConfig) GetTopicCfg(topicName string) []PubsubTopicConfig
GetTopicCfg returns all the relevant configs (including regex) for the given topic name
type PubsubTopicConfig ¶
type StaticConfig ¶
type StaticConfig struct { // ListenAddrs addrs to listen, this allows to specify also the transports that are supported ListenAddrs []string `json:"listenAddrs" yaml:"listenAddrs"` // Relayers are possible circuit relay end-points Relayers []string `json:"relayers,omitempty" yaml:"relayers,omitempty"` // DialTimeout is the timeout to use when dialing peers DialTimeout time.Duration `json:"dialTimeout,omitempty" yaml:"dialTimeout,omitempty"` // Muxers the supported muxers Muxers []string `json:"muxers,omitempty" yaml:"muxers,omitempty"` // Security the supported security protocols Security []string `json:"security,omitempty" yaml:"security,omitempty"` // NetworkSecret is a secret to use for a private network NetworkSecret string `json:"networkSecret,omitempty" yaml:"networkSecret,omitempty"` // DisablePing is a negative flag to turn off libp2p Ping DisablePing bool `json:"disablePing,omitempty" yaml:"disablePing,omitempty"` // EnableAutoRelay whether to enable auto relay EnableAutoRelay bool `json:"enableAutoRelay,omitempty" yaml:"enableAutoRelay,omitempty"` // MdnsServiceTag is the service tag used by mdns service. mdns is disabled if service tag is empty MdnsServiceTag string `json:"mdnsServiceTag,omitempty" yaml:"mdnsServiceTag,omitempty"` // UserAgent is the user agent string used by identify protocol UserAgent string `json:"userAgent,omitempty" yaml:"userAgent,omitempty"` }
StaticConfig contains static configuration for the p2p node
Click to show internal directories.
Click to hide internal directories.