Skip to content

Commit

Permalink
feat: add NetOwnPeer API
Browse files Browse the repository at this point in the history
  • Loading branch information
LinZexiao committed Aug 15, 2022
1 parent 003ff80 commit 664475c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions venus-shared/api/messager/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ type IMessager interface {
NetFindPeer(ctx context.Context, p peer.ID) (peer.AddrInfo, error) //perm:read
NetPeers(ctx context.Context) ([]peer.AddrInfo, error) //perm:read
NetConnect(ctx context.Context, pi peer.AddrInfo) error //perm:admin
NetOwnPeer(ctx context.Context) ([]peer.AddrInfo, error) //perm:read

api.Version
}
20 changes: 20 additions & 0 deletions venus-shared/api/messager/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* [MarkBadMessage](#MarkBadMessage)
* [NetConnect](#NetConnect)
* [NetFindPeer](#NetFindPeer)
* [NetOwnPeer](#NetOwnPeer)
* [NetPeers](#NetPeers)
* [PushMessage](#PushMessage)
* [PushMessageWithId](#PushMessageWithId)
Expand Down Expand Up @@ -1005,6 +1006,25 @@ Response:
}
```

### NetOwnPeer


Perms: read

Inputs: `[]`

Response:
```json
[
{
"ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"Addrs": [
"/ip4/52.36.61.156/tcp/1347/p2p/12D3KooWFETiESTf1v4PGUvtnxMAcEFMzLZbJGg4tjWfGEimYior"
]
}
]
```

### NetPeers


Expand Down
15 changes: 15 additions & 0 deletions venus-shared/api/messager/mock/mock_imessager.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions venus-shared/api/messager/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 664475c

Please sign in to comment.