diff --git a/Makefile b/Makefile index 6fff585c6..b0b295637 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 f0501e418..8a3223713 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 29b9824fb..402a5840d 100644 --- a/go.sum +++ b/go.sum @@ -120,6 +120,7 @@ github.com/go-redis/redis v6.10.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8w github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= diff --git a/pkg/services/private/service.pb.go b/pkg/services/private/service.pb.go new file mode 100644 index 000000000..3c12c3fb7 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 000000000..23a569fac --- /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 000000000..373446f17 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 000000000..f473bb7ce --- /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; +}