dht

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2021 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PingPing

func PingPing(id peer.ID) error

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) FindLocal

func (this *PeerEntityDHT) FindLocal(id peer.ID) peer.AddrInfo

func (*PeerEntityDHT) FindPeer

func (this *PeerEntityDHT) FindPeer(id peer.ID) (_ peer.AddrInfo, err error)

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 (this *PeerEntityDHT) GetPublicKey(p peer.ID) (crypto.PubKey, error)

func (*PeerEntityDHT) GetRoutingTableDiversityStats

func (this *PeerEntityDHT) GetRoutingTableDiversityStats() []peerdiversity.CplDiversityStats

func (*PeerEntityDHT) GetValue

func (this *PeerEntityDHT) GetValue(key string, opts ...routing.Option) (_ []byte, err error)

func (*PeerEntityDHT) GetValues

func (this *PeerEntityDHT) GetValues(key string, nvals int) (_ []dht.RecvdVal, err error)

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) Ping

func (this *PeerEntityDHT) Ping(p peer.ID) error

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) PutLocal

func (this *PeerEntityDHT) PutLocal(key string, value []byte, opts ...routing.Option) (err error)

func (*PeerEntityDHT) PutMyself

func (this *PeerEntityDHT) PutMyself() error

func (*PeerEntityDHT) PutValue

func (this *PeerEntityDHT) PutValue(key string, value []byte, opts ...routing.Option) (err error)

func (*PeerEntityDHT) RefreshRoutingTable

func (this *PeerEntityDHT) RefreshRoutingTable() <-chan error

func (*PeerEntityDHT) SearchValue

func (this *PeerEntityDHT) SearchValue(key string, opts ...routing.Option) (<-chan []byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL