Re: #1232: Add a FindPeer RPC method
- Given a Peer ID, this method looks into the DHT to find that peer's addresses - This commit also adds a CLI command to use this new RPC endpoint
This commit is contained in:
@@ -29,6 +29,7 @@ type CommonStruct struct {
|
||||
NetConnect func(context.Context, peer.AddrInfo) error `perm:"write"`
|
||||
NetAddrsListen func(context.Context) (peer.AddrInfo, error) `perm:"read"`
|
||||
NetDisconnect func(context.Context, peer.ID) error `perm:"write"`
|
||||
NetFindPeer func(context.Context, peer.ID) (peer.AddrInfo, error) `perm:"read"`
|
||||
|
||||
ID func(context.Context) (peer.ID, error) `perm:"read"`
|
||||
Version func(context.Context) (api.Version, error) `perm:"read"`
|
||||
@@ -197,6 +198,10 @@ func (c *CommonStruct) NetDisconnect(ctx context.Context, p peer.ID) error {
|
||||
return c.Internal.NetDisconnect(ctx, p)
|
||||
}
|
||||
|
||||
func (c *CommonStruct) NetFindPeer(ctx context.Context, p peer.ID) (peer.AddrInfo, error) {
|
||||
return c.Internal.NetFindPeer(ctx, p)
|
||||
}
|
||||
|
||||
// ID implements API.ID
|
||||
func (c *CommonStruct) ID(ctx context.Context) (peer.ID, error) {
|
||||
return c.Internal.ID(ctx)
|
||||
|
||||
Reference in New Issue
Block a user