diff --git a/Makefile b/Makefile index 6fff585c..b0b29563 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ protoc: @for f in `find . -type f -name '*.proto' -not -path './vendor/*'`; do \ echo "⇒ Processing $$f "; \ protoc \ - --proto_path=.:./vendor:./vendor/github.com/nspcc-dev/neofs-api-go:/usr/local/include \ + --proto_path=.:./vendor:./vendor/github.com/nspcc-dev/neofs-api-go:/usr/local/include:./pkg/services/private \ --gofast_out=plugins=grpc,paths=source_relative:. $$f; \ done rm -rf vendor diff --git a/go.mod b/go.mod index f0501e41..8a322371 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.14 require ( code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48 github.com/alecthomas/participle v0.6.0 + github.com/golang/protobuf v1.4.3 github.com/google/uuid v1.1.1 github.com/hashicorp/golang-lru v0.5.4 github.com/klauspost/compress v1.11.3 diff --git a/go.sum b/go.sum index 29b9824f..402a5840 100644 Binary files a/go.sum and b/go.sum differ diff --git a/pkg/services/private/service.pb.go b/pkg/services/private/service.pb.go new file mode 100644 index 00000000..3c12c3fb Binary files /dev/null and b/pkg/services/private/service.pb.go differ diff --git a/pkg/services/private/service.proto b/pkg/services/private/service.proto new file mode 100644 index 00000000..23a569fa --- /dev/null +++ b/pkg/services/private/service.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; + +package private; + +import "types.proto"; + +option go_package = "github.com/nspcc-dev/neofs-node/pkg/services/private"; + +// `PrivateService` provides an interface for internal work with the storage node. +service PrivateService { + // Performs health check of the storage node. + rpc HealthCheck (HealthCheckRequest) returns (HealthCheckResponse); +} + +// Health check request. +message HealthCheckRequest { + // Health check request body. + message Body { + } + + // Body of health check request message. + Body body = 1; + + // Body signature. + Signature signature = 2; +} + +// Health check request. +message HealthCheckResponse { + // Health check response body + message Body { + // Health status of storage node. + HealthStatus status = 1; + } + + // Body of health check response message. + Body body = 1; + + // Body signature. + Signature signature = 2; +} diff --git a/pkg/services/private/types.pb.go b/pkg/services/private/types.pb.go new file mode 100644 index 00000000..373446f1 Binary files /dev/null and b/pkg/services/private/types.pb.go differ diff --git a/pkg/services/private/types.proto b/pkg/services/private/types.proto new file mode 100644 index 00000000..f473bb7c --- /dev/null +++ b/pkg/services/private/types.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package private; + +option go_package = "github.com/nspcc-dev/neofs-node/pkg/services/private"; + +// Signature of some message. +message Signature { + // Public key used for signing. + bytes key = 1 [json_name = "key"]; + + // Binary signature. + bytes sign = 2 [json_name = "signature"]; +} + +// Health status of the storage node. +enum HealthStatus { + // Undefined status, default value. + STATUS_UNDEFINED = 0; + + // Node is online. + ONLINE = 1; + + // Node is offline. + OFFLINE = 2; +}