Skip to content

Commit

Permalink
feat(gRPC): add connection info to node info (#1273)
Browse files Browse the repository at this point in the history
  • Loading branch information
ambersun1234 authored May 11, 2024
1 parent ae6898a commit 34f0b99
Show file tree
Hide file tree
Showing 17 changed files with 712 additions and 125 deletions.
42 changes: 42 additions & 0 deletions www/grpc/gen/dart/network.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ class GetNodeInfoResponse extends $pb.GeneratedMessage {
..pPS(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'servicesNames')
..pPS(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'addrs')
..pPS(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'protocols')
..a<$fixnum.Int64>(10, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'connections', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO)
..a<$fixnum.Int64>(11, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'inboundConnections', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO)
..a<$fixnum.Int64>(12, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'outboundConnections', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO)
..hasRequiredFields = false
;

Expand All @@ -225,6 +228,9 @@ class GetNodeInfoResponse extends $pb.GeneratedMessage {
$core.Iterable<$core.String>? servicesNames,
$core.Iterable<$core.String>? addrs,
$core.Iterable<$core.String>? protocols,
$fixnum.Int64? connections,
$fixnum.Int64? inboundConnections,
$fixnum.Int64? outboundConnections,
}) {
final _result = create();
if (moniker != null) {
Expand Down Expand Up @@ -254,6 +260,15 @@ class GetNodeInfoResponse extends $pb.GeneratedMessage {
if (protocols != null) {
_result.protocols.addAll(protocols);
}
if (connections != null) {
_result.connections = connections;
}
if (inboundConnections != null) {
_result.inboundConnections = inboundConnections;
}
if (outboundConnections != null) {
_result.outboundConnections = outboundConnections;
}
return _result;
}
factory GetNodeInfoResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
Expand Down Expand Up @@ -333,6 +348,33 @@ class GetNodeInfoResponse extends $pb.GeneratedMessage {

@$pb.TagNumber(9)
$core.List<$core.String> get protocols => $_getList(8);

@$pb.TagNumber(10)
$fixnum.Int64 get connections => $_getI64(9);
@$pb.TagNumber(10)
set connections($fixnum.Int64 v) { $_setInt64(9, v); }
@$pb.TagNumber(10)
$core.bool hasConnections() => $_has(9);
@$pb.TagNumber(10)
void clearConnections() => clearField(10);

@$pb.TagNumber(11)
$fixnum.Int64 get inboundConnections => $_getI64(10);
@$pb.TagNumber(11)
set inboundConnections($fixnum.Int64 v) { $_setInt64(10, v); }
@$pb.TagNumber(11)
$core.bool hasInboundConnections() => $_has(10);
@$pb.TagNumber(11)
void clearInboundConnections() => clearField(11);

@$pb.TagNumber(12)
$fixnum.Int64 get outboundConnections => $_getI64(11);
@$pb.TagNumber(12)
set outboundConnections($fixnum.Int64 v) { $_setInt64(11, v); }
@$pb.TagNumber(12)
$core.bool hasOutboundConnections() => $_has(11);
@$pb.TagNumber(12)
void clearOutboundConnections() => clearField(12);
}

class PeerInfo extends $pb.GeneratedMessage {
Expand Down
5 changes: 4 additions & 1 deletion www/grpc/gen/dart/network.pbjson.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,14 @@ const GetNodeInfoResponse$json = const {
const {'1': 'services_names', '3': 7, '4': 3, '5': 9, '10': 'servicesNames'},
const {'1': 'addrs', '3': 8, '4': 3, '5': 9, '10': 'addrs'},
const {'1': 'protocols', '3': 9, '4': 3, '5': 9, '10': 'protocols'},
const {'1': 'connections', '3': 10, '4': 1, '5': 4, '10': 'connections'},
const {'1': 'inbound_connections', '3': 11, '4': 1, '5': 4, '10': 'inboundConnections'},
const {'1': 'outbound_connections', '3': 12, '4': 1, '5': 4, '10': 'outboundConnections'},
],
};

/// Descriptor for `GetNodeInfoResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getNodeInfoResponseDescriptor = $convert.base64Decode('ChNHZXROb2RlSW5mb1Jlc3BvbnNlEhgKB21vbmlrZXIYASABKAlSB21vbmlrZXISFAoFYWdlbnQYAiABKAlSBWFnZW50EhcKB3BlZXJfaWQYAyABKAxSBnBlZXJJZBIdCgpzdGFydGVkX2F0GAQgASgEUglzdGFydGVkQXQSIgoMcmVhY2hhYmlsaXR5GAUgASgJUgxyZWFjaGFiaWxpdHkSGgoIc2VydmljZXMYBiADKAVSCHNlcnZpY2VzEiUKDnNlcnZpY2VzX25hbWVzGAcgAygJUg1zZXJ2aWNlc05hbWVzEhQKBWFkZHJzGAggAygJUgVhZGRycxIcCglwcm90b2NvbHMYCSADKAlSCXByb3RvY29scw==');
final $typed_data.Uint8List getNodeInfoResponseDescriptor = $convert.base64Decode('ChNHZXROb2RlSW5mb1Jlc3BvbnNlEhgKB21vbmlrZXIYASABKAlSB21vbmlrZXISFAoFYWdlbnQYAiABKAlSBWFnZW50EhcKB3BlZXJfaWQYAyABKAxSBnBlZXJJZBIdCgpzdGFydGVkX2F0GAQgASgEUglzdGFydGVkQXQSIgoMcmVhY2hhYmlsaXR5GAUgASgJUgxyZWFjaGFiaWxpdHkSGgoIc2VydmljZXMYBiADKAVSCHNlcnZpY2VzEiUKDnNlcnZpY2VzX25hbWVzGAcgAygJUg1zZXJ2aWNlc05hbWVzEhQKBWFkZHJzGAggAygJUgVhZGRycxIcCglwcm90b2NvbHMYCSADKAlSCXByb3RvY29scxIgCgtjb25uZWN0aW9ucxgKIAEoBFILY29ubmVjdGlvbnMSLwoTaW5ib3VuZF9jb25uZWN0aW9ucxgLIAEoBFISaW5ib3VuZENvbm5lY3Rpb25zEjEKFG91dGJvdW5kX2Nvbm5lY3Rpb25zGAwgASgEUhNvdXRib3VuZENvbm5lY3Rpb25z');
@$core.Deprecated('Use peerInfoDescriptor instead')
const PeerInfo$json = const {
'1': 'PeerInfo',
Expand Down
18 changes: 18 additions & 0 deletions www/grpc/gen/docs/grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2228,6 +2228,24 @@ GetNodeInfoResponse
<a href="#string">string</a>
</td>
<td>List of protocols supported by the node. </td>
</tr><tr>
<td class="fw-bold">connections</td>
<td>
<a href="#uint64">uint64</a>
</td>
<td>Number of connections </td>
</tr><tr>
<td class="fw-bold">inbound_connections</td>
<td>
<a href="#uint64">uint64</a>
</td>
<td>Number of inbound connections </td>
</tr><tr>
<td class="fw-bold">outbound_connections</td>
<td>
<a href="#uint64">uint64</a>
</td>
<td>Number of outbound connections </td>
</tr>
</tbody>
</table>
Expand Down
21 changes: 21 additions & 0 deletions www/grpc/gen/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2693,6 +2693,27 @@ <h3 id="pactus.GetNodeInfoResponse">GetNodeInfoResponse</h3>
<td><p>List of protocols supported by the node. </p></td>
</tr>

<tr>
<td>connections</td>
<td><a href="#uint64">uint64</a></td>
<td></td>
<td><p>Number of connections </p></td>
</tr>

<tr>
<td>inbound_connections</td>
<td><a href="#uint64">uint64</a></td>
<td></td>
<td><p>Number of inbound connections </p></td>
</tr>

<tr>
<td>outbound_connections</td>
<td><a href="#uint64">uint64</a></td>
<td></td>
<td><p>Number of outbound connections </p></td>
</tr>

</tbody>
</table>

Expand Down
3 changes: 3 additions & 0 deletions www/grpc/gen/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,9 @@ Response message containing information about a specific node in the network.
| services_names | [string](#string) | repeated | Names of services provided by the node. |
| addrs | [string](#string) | repeated | List of addresses associated with the node. |
| protocols | [string](#string) | repeated | List of protocols supported by the node. |
| connections | [uint64](#uint64) | | Number of connections |
| inbound_connections | [uint64](#uint64) | | Number of inbound connections |
| outbound_connections | [uint64](#uint64) | | Number of outbound connections |



Expand Down
3 changes: 3 additions & 0 deletions www/grpc/gen/docs/json-rpc.html
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,10 @@ <h3>Result</h3>
...
],
"agent": "str", // (string) Agent information of the node.
"connections": n, // (numeric) Number of connections
"inbound_connections": n, // (numeric) Number of inbound connections
"moniker": "str", // (string) Moniker of the node.
"outbound_connections": n, // (numeric) Number of outbound connections
"peer_id": "str", // (string) Peer ID of the node.
"protocols": [ // (json array) List of protocols supported by the node.
"str",
Expand Down
3 changes: 3 additions & 0 deletions www/grpc/gen/docs/json-rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,10 @@ pactus.network.get_node_info retrieves information about a specific node in the
...
],
"agent": "str", // (string) Agent information of the node.
"connections": n, // (numeric) Number of connections
"inbound_connections": n, // (numeric) Number of inbound connections
"moniker": "str", // (string) Moniker of the node.
"outbound_connections": n, // (numeric) Number of outbound connections
"peer_id": "str", // (string) Peer ID of the node.
"protocols": [ // (json array) List of protocols supported by the node.
"str",
Expand Down
Loading

0 comments on commit 34f0b99

Please sign in to comment.