Add system_peers RPC endpoint (#577)

* Add system_peers RPC endpoint

* Don't double-up on error logs
This commit is contained in:
Jaco Greeff
2019-01-12 09:22:27 +01:00
committed by GitHub
parent 9e38a25e90
commit 1f401d6791
6 changed files with 109 additions and 6 deletions
+8
View File
@@ -38,6 +38,13 @@ const health: RpcMethodOpt = {
type: 'Health'
};
const peers: RpcMethodOpt = {
description: 'Returns the currently connected peers',
params: [],
// @ts-ignore the Vec<> wrap is fine
type: 'Vec<PeerInfo>'
};
const section = 'system';
/**
@@ -52,6 +59,7 @@ export default {
chain: createMethod(section, 'chain', chain),
health: createMethod(section, 'health', health),
name: createMethod(section, 'name', name),
peers: createMethod(section, 'peers', peers),
properties: createMethod(section, 'properties', properties),
version: createMethod(section, 'version', version)
}