From 84ac6f55a3be265db8d8cccb709f5a328f4ab401 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Wed, 20 Nov 2019 19:21:45 +0300 Subject: [PATCH] docs: add bootstrap proto documentation --- bootstrap/service.proto | 9 +++++++-- bootstrap/types.proto | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bootstrap/service.proto b/bootstrap/service.proto index 3c9dcedc..a0f82dca 100644 --- a/bootstrap/service.proto +++ b/bootstrap/service.proto @@ -7,14 +7,19 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.stable_marshaler_all) = true; -// The Bootstrap service definition. +// Bootstrap service allows neofs-node to connect to the network. Node should +// perform at least one bootstrap request in the epoch to stay in the network +// for the next epoch. service Bootstrap { + // Process is method that allows to register node in the network and receive actual netmap rpc Process(Request) returns (bootstrap.SpreadMap); } -// Request message to communicate between DHT nodes message Request { + // Type is NodeType, can be InnerRingNode (type=1) or StorageNode (type=2) int32 type = 1 [(gogoproto.customname) = "Type" , (gogoproto.nullable) = false, (gogoproto.customtype) = "NodeType"]; + // Info contains information about node bootstrap.NodeInfo info = 2 [(gogoproto.nullable) = false]; + // TTL must be larger than zero, it decreased in every neofs-node uint32 TTL = 3; } diff --git a/bootstrap/types.proto b/bootstrap/types.proto index 4d6e458b..5a566dae 100644 --- a/bootstrap/types.proto +++ b/bootstrap/types.proto @@ -10,13 +10,19 @@ option (gogoproto.stringer_all) = false; option (gogoproto.goproto_stringer_all) = false; message SpreadMap { + // Epoch is current epoch for netmap uint64 Epoch = 1; + // NetMap is a set of NodeInfos repeated NodeInfo NetMap = 2 [(gogoproto.nullable) = false]; } message NodeInfo { + // Address is a node [multi-address](https://github.com/multiformats/multiaddr) string Address = 1 [(gogoproto.jsontag) = "address"]; + // PubKey is a compressed public key representation in bytes bytes PubKey = 2 [(gogoproto.jsontag) = "pubkey,omitempty"]; + // Options is set of node optional information, such as storage capacity, node location, price and etc repeated string Options = 3 [(gogoproto.jsontag) = "options,omitempty"]; + // Status is bitmap status of the node uint64 Status = 4 [(gogoproto.jsontag) = "status", (gogoproto.nullable) = false, (gogoproto.customtype) = "NodeStatus"]; }