Documentation ¶
Index ¶
- func PingPing(id peer.ID) error
- type PeerEntityDHT
- func (this *PeerEntityDHT) Bootstrap() error
- func (this *PeerEntityDHT) Close() error
- func (this *PeerEntityDHT) Context() context.Context
- func (this *PeerEntityDHT) FindLocal(id peer.ID) peer.AddrInfo
- func (this *PeerEntityDHT) FindPeer(id peer.ID) (_ peer.AddrInfo, err error)
- func (this *PeerEntityDHT) FindProviders(c cid.Cid) ([]peer.AddrInfo, error)
- func (this *PeerEntityDHT) FindProvidersAsync(key cid.Cid, count int) <-chan peer.AddrInfo
- func (this *PeerEntityDHT) ForceRefresh() <-chan error
- func (this *PeerEntityDHT) GetClosestPeers(key string) ([]peer.ID, error)
- func (this *PeerEntityDHT) GetLocal(key string) (*recpb.Record, error)
- func (this *PeerEntityDHT) GetPublicKey(p peer.ID) (crypto.PubKey, error)
- func (this *PeerEntityDHT) GetRoutingTableDiversityStats() []peerdiversity.CplDiversityStats
- func (this *PeerEntityDHT) GetValue(key string, opts ...routing.Option) (_ []byte, err error)
- func (this *PeerEntityDHT) GetValues(key string, nvals int) (_ []dht.RecvdVal, err error)
- func (this *PeerEntityDHT) Host() host.Host
- func (this *PeerEntityDHT) Mode() dht.ModeOpt
- func (this *PeerEntityDHT) PeerID() peer.ID
- func (this *PeerEntityDHT) PeerKey() []byte
- func (this *PeerEntityDHT) Ping(p peer.ID) error
- func (this *PeerEntityDHT) Process() goprocess.Process
- func (this *PeerEntityDHT) Provide(key cid.Cid, brdcst bool) (err error)
- func (this *PeerEntityDHT) PutLocal(key string, value []byte, opts ...routing.Option) (err error)
- func (this *PeerEntityDHT) PutMyself() error
- func (this *PeerEntityDHT) PutValue(key string, value []byte, opts ...routing.Option) (err error)
- func (this *PeerEntityDHT) RefreshRoutingTable() <-chan error
- func (this *PeerEntityDHT) SearchValue(key string, opts ...routing.Option) (<-chan []byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PeerEntityDHT ¶
type PeerEntityDHT struct { DHT *dht.IpfsDHT RoutingTable *routingtable.PeerEntityRoutingTable }
* 提供了dht的服务的封装供外部调用,但是p2p的节点之间的消息不通过这里
var ChainAppDHT *PeerEntityDHT = &PeerEntityDHT{}
var PeerClientDHT *PeerEntityDHT = &PeerEntityDHT{}
var PeerEndpointDHT *PeerEntityDHT = &PeerEntityDHT{}
func (*PeerEntityDHT) Bootstrap ¶
func (this *PeerEntityDHT) Bootstrap() error
func (*PeerEntityDHT) Close ¶
func (this *PeerEntityDHT) Close() error
func (*PeerEntityDHT) Context ¶
func (this *PeerEntityDHT) Context() context.Context
func (*PeerEntityDHT) FindProviders ¶
func (this *PeerEntityDHT) FindProviders(c cid.Cid) ([]peer.AddrInfo, error)
func (*PeerEntityDHT) FindProvidersAsync ¶
func (this *PeerEntityDHT) FindProvidersAsync(key cid.Cid, count int) <-chan peer.AddrInfo
func (*PeerEntityDHT) ForceRefresh ¶
func (this *PeerEntityDHT) ForceRefresh() <-chan error
func (*PeerEntityDHT) GetClosestPeers ¶
func (this *PeerEntityDHT) GetClosestPeers(key string) ([]peer.ID, error)
func (*PeerEntityDHT) GetLocal ¶
func (this *PeerEntityDHT) GetLocal(key string) (*recpb.Record, error)
func (*PeerEntityDHT) GetPublicKey ¶
func (*PeerEntityDHT) GetRoutingTableDiversityStats ¶
func (this *PeerEntityDHT) GetRoutingTableDiversityStats() []peerdiversity.CplDiversityStats
func (*PeerEntityDHT) Host ¶
func (this *PeerEntityDHT) Host() host.Host
func (*PeerEntityDHT) Mode ¶
func (this *PeerEntityDHT) Mode() dht.ModeOpt
func (*PeerEntityDHT) PeerID ¶
func (this *PeerEntityDHT) PeerID() peer.ID
func (*PeerEntityDHT) PeerKey ¶
func (this *PeerEntityDHT) PeerKey() []byte
func (*PeerEntityDHT) Process ¶
func (this *PeerEntityDHT) Process() goprocess.Process
func (*PeerEntityDHT) Provide ¶
func (this *PeerEntityDHT) Provide(key cid.Cid, brdcst bool) (err error)
func (*PeerEntityDHT) PutMyself ¶
func (this *PeerEntityDHT) PutMyself() error
func (*PeerEntityDHT) RefreshRoutingTable ¶
func (this *PeerEntityDHT) RefreshRoutingTable() <-chan error
func (*PeerEntityDHT) SearchValue ¶
Click to show internal directories.
Click to hide internal directories.