Documentation
¶
Index ¶
- type AddrList
- type DHT
- func (d *DHT) FindClosePeers(ll log.StandardLogger, onlyStaticRelays bool, static ...string) func(ctx context.Context, numPeers int) <-chan peer.AddrInfo
- func (d *DHT) Option(ctx context.Context) func(c *libp2p.Config) error
- func (d *DHT) Rendezvous() string
- func (d *DHT) Run(c log.StandardLogger, ctx context.Context, host host.Host) error
- type MDNS
- type Ring
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DHT ¶
type DHT struct {
OTPKey string // OTP密钥
OTPInterval int // OTP间隔
KeyLength int // 密钥长度
RendezvousString string // 会合点字符串
BootstrapPeers AddrList // 引导节点列表
RefreshDiscoveryTime time.Duration // 刷新发现时间
*dht.IpfsDHT // DHT实例
// contains filtered or unexported fields
}
DHT DHT发现服务结构体
func (*DHT) FindClosePeers ¶
func (d *DHT) FindClosePeers(ll log.StandardLogger, onlyStaticRelays bool, static ...string) func(ctx context.Context, numPeers int) <-chan peer.AddrInfo
FindClosePeers 查找附近的对等节点 参数 ll 为日志记录器,onlyStaticRelays 为是否仅使用静态中继,static 为静态中继列表
Click to show internal directories.
Click to hide internal directories.