diff --git a/reputation/service.proto b/reputation/service.proto new file mode 100644 index 0000000..642fd10 --- /dev/null +++ b/reputation/service.proto @@ -0,0 +1,61 @@ +syntax = "proto3"; + +package neo.fs.v2.reputation; + +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/reputation/grpc;reputation"; +option csharp_namespace = "Neo.FileStorage.API.Reputation"; + +import "reputation/types.proto"; +import "session/types.proto"; + +// `ReputationService` provides mechanisms for exchanging +// trust values within NeoFS Reputation system . +service ReputationService { + // Sends local client trust to any peer from NeoFS network. + rpc SendLocalTrust (SendLocalTrustRequest) returns (SendLocalTrustResponse); +} + +// Request to send local trust. +message SendLocalTrustRequest { + // Request body structure. + message Body { + // The number of the epoch in which the trust was assessed. + uint64 epoch = 1; + + // List of normalized local trust values of the client to the NeoFS peers. + // The value is calculated according to EigenTrust++ algorithm + // and must be in the range [0;1]. + repeated Trust trusts = 2; + } + + // Body of the request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; +} + +// Response to request to send local trust. +message SendLocalTrustResponse { + // Response body structure. + message Body { + } + + // Body of the response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; +} diff --git a/reputation/types.proto b/reputation/types.proto new file mode 100644 index 0000000..87690d6 --- /dev/null +++ b/reputation/types.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package neo.fs.v2.reputation; + +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/reputation/grpc;reputation"; +option csharp_namespace = "Neo.FileStorage.API.Reputation"; + +// Trust value to NeoFS network peer. +message Trust { + // Identifier of the trusted peer. + // + // For storage nodes, it is the node's public key + // fixed in the network map. + bytes peer = 1 [json_name = "peer"]; + + // Trust value. + double value = 2 [json_name = "value"]; +}