From 87e1d013073e1183d4273499c58225e47de7e2d3 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 22:44:53 +0300 Subject: [PATCH] [#34] bootstrap: Tidy up the format Signed-off-by: Leonard Lyubich --- bootstrap/types.proto | 20 ++++++++++++++++---- proto-docs/bootstrap.md | 18 +++++++++--------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/bootstrap/types.proto b/bootstrap/types.proto index f0a4d8a..3b52adc 100644 --- a/bootstrap/types.proto +++ b/bootstrap/types.proto @@ -1,21 +1,33 @@ syntax = "proto3"; + package bootstrap; + option go_package = "github.com/nspcc-dev/neofs-api-go/bootstrap"; option csharp_namespace = "NeoFS.API.Bootstrap"; +// Groups the information about the NeoFS node. message NodeInfo { - // Address is a node [multi-address](https://github.com/multiformats/multiaddr) + // Carries network address of the NeoFS node. string Address = 1; - // PubKey is a compressed public key representation in bytes - bytes PubKey = 2; - // Options is set of node optional information, such as storage capacity, node location, price and etc + + // Carries public key of the NeoFS node in a binary format. + bytes PublicKey = 2; + + // Carries options of the NeoFS node. repeated string Options = 3; + // Represents the enumeration of various states of the NeoFS node. enum State { + // Undefined state. Unknown = 0; + + // Active state on the network. Online = 1; + + // Network unavailable state. Offline = 2; } + // Carries state of the NeoFS node. State state = 4; } diff --git a/proto-docs/bootstrap.md b/proto-docs/bootstrap.md index 3d1038e..39ac713 100644 --- a/proto-docs/bootstrap.md +++ b/proto-docs/bootstrap.md @@ -25,15 +25,15 @@ ### Message NodeInfo - +Groups the information about the NeoFS node. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Address | [string](#string) | | Address is a node [multi-address](https://github.com/multiformats/multiaddr) | -| PubKey | [bytes](#bytes) | | PubKey is a compressed public key representation in bytes | -| Options | [string](#string) | repeated | Options is set of node optional information, such as storage capacity, node location, price and etc | -| state | [NodeInfo.State](#bootstrap.NodeInfo.State) | | | +| Address | [string](#string) | | Carries network address of the NeoFS node. | +| PublicKey | [bytes](#bytes) | | Carries public key of the NeoFS node in a binary format. | +| Options | [string](#string) | repeated | Carries options of the NeoFS node. | +| state | [NodeInfo.State](#bootstrap.NodeInfo.State) | | Carries state of the NeoFS node. | @@ -41,13 +41,13 @@ ### NodeInfo.State - +Represents the enumeration of various states of the NeoFS node. | Name | Number | Description | | ---- | ------ | ----------- | -| Unknown | 0 | | -| Online | 1 | | -| Offline | 2 | | +| Unknown | 0 | Undefined state. | +| Online | 1 | Active state on the network. | +| Offline | 2 | Network unavailable state. |