Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Ctx context.Context // prod enr Bootnodes string `` /* 626-byte string literal not displayed */ Discovery string `yaml:"Discovery" env:"P2P_DISCOVERY" env-description:"Discovery system to use" env-default:"discv5"` TCPPort int `yaml:"TcpPort" env:"TCP_PORT" env-default:"13001" env-description:"TCP port for p2p transport"` UDPPort int `yaml:"UdpPort" env:"UDP_PORT" env-default:"12001" env-description:"UDP port for discovery"` HostAddress string `yaml:"HostAddress" env:"HOST_ADDRESS" env-description:"External ip node is exposed for discovery"` HostDNS string `yaml:"HostDNS" env:"HOST_DNS" env-description:"External DNS node is exposed for discovery"` RequestTimeout time.Duration `yaml:"RequestTimeout" env:"P2P_REQUEST_TIMEOUT" env-default:"7s"` MaxPeers int `yaml:"MaxPeers" env:"P2P_MAX_PEERS" env-default:"60" env-description:"Connected peers limit for connections"` TopicMaxPeers int `yaml:"TopicMaxPeers" env:"P2P_TOPIC_MAX_PEERS" env-default:"8" env-description:"Connected peers limit per pubsub topic"` // Subnets is a static bit list of subnets that this node will register upon start. Subnets string `yaml:"Subnets" env:"SUBNETS" env-description:"Hex string that represents the subnets that this node will join upon start"` // DiscoveryTrace is a flag to turn on/off discovery tracing in logs DiscoveryTrace bool `yaml:"DiscoveryTrace" env:"DISCOVERY_TRACE" env-description:"Flag to turn on/off discovery tracing in logs"` // NetworkID is the network of this node NetworkID string `yaml:"NetworkID" env:"NETWORK_ID" env-description:"Network ID is the network of this node"` // NetworkPrivateKey is used for network identity, MUST be injected NetworkPrivateKey *ecdsa.PrivateKey // OperatorPublicKey is used for operator identity, optional OperatorID string // Router propagate incoming network messages to the responsive components Router network.MessageRouter // UserAgent to use by libp2p identify protocol UserAgent string // ForkVersion to use ForkVersion forksprotocol.ForkVersion // Logger to used by network services Logger *zap.Logger DB *db.BoltDB GeoData *geodata.GeoIP2DB }
Config holds the configuration options for p2p network
func (*Config) Libp2pOptions ¶
Libp2pOptions creates options list for the libp2p host these are the most basic options required to start a network instance, other options and libp2p components can be configured on top
func (*Config) TransformBootnodes ¶
TransformBootnodes converts bootnodes string and convert it to slice
Click to show internal directories.
Click to hide internal directories.