Documentation ¶
Index ¶
- Constants
- func ConvertPeers(peers []string) map[string]*peer.AddrInfo
- type Discovery
- func (d *Discovery) CloseFindLANPeers()
- func (d *Discovery) FindLANPeers(host host.Host, serviceTag string) (<-chan peer.AddrInfo, error)
- func (d *Discovery) FindLocalPeer(pid peer.ID) peer.AddrInfo
- func (d *Discovery) FindLocalPeers(pids []peer.ID) []peer.AddrInfo
- func (d *Discovery) FindNearestPeers(pid peer.ID, count int) []peer.ID
- func (d *Discovery) FindPeers(RendezvousString string) (<-chan peer.AddrInfo, error)
- func (d *Discovery) FindPeersConnectedToPeer(pid peer.ID) (<-chan *peer.AddrInfo, error)
- func (d *Discovery) FindSpecialPeer(pid peer.ID) (*peer.AddrInfo, error)
- func (d *Discovery) Remove(pid peer.ID)
- func (d *Discovery) RoutingTableSize() int
- func (d *Discovery) RoutingTale() []peer.ID
- func (d *Discovery) UPdate(pid peer.ID) error
Constants ¶
View Source
const DhtProtoID = "/ipfs/kad/%s/1.0.0/%d"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Discovery ¶
type Discovery struct {
// contains filtered or unexported fields
}
func InitDhtDiscovery ¶
func InitDhtDiscovery(host host.Host, peersInfo []peer.AddrInfo, chainCfg *types.Chain33Config, subCfg *p2pty.P2PSubConfig) *Discovery
func (*Discovery) CloseFindLANPeers ¶
func (d *Discovery) CloseFindLANPeers()
func (*Discovery) FindLANPeers ¶
查找局域网内的其他节点
func (*Discovery) FindLocalPeer ¶
根据pid 查找当前DHT内部的peer信息
func (*Discovery) FindLocalPeers ¶
func (*Discovery) FindNearestPeers ¶
func (*Discovery) FindPeersConnectedToPeer ¶
func (*Discovery) FindSpecialPeer ¶
根据指定的peerID ,查找指定的peer,
Click to show internal directories.
Click to hide internal directories.