Documentation ¶
Overview ¶
Package dht 基于libp2p实现p2p 插件
Index ¶
- func GenPrivPubkey() ([]byte, []byte, error)
- func GenPubkey(key string) (string, error)
- func New(mgr *p2p.Manager, subCfg []byte) p2p.IP2P
- type AddrBook
- func (a *AddrBook) AddrsInfo() []peer.AddrInfo
- func (a *AddrBook) GetPrivPubKey() (string, string)
- func (a *AddrBook) GetPrivkey() p2pcrypto.PrivKey
- func (a *AddrBook) SaveAddr(addrinfos []peer.AddrInfo) error
- func (a *AddrBook) SaveKey(priv, pub string)
- func (a *AddrBook) StoreHostID(id peer.ID, path string)
- type P2P
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenPrivPubkey ¶
GenPrivPubkey return key and pubkey in bytes
Types ¶
type AddrBook ¶
type AddrBook struct {
// contains filtered or unexported fields
}
AddrBook peer address manager
func NewAddrBook ¶
func (*AddrBook) GetPrivPubKey ¶
GetPrivPubKey return privkey and pubkey
func (*AddrBook) GetPrivkey ¶
Click to show internal directories.
Click to hide internal directories.