Versions in this module Expand all Collapse all v100 v100.2.4 Sep 4, 2024 v100.2.3 Sep 4, 2024 v100.2.2 Sep 4, 2024 v100.2.1 Sep 4, 2024 v100.2.0 Sep 4, 2024 v100.1.0 Sep 3, 2024 v100.0.4 Sep 3, 2024 v100.0.3 Sep 3, 2024 v100.0.2 Sep 3, 2024 v100.0.1 Sep 3, 2024 v100.0.0 Sep 3, 2024 Changes in this version + const EmptyNetAddress + const IDByteLength + const MetricsSubsystem + const TestHost + func AddPeerToSwitchPeerSet(sw *Switch, peer Peer) + func Connect2Switches(switches []*Switch, i, j int) + func ConnectStarSwitches(c int) func([]*Switch, int, int) + func FuzzConn(conn net.Conn) net.Conn + func FuzzConnAfter(conn net.Conn, d time.Duration) net.Conn + func FuzzConnAfterFromConfig(conn net.Conn, d time.Duration, config *config.FuzzConnConfig) net.Conn + func FuzzConnFromConfig(conn net.Conn, config *config.FuzzConnConfig) net.Conn + func IDAddressString(id ID, protocolHostPort string) string + func MConnConfig(cfg *config.P2PConfig) conn.MConnConfig + func MakePoWTarget(difficulty, targetBits uint) []byte + func MaxNodeInfoSize() int + func NetAddressesToProto(nas []*NetAddress) []tmp2p.NetAddress + func StartSwitches(switches []*Switch) error + type AddrBook interface + AddAddress func(addr *NetAddress, src *NetAddress) error + AddOurAddress func(addr *NetAddress) + AddPrivateIDs func(ids []string) + HasAddress func(addr *NetAddress) bool + MarkGood func(id ID) + OurAddress func(addr *NetAddress) bool + RemoveAddress func(addr *NetAddress) + Save func() + type AddrBookMock struct + Addrs map[string]struct{} + OurAddrs map[string]struct{} + PrivateAddrs map[string]struct{} + func (*AddrBookMock) MarkGood(ID) + func (*AddrBookMock) Save() + func (book *AddrBookMock) AddAddress(addr *NetAddress, _ *NetAddress) error + func (book *AddrBookMock) AddOurAddress(addr *NetAddress) + func (book *AddrBookMock) AddPrivateIDs(addrs []string) + func (book *AddrBookMock) HasAddress(addr *NetAddress) bool + func (book *AddrBookMock) OurAddress(addr *NetAddress) bool + func (book *AddrBookMock) RemoveAddress(addr *NetAddress) + type BaseReactor struct + Switch *Switch + func NewBaseReactor(name string, impl Reactor) *BaseReactor + func (*BaseReactor) AddPeer(Peer) + func (*BaseReactor) GetChannels() []*conn.ChannelDescriptor + func (*BaseReactor) InitPeer(peer Peer) Peer + func (*BaseReactor) Receive(Envelope) + func (*BaseReactor) RemovePeer(Peer, any) + func (br *BaseReactor) SetSwitch(sw *Switch) + type ChannelDescriptor = conn.ChannelDescriptor + type ConnFilterFunc func(ConnSet, net.Conn, []net.IP) error + func ConnDuplicateIPFilter() ConnFilterFunc + type ConnSet interface + Has func(conn net.Conn) bool + HasIP func(ip net.IP) bool + Remove func(conn net.Conn) + RemoveAddr func(addr net.Addr) + Set func(conn net.Conn, ip []net.IP) + func NewConnSet() ConnSet + type ConnectionStatus = conn.ConnectionStatus + type DefaultNodeInfo struct + Channels cmtbytes.HexBytes + DefaultNodeID ID + ListenAddr string + Moniker string + Network string + Other DefaultNodeInfoOther + ProtocolVersion ProtocolVersion + Version string + func DefaultNodeInfoFromToProto(pb *tmp2p.DefaultNodeInfo) (DefaultNodeInfo, error) + func (info DefaultNodeInfo) CompatibleWith(otherInfo NodeInfo) error + func (info DefaultNodeInfo) HasChannel(chID byte) bool + func (info DefaultNodeInfo) ID() ID + func (info DefaultNodeInfo) NetAddress() (*NetAddress, error) + func (info DefaultNodeInfo) ToProto() *tmp2p.DefaultNodeInfo + func (info DefaultNodeInfo) Validate() error + type DefaultNodeInfoOther struct + RPCAddress string + TxIndex string + type Envelope struct + ChannelID byte + Message proto.Message + Src Peer + type ErrCurrentlyDialingOrExistingAddress struct + Addr string + func (e ErrCurrentlyDialingOrExistingAddress) Error() string + type ErrFilterTimeout struct + func (ErrFilterTimeout) Error() string + type ErrNetAddressInvalid struct + Addr string + Err error + func (e ErrNetAddressInvalid) Error() string + type ErrNetAddressLookup struct + Addr string + Err error + func (e ErrNetAddressLookup) Error() string + type ErrNetAddressNoID struct + Addr string + func (e ErrNetAddressNoID) Error() string + type ErrPeerRemoval struct + func (ErrPeerRemoval) Error() string + type ErrRejected struct + func (e ErrRejected) Addr() NetAddress + func (e ErrRejected) Error() string + func (e ErrRejected) IsAuthFailure() bool + func (e ErrRejected) IsDuplicate() bool + func (e ErrRejected) IsFiltered() bool + func (e ErrRejected) IsIncompatible() bool + func (e ErrRejected) IsNodeInfoInvalid() bool + func (e ErrRejected) IsSelf() bool + type ErrSwitchAuthenticationFailure struct + Dialed *NetAddress + Got ID + func (e ErrSwitchAuthenticationFailure) Error() string + type ErrSwitchConnectToSelf struct + Addr *NetAddress + func (e ErrSwitchConnectToSelf) Error() string + type ErrSwitchDuplicatePeerID struct + ID ID + func (e ErrSwitchDuplicatePeerID) Error() string + type ErrSwitchDuplicatePeerIP struct + IP net.IP + func (e ErrSwitchDuplicatePeerIP) Error() string + type ErrTransportClosed struct + func (ErrTransportClosed) Error() string + type FuzzedConnection struct + func (fc *FuzzedConnection) Close() error + func (fc *FuzzedConnection) Config() *config.FuzzConnConfig + func (fc *FuzzedConnection) LocalAddr() net.Addr + func (fc *FuzzedConnection) Read(data []byte) (n int, err error) + func (fc *FuzzedConnection) RemoteAddr() net.Addr + func (fc *FuzzedConnection) SetDeadline(t time.Time) error + func (fc *FuzzedConnection) SetReadDeadline(t time.Time) error + func (fc *FuzzedConnection) SetWriteDeadline(t time.Time) error + func (fc *FuzzedConnection) Write(data []byte) (n int, err error) + type ID string + func PubKeyToID(pubKey crypto.PubKey) ID + type IPResolver interface + LookupIPAddr func(ctx context.Context, host string) ([]net.IPAddr, error) + type IPeerSet interface + Copy func() []Peer + ForEach func(peer func(Peer)) + Get func(key ID) Peer + Has func(key ID) bool + HasIP func(ip net.IP) bool + Random func() Peer + Size func() int + type Metrics struct + MessageReceiveBytesTotal metrics.Counter + MessageSendBytesTotal metrics.Counter + NumTxs metrics.Gauge + PeerPendingSendBytes metrics.Gauge + PeerReceiveBytesTotal metrics.Counter + PeerSendBytesTotal metrics.Counter + Peers metrics.Gauge + func NopMetrics() *Metrics + func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics + type MultiplexTransport struct + func NewMultiplexTransport(nodeInfo NodeInfo, nodeKey NodeKey, mConfig conn.MConnConfig) *MultiplexTransport + func (mt *MultiplexTransport) Accept(cfg peerConfig) (Peer, error) + func (mt *MultiplexTransport) AddChannel(chID byte) + func (mt *MultiplexTransport) Cleanup(p Peer) + func (mt *MultiplexTransport) Close() error + func (mt *MultiplexTransport) Dial(addr NetAddress, cfg peerConfig) (Peer, error) + func (mt *MultiplexTransport) Listen(addr NetAddress) error + func (mt *MultiplexTransport) NetAddress() NetAddress + type MultiplexTransportOption func(*MultiplexTransport) + func MultiplexTransportConnFilters(filters ...ConnFilterFunc) MultiplexTransportOption + func MultiplexTransportFilterTimeout(timeout time.Duration) MultiplexTransportOption + func MultiplexTransportMaxIncomingConnections(n int) MultiplexTransportOption + func MultiplexTransportResolver(resolver IPResolver) MultiplexTransportOption + type NetAddress struct + ID ID + IP net.IP + Port uint16 + func CreateRoutableAddr() (addr string, netAddr *NetAddress) + func NetAddressFromProto(pb tmp2p.NetAddress) (*NetAddress, error) + func NetAddressesFromProto(pbs []tmp2p.NetAddress) ([]*NetAddress, error) + func NewNetAddress(id ID, addr net.Addr) *NetAddress + func NewNetAddressIPPort(ip net.IP, port uint16) *NetAddress + func NewNetAddressString(addr string) (*NetAddress, error) + func NewNetAddressStrings(addrs []string) ([]*NetAddress, []error) + func (na *NetAddress) Dial() (net.Conn, error) + func (na *NetAddress) DialString() string + func (na *NetAddress) DialTimeout(timeout time.Duration) (net.Conn, error) + func (na *NetAddress) Equals(other any) bool + func (na *NetAddress) HasID() bool + func (na *NetAddress) Local() bool + func (na *NetAddress) OnionCatTor() bool + func (na *NetAddress) RFC1918() bool + func (na *NetAddress) RFC3849() bool + func (na *NetAddress) RFC3927() bool + func (na *NetAddress) RFC3964() bool + func (na *NetAddress) RFC4193() bool + func (na *NetAddress) RFC4380() bool + func (na *NetAddress) RFC4843() bool + func (na *NetAddress) RFC4862() bool + func (na *NetAddress) RFC6052() bool + func (na *NetAddress) RFC6145() bool + func (na *NetAddress) ReachabilityTo(o *NetAddress) int + func (na *NetAddress) Routable() bool + func (na *NetAddress) Same(other any) bool + func (na *NetAddress) String() string + func (na *NetAddress) ToProto() tmp2p.NetAddress + func (na *NetAddress) Valid() error + type NodeInfo interface + ID func() ID + type NodeKey struct + PrivKey crypto.PrivKey + func LoadNodeKey(filePath string) (*NodeKey, error) + func LoadOrGenNodeKey(filePath string) (*NodeKey, error) + func (nodeKey *NodeKey) ID() ID + func (nodeKey *NodeKey) PubKey() crypto.PubKey + func (nodeKey *NodeKey) SaveAs(filePath string) error + type Peer interface + CloseConn func() error + FlushStop func() + Get func(key string) any + GetRemovalFailed func() bool + ID func() ID + IsOutbound func() bool + IsPersistent func() bool + NodeInfo func() NodeInfo + RemoteAddr func() net.Addr + RemoteIP func() net.IP + Send func(e Envelope) bool + Set func(key string, value any) + SetRemovalFailed func() + SocketAddr func() *NetAddress + Status func() cmtconn.ConnectionStatus + TrySend func(e Envelope) bool + func CreateRandomPeer(outbound bool) Peer + type PeerFilterFunc func(IPeerSet, Peer) error + type PeerOption func(*peer) + func PeerMetrics(metrics *Metrics) PeerOption + type PeerSet struct + func NewPeerSet() *PeerSet + func (ps *PeerSet) Add(peer Peer) error + func (ps *PeerSet) Copy() []Peer + func (ps *PeerSet) ForEach(fn func(peer Peer)) + func (ps *PeerSet) Get(peerKey ID) Peer + func (ps *PeerSet) Has(peerKey ID) bool + func (ps *PeerSet) HasIP(peerIP net.IP) bool + func (ps *PeerSet) Random() Peer + func (ps *PeerSet) Remove(peer Peer) bool + func (ps *PeerSet) Size() int + type ProtocolVersion struct + App uint64 + Block uint64 + P2P uint64 + func NewProtocolVersion(p2p, block, app uint64) ProtocolVersion + type Reactor interface + AddPeer func(peer Peer) + GetChannels func() []*conn.ChannelDescriptor + InitPeer func(peer Peer) Peer + Receive func(e Envelope) + RemovePeer func(peer Peer, reason any) + SetSwitch func(sw *Switch) + type Switch struct + func MakeConnectedSwitches(cfg *config.P2PConfig, n int, initSwitch func(int, *Switch) *Switch, ...) []*Switch + func MakeSwitch(cfg *config.P2PConfig, i int, initSwitch func(int, *Switch) *Switch, ...) *Switch + func NewSwitch(cfg *config.P2PConfig, transport Transport, options ...SwitchOption) *Switch + func (sw *Switch) AddPersistentPeers(addrs []string) error + func (sw *Switch) AddPrivatePeerIDs(ids []string) error + func (sw *Switch) AddReactor(name string, reactor Reactor) Reactor + func (sw *Switch) AddUnconditionalPeerIDs(ids []string) error + func (sw *Switch) Broadcast(e Envelope) chan bool + func (sw *Switch) DialPeerWithAddress(addr *NetAddress) error + func (sw *Switch) DialPeersAsync(peers []string) error + func (sw *Switch) IsDialingOrExistingAddress(addr *NetAddress) bool + func (sw *Switch) IsPeerPersistent(na *NetAddress) bool + func (sw *Switch) IsPeerUnconditional(id ID) bool + func (sw *Switch) MarkPeerAsGood(peer Peer) + func (sw *Switch) MaxNumOutboundPeers() int + func (sw *Switch) NetAddress() *NetAddress + func (sw *Switch) NodeInfo() NodeInfo + func (sw *Switch) NumPeers() (outbound, inbound, dialing int) + func (sw *Switch) OnStart() error + func (sw *Switch) OnStop() + func (sw *Switch) Peers() IPeerSet + func (sw *Switch) Reactor(name string) Reactor + func (sw *Switch) Reactors() map[string]Reactor + func (sw *Switch) RemoveReactor(name string, reactor Reactor) + func (sw *Switch) SetAddrBook(addrBook AddrBook) + func (sw *Switch) SetNodeInfo(nodeInfo NodeInfo) + func (sw *Switch) SetNodeKey(nodeKey *NodeKey) + func (sw *Switch) StopPeerForError(peer Peer, reason any) + func (sw *Switch) StopPeerGracefully(peer Peer) + type SwitchOption func(*Switch) + func SwitchFilterTimeout(timeout time.Duration) SwitchOption + func SwitchPeerFilters(filters ...PeerFilterFunc) SwitchOption + func WithMetrics(metrics *Metrics) SwitchOption + type Transport interface + Accept func(config peerConfig) (Peer, error) + Cleanup func(peer Peer) + Dial func(addr NetAddress, config peerConfig) (Peer, error) + NetAddress func() NetAddress Other modules containing this package github.com/KYVENetwork/cometbft/v34 github.com/KYVENetwork/cometbft/v37 github.com/KYVENetwork/cometbft/v38