Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DiscoveryInterval is how often we re-publish our mDNS records. DiscoveryInterval = time.Second // DiscoveryServiceTag is used in our mDNS advertisements to discover other chat peers. DiscoveryServiceTag = "bloxstaking.ssv" // MsgChanSize is the buffer size of the message channel MsgChanSize = 128 )
View Source
const (
// UserAgentKey is the key for storing to the user agent value
UserAgentKey = "user-agent"
)
Variables ¶
This section is empty.
Functions ¶
func TransformEnr ¶ added in v0.0.4
TransformEnr converts defaults enr value and convert it to slice
Types ¶
type Config ¶
type Config struct {
// yaml/env arguments
Enr string `yaml:"Enr" env:"ENR_KEY" env-description:"enr used in discovery" env-default:""`
DiscoveryType string `yaml:"DiscoveryType" env:"DISCOVERY_TYPE_KEY" env-description:"Method to use in discovery" env-default:"discv5"`
TCPPort int `yaml:"TcpPort" env:"TCP_PORT" env-default:"13000"`
UDPPort int `yaml:"UdpPort" env:"UDP_PORT" env-default:"12000"`
HostAddress string `yaml:"HostAddress" env:"HOST_ADDRESS" env-required:"true" 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:"5s"`
MaxBatchResponse uint64 `` /* 133-byte string literal not displayed */
PubSubTraceOut string `yaml:"PubSubTraceOut" env:"PUBSUB_TRACE_OUT" env-description:"File path to hold collected pubsub traces"`
ExporterPeerID string `` /* 152-byte string literal not displayed */
Fork forks.Fork
// objects / instances
HostID peer.ID
Topics map[string]*pubsub.Topic
BootnodesENRs []string
// NetworkPrivateKey is used for network identity
NetworkPrivateKey *ecdsa.PrivateKey
// OperatorPrivateKey is used for operator identity
OperatorPrivateKey *rsa.PrivateKey
// ReportLastMsg whether to report last msg metric
ReportLastMsg bool
}
Config - describe the config options for p2p network
type PeersIndex ¶ added in v0.1.2
PeersIndex is responsible for indexing peers information index data is not persisted at the moment
func NewPeersIndex ¶ added in v0.1.2
NewPeersIndex creates a new instance
type SyncStream ¶
type SyncStream struct {
// contains filtered or unexported fields
}
SyncStream is a wrapper struct for the core.Stream interface to match the network.SyncStream interface
func (*SyncStream) CloseWrite ¶
func (s *SyncStream) CloseWrite() error
CloseWrite closes write stream
func (*SyncStream) Read ¶
func (s *SyncStream) Read(p []byte) (n int, err error)
Read reads data to p
func (*SyncStream) RemotePeer ¶
func (s *SyncStream) RemotePeer() string
RemotePeer returns connected peer
Click to show internal directories.
Click to hide internal directories.