Documentation ¶
Index ¶
- func Bootstrap() error
- func FindPeers(routingDiscovery *discovery.RoutingDiscovery)
- func GetFoundPeer(peerChan chan peer.AddrInfo) peer.AddrInfo
- func GetPeerInfos() []*peer.AddrInfo
- func NewPeerEndpointDHT(options []dht2.Option) *dht.PeerEntityDHT
- func PeerAdded(id peer.ID)
- func PeerRemoved(id peer.ID)
- func Start()
- type MonitorConnMgr
- type OpenPGPPrivateKey
- func (this *OpenPGPPrivateKey) Bytes() ([]byte, error)
- func (this *OpenPGPPrivateKey) Equals(key crypto.Key) bool
- func (this *OpenPGPPrivateKey) GetPublic() crypto.PubKey
- func (this *OpenPGPPrivateKey) Raw() ([]byte, error)
- func (this *OpenPGPPrivateKey) Sign(plaintext []byte) ([]byte, error)
- func (this *OpenPGPPrivateKey) Type() pb.KeyType
- type OpenPGPPublicKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bootstrap ¶
func Bootstrap() error
* 后台线程,检查在数据库中是否存在,如果不存在,连接,寻找节点,加入dht 如果连接不上,调度连接根据配置的启动节点进行刷新
func FindPeers ¶
func FindPeers(routingDiscovery *discovery.RoutingDiscovery)
func GetPeerInfos ¶
func NewPeerEndpointDHT ¶
func NewPeerEndpointDHT(options []dht2.Option) *dht.PeerEntityDHT
* 为了节点发现启动DHT
func PeerRemoved ¶
Types ¶
type MonitorConnMgr ¶
type MonitorConnMgr struct {
*connmgr.BasicConnMgr
}
func NewConnManager ¶
func NewConnManager(basicConnMgr *connmgr.BasicConnMgr) *MonitorConnMgr
func (*MonitorConnMgr) Notifee ¶
func (cm *MonitorConnMgr) Notifee() network.Notifiee
Notifee returns a sink through which Notifiers can inform the BasicConnMgr when events occur. Currently, the notifee only reacts upon connection events {Connected, Disconnected}.
type OpenPGPPrivateKey ¶
type OpenPGPPrivateKey struct { PrivateKey *openpgpcrypto.Key KeyType pb.KeyType }
func (*OpenPGPPrivateKey) Bytes ¶
func (this *OpenPGPPrivateKey) Bytes() ([]byte, error)
Bytes returns a serialized, storeable representation of this key DEPRECATED in favor of Marshal / Unmarshal
func (*OpenPGPPrivateKey) Equals ¶
func (this *OpenPGPPrivateKey) Equals(key crypto.Key) bool
Equals checks whether two PubKeys are the same
func (*OpenPGPPrivateKey) GetPublic ¶
func (this *OpenPGPPrivateKey) GetPublic() crypto.PubKey
Return a public key paired with this private key
func (*OpenPGPPrivateKey) Raw ¶
func (this *OpenPGPPrivateKey) Raw() ([]byte, error)
Raw returns the raw bytes of the key (not wrapped in the libp2p-crypto protobuf).
This function is the inverse of {Priv,Pub}KeyUnmarshaler.
func (*OpenPGPPrivateKey) Sign ¶
func (this *OpenPGPPrivateKey) Sign(plaintext []byte) ([]byte, error)
PrivateKey Cryptographically sign the given bytes
func (*OpenPGPPrivateKey) Type ¶
func (this *OpenPGPPrivateKey) Type() pb.KeyType
Type returns the protobof key type.
type OpenPGPPublicKey ¶
type OpenPGPPublicKey struct { PublicKey *openpgpcrypto.Key KeyType pb.KeyType }
func (*OpenPGPPublicKey) Bytes ¶
func (this *OpenPGPPublicKey) Bytes() ([]byte, error)
Bytes returns a serialized, storeable representation of this key DEPRECATED in favor of Marshal / Unmarshal
func (*OpenPGPPublicKey) Equals ¶
func (this *OpenPGPPublicKey) Equals(key crypto.Key) bool
Equals checks whether two PubKeys are the same
func (*OpenPGPPublicKey) Raw ¶
func (this *OpenPGPPublicKey) Raw() ([]byte, error)
Raw returns the raw bytes of the key (not wrapped in the libp2p-crypto protobuf).
This function is the inverse of {Priv,Pub}KeyUnmarshaler.
func (*OpenPGPPublicKey) Type ¶
func (this *OpenPGPPublicKey) Type() pb.KeyType
Type returns the protobof key type.