-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rpc): add GetNodeInfo call (#570)
This creates a new rpc call named `GetNodeInfo` which is designed to retrieve information about a particular node. Currently the only information returned is the node's reputation score. Closes #529.
- Loading branch information
1 parent
7286897
commit 1a038a2
Showing
13 changed files
with
589 additions
and
22 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Arguments } from 'yargs'; | ||
import { callback, loadXudClient } from '../command'; | ||
import { GetNodeInfoRequest } from '../../proto/xudrpc_pb'; | ||
|
||
export const command = 'getnodeinfo <node_pub_key>'; | ||
|
||
export const describe = 'get general information about a node'; | ||
|
||
export const builder = { | ||
node_pub_key: { | ||
type: 'string', | ||
description: 'nodePubKey of node to get reputation', | ||
}, | ||
}; | ||
|
||
export const handler = (argv: Arguments) => { | ||
const request = new GetNodeInfoRequest(); | ||
request.setNodePubKey(argv.node_pub_key); | ||
loadXudClient(argv).getNodeInfo(request, callback); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.