From 3f32aaee7aaa11dcae17b06527c579a0a23bd2da Mon Sep 17 00:00:00 2001 From: Andrey Butusov Date: Mon, 2 Dec 2024 10:19:05 +0300 Subject: [PATCH] control: add network management via ir control New `neofs-cli control notary` with `list`, `request` and `sign` commands. - `list` - get list of all notary requests from notary pool. - `request` - send a notary request with one of the following methods: `newEpoch`, `setConfig` and `removeNode`. - `sign` - sign the notary request using a hash. Closes #2088, #1866. Signed-off-by: Andrey Butusov --- CHANGELOG.md | 1 + cmd/neofs-cli/modules/control/notary.go | 20 + cmd/neofs-cli/modules/control/notary_list.go | 74 ++ .../modules/control/notary_request.go | 112 ++ cmd/neofs-cli/modules/control/notary_sign.go | 75 ++ cmd/neofs-cli/modules/control/root.go | 2 + docs/cli-commands/neofs-cli_control.md | 1 + docs/cli-commands/neofs-cli_control_notary.md | 24 + .../neofs-cli_control_notary_list.md | 33 + .../neofs-cli_control_notary_request.md | 37 + .../neofs-cli_control_notary_sign.md | 34 + pkg/innerring/innerring.go | 1 + pkg/innerring/network.go | 190 ++++ .../processors/netmap/process_cleanup.go | 2 +- pkg/innerring/state.go | 2 +- pkg/morph/client/client.go | 26 + pkg/morph/client/notary.go | 30 +- pkg/morph/client/static.go | 3 +- pkg/services/control/ir/convert.go | 57 + pkg/services/control/ir/rpc.go | 71 +- pkg/services/control/ir/server/calls.go | 88 ++ pkg/services/control/ir/server/deps.go | 17 +- pkg/services/control/ir/server/prm.go | 7 + pkg/services/control/ir/server/server.go | 5 +- pkg/services/control/ir/service.go | 77 ++ pkg/services/control/ir/service.pb.go | 1012 +++++++++++++++-- pkg/services/control/ir/service.proto | 95 ++ pkg/services/control/ir/service_grpc.pb.go | 156 ++- pkg/services/control/ir/service_neofs.pb.go | 468 ++++++++ pkg/services/control/ir/types.pb.go | 114 +- pkg/services/control/ir/types.proto | 6 + pkg/services/control/ir/types_neofs.pb.go | 28 + 32 files changed, 2749 insertions(+), 119 deletions(-) create mode 100644 cmd/neofs-cli/modules/control/notary.go create mode 100644 cmd/neofs-cli/modules/control/notary_list.go create mode 100644 cmd/neofs-cli/modules/control/notary_request.go create mode 100644 cmd/neofs-cli/modules/control/notary_sign.go create mode 100644 docs/cli-commands/neofs-cli_control_notary.md create mode 100644 docs/cli-commands/neofs-cli_control_notary_list.md create mode 100644 docs/cli-commands/neofs-cli_control_notary_request.md create mode 100644 docs/cli-commands/neofs-cli_control_notary_sign.md create mode 100644 pkg/innerring/network.go diff --git a/CHANGELOG.md b/CHANGELOG.md index f6c63fc7f0..dd26abe1a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Changelog for NeoFS Node ### Added - Initial support for meta-on-chain for objects (#2877) - First split-object part into the CLI output (#3064) +- `neofs-cli control notary` with `list`, `request` and `sign` commands (#3059) ### Fixed - `neofs-cli object delete` command output (#3056) diff --git a/cmd/neofs-cli/modules/control/notary.go b/cmd/neofs-cli/modules/control/notary.go new file mode 100644 index 0000000000..3b829d18e1 --- /dev/null +++ b/cmd/neofs-cli/modules/control/notary.go @@ -0,0 +1,20 @@ +package control + +import ( + "github.com/spf13/cobra" +) + +var notaryCmd = &cobra.Command{ + Use: "notary", + Short: "Commands with notary request with alphabet key of inner ring node", +} + +func initControlNotaryCmd() { + notaryCmd.AddCommand(listNotaryCmd) + notaryCmd.AddCommand(notaryRequestCmd) + notaryCmd.AddCommand(notarySignCmd) + + initControlNotaryListCmd() + initControlNotaryRequestCmd() + initControlNotarySignCmd() +} diff --git a/cmd/neofs-cli/modules/control/notary_list.go b/cmd/neofs-cli/modules/control/notary_list.go new file mode 100644 index 0000000000..f894e38394 --- /dev/null +++ b/cmd/neofs-cli/modules/control/notary_list.go @@ -0,0 +1,74 @@ +package control + +import ( + "fmt" + + "github.com/nspcc-dev/neo-go/pkg/util" + rawclient "github.com/nspcc-dev/neofs-api-go/v2/rpc/client" + "github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/commonflags" + "github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/key" + ircontrol "github.com/nspcc-dev/neofs-node/pkg/services/control/ir" + ircontrolsrv "github.com/nspcc-dev/neofs-node/pkg/services/control/ir/server" + "github.com/spf13/cobra" +) + +var listNotaryCmd = &cobra.Command{ + Use: "list", + Short: "Get list of all notary requests in network", + Long: "Get list of all notary requests in network", + Args: cobra.NoArgs, + RunE: listNotary, +} + +func initControlNotaryListCmd() { + initControlFlags(listNotaryCmd) +} + +func listNotary(cmd *cobra.Command, _ []string) error { + ctx, cancel := commonflags.GetCommandContext(cmd) + defer cancel() + + pk, err := key.Get(cmd) + if err != nil { + return err + } + + cli, err := getClient(ctx) + if err != nil { + return err + } + + req := new(ircontrol.NotaryListRequest) + + req.SetBody(new(ircontrol.NotaryListRequest_Body)) + + err = ircontrolsrv.SignMessage(pk, req) + if err != nil { + return fmt.Errorf("could not sign request: %w", err) + } + + var resp *ircontrol.NotaryListResponse + err = cli.ExecRaw(func(client *rawclient.Client) error { + resp, err = ircontrol.NotaryList(client, req) + return err + }) + if err != nil { + return fmt.Errorf("rpc error: %w", err) + } + + err = verifyResponse(resp.GetSignature(), resp.GetBody()) + if err != nil { + return err + } + + txs := resp.GetBody().GetTransactions() + + for _, tx := range txs { + hash, err := util.Uint256DecodeBytesBE(tx.GetHash()) + if err != nil { + return fmt.Errorf("failed to decode hash: %w", err) + } + cmd.Println(hash.String()) + } + return nil +} diff --git a/cmd/neofs-cli/modules/control/notary_request.go b/cmd/neofs-cli/modules/control/notary_request.go new file mode 100644 index 0000000000..2e9d7255de --- /dev/null +++ b/cmd/neofs-cli/modules/control/notary_request.go @@ -0,0 +1,112 @@ +package control + +import ( + "fmt" + "strings" + + "github.com/nspcc-dev/neo-go/pkg/crypto/keys" + "github.com/nspcc-dev/neo-go/pkg/util" + rawclient "github.com/nspcc-dev/neofs-api-go/v2/rpc/client" + "github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/commonflags" + "github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/key" + ircontrol "github.com/nspcc-dev/neofs-node/pkg/services/control/ir" + ircontrolsrv "github.com/nspcc-dev/neofs-node/pkg/services/control/ir/server" + "github.com/spf13/cobra" +) + +const notaryMethodFlag = "method" + +var notaryRequestCmd = &cobra.Command{ + Use: "request", + Short: "Create and send a notary request", + Long: "Create and send a notary request with one of the following methods:\n" + + "- newEpoch, transaction for creating of new NeoFS epoch event in FS chain, no args\n" + + "- setConfig, transaction to add/update global config value in the NeoFS network, 1 arg in the form key=val\n" + + "- removeNode, transaction to move nodes to the Offline state in the candidates list, 1 arg is the public key of the node", + RunE: notaryRequest, +} + +func initControlNotaryRequestCmd() { + initControlFlags(notaryRequestCmd) + + flags := notaryRequestCmd.Flags() + flags.String(notaryMethodFlag, "", "Requested method") +} + +func notaryRequest(cmd *cobra.Command, args []string) error { + ctx, cancel := commonflags.GetCommandContext(cmd) + defer cancel() + + pk, err := key.Get(cmd) + if err != nil { + return err + } + + cli, err := getClient(ctx) + if err != nil { + return err + } + + req := new(ircontrol.NotaryRequestRequest) + body := new(ircontrol.NotaryRequestRequest_Body) + req.SetBody(body) + + method, _ := cmd.Flags().GetString(notaryMethodFlag) + body.SetMethod(method) + + switch method { + case "newEpoch": + if len(args) > 0 { + cmd.Println("method 'newEpoch', but the args provided, they will be ignored") + } + case "setConfig": + if len(args) != 1 { + return fmt.Errorf("invalid number of args provided for 'setConfig', expected 1, got %d", len(args)) + } + + kv := strings.SplitN(args[0], "=", 2) + if len(kv) != 2 { + return fmt.Errorf("invalid parameter format: must be 'key=val', got: %s", args[0]) + } + + body.SetArgs([][]byte{[]byte(kv[0]), []byte(kv[1])}) + case "removeNode": + if len(args) != 1 { + return fmt.Errorf("invalid number of args provided for 'removeNode', expected 1, got %d", len(args)) + } + key, err := keys.NewPublicKeyFromString(args[0]) + if err != nil { + return err + } + + body.SetArgs([][]byte{key.Bytes()}) + } + + err = ircontrolsrv.SignMessage(pk, req) + if err != nil { + return fmt.Errorf("could not sign request: %w", err) + } + + var resp *ircontrol.NotaryRequestResponse + err = cli.ExecRaw(func(client *rawclient.Client) error { + resp, err = ircontrol.NotaryRequest(client, req) + return err + }) + if err != nil { + return fmt.Errorf("rpc error: %w", err) + } + + err = verifyResponse(resp.GetSignature(), resp.GetBody()) + if err != nil { + return err + } + + hashB := resp.GetBody().GetHash() + + hash, err := util.Uint256DecodeBytesBE(hashB) + if err != nil { + return fmt.Errorf("failed to decode hash %v: %w", hashB, err) + } + cmd.Printf("Transaction Hash: %s\n", hash.String()) + return nil +} diff --git a/cmd/neofs-cli/modules/control/notary_sign.go b/cmd/neofs-cli/modules/control/notary_sign.go new file mode 100644 index 0000000000..8f60b2da1c --- /dev/null +++ b/cmd/neofs-cli/modules/control/notary_sign.go @@ -0,0 +1,75 @@ +package control + +import ( + "fmt" + + "github.com/nspcc-dev/neo-go/pkg/util" + rawclient "github.com/nspcc-dev/neofs-api-go/v2/rpc/client" + "github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/commonflags" + "github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/key" + ircontrol "github.com/nspcc-dev/neofs-node/pkg/services/control/ir" + ircontrolsrv "github.com/nspcc-dev/neofs-node/pkg/services/control/ir/server" + "github.com/spf13/cobra" +) + +var notarySignHashFlag string + +var notarySignCmd = &cobra.Command{ + Use: "sign", + Short: "Sign notary request by its hash", + Long: "Sign notary request by its hash", + Args: cobra.NoArgs, + RunE: notarySign, +} + +func initControlNotarySignCmd() { + initControlFlags(notarySignCmd) + + flags := notarySignCmd.Flags() + flags.StringVar(¬arySignHashFlag, "hash", "", "hash of the notary request") +} + +func notarySign(cmd *cobra.Command, _ []string) error { + ctx, cancel := commonflags.GetCommandContext(cmd) + defer cancel() + + pk, err := key.Get(cmd) + if err != nil { + return err + } + + cli, err := getClient(ctx) + if err != nil { + return err + } + + req := new(ircontrol.NotarySignRequest) + body := new(ircontrol.NotarySignRequest_Body) + req.SetBody(body) + hash, err := util.Uint256DecodeStringBE(notarySignHashFlag) + if err != nil { + return fmt.Errorf("failed to decode hash: %w", err) + } + body.SetHash(hash.BytesBE()) + + err = ircontrolsrv.SignMessage(pk, req) + if err != nil { + return fmt.Errorf("could not sign request: %w", err) + } + + var resp *ircontrol.NotarySignResponse + err = cli.ExecRaw(func(client *rawclient.Client) error { + resp, err = ircontrol.NotarySign(client, req) + return err + }) + if err != nil { + return fmt.Errorf("rpc error: %w", err) + } + + err = verifyResponse(resp.GetSignature(), resp.GetBody()) + if err != nil { + return err + } + + return nil +} diff --git a/cmd/neofs-cli/modules/control/root.go b/cmd/neofs-cli/modules/control/root.go index b7b8afa294..710831af15 100644 --- a/cmd/neofs-cli/modules/control/root.go +++ b/cmd/neofs-cli/modules/control/root.go @@ -34,6 +34,7 @@ func init() { shardsCmd, synchronizeTreeCmd, objectCmd, + notaryCmd, ) initControlHealthCheckCmd() @@ -42,4 +43,5 @@ func init() { initControlShardsCmd() initControlSynchronizeTreeCmd() initControlObjectsCmd() + initControlNotaryCmd() } diff --git a/docs/cli-commands/neofs-cli_control.md b/docs/cli-commands/neofs-cli_control.md index 0077e1f317..9299870651 100644 --- a/docs/cli-commands/neofs-cli_control.md +++ b/docs/cli-commands/neofs-cli_control.md @@ -24,6 +24,7 @@ Operations with storage node * [neofs-cli](neofs-cli.md) - Command Line Tool to work with NeoFS * [neofs-cli control drop-objects](neofs-cli_control_drop-objects.md) - Drop objects from the node's local storage * [neofs-cli control healthcheck](neofs-cli_control_healthcheck.md) - Health check of the NeoFS node +* [neofs-cli control notary](neofs-cli_control_notary.md) - Commands with notary request with alphabet key of inner ring node * [neofs-cli control object](neofs-cli_control_object.md) - Direct object operations with storage engine * [neofs-cli control set-status](neofs-cli_control_set-status.md) - Set status of the storage node in NeoFS network map * [neofs-cli control shards](neofs-cli_control_shards.md) - Operations with storage node's shards diff --git a/docs/cli-commands/neofs-cli_control_notary.md b/docs/cli-commands/neofs-cli_control_notary.md new file mode 100644 index 0000000000..a7bb1501d0 --- /dev/null +++ b/docs/cli-commands/neofs-cli_control_notary.md @@ -0,0 +1,24 @@ +## neofs-cli control notary + +Commands with notary request with alphabet key of inner ring node + +### Options + +``` + -h, --help help for notary +``` + +### Options inherited from parent commands + +``` + -c, --config string Config file (default is $HOME/.config/neofs-cli/config.yaml) + -v, --verbose Verbose output +``` + +### SEE ALSO + +* [neofs-cli control](neofs-cli_control.md) - Operations with storage node +* [neofs-cli control notary list](neofs-cli_control_notary_list.md) - Get list of all notary requests in network +* [neofs-cli control notary request](neofs-cli_control_notary_request.md) - Create and send a notary request +* [neofs-cli control notary sign](neofs-cli_control_notary_sign.md) - Sign notary request by its hash + diff --git a/docs/cli-commands/neofs-cli_control_notary_list.md b/docs/cli-commands/neofs-cli_control_notary_list.md new file mode 100644 index 0000000000..f2d6575947 --- /dev/null +++ b/docs/cli-commands/neofs-cli_control_notary_list.md @@ -0,0 +1,33 @@ +## neofs-cli control notary list + +Get list of all notary requests in network + +### Synopsis + +Get list of all notary requests in network + +``` +neofs-cli control notary list [flags] +``` + +### Options + +``` + --address string Address of wallet account + --endpoint string Remote node control address (as 'multiaddr' or ':') + -h, --help help for list + -t, --timeout duration Timeout for the operation (default 15s) + -w, --wallet string Path to the wallet +``` + +### Options inherited from parent commands + +``` + -c, --config string Config file (default is $HOME/.config/neofs-cli/config.yaml) + -v, --verbose Verbose output +``` + +### SEE ALSO + +* [neofs-cli control notary](neofs-cli_control_notary.md) - Commands with notary request with alphabet key of inner ring node + diff --git a/docs/cli-commands/neofs-cli_control_notary_request.md b/docs/cli-commands/neofs-cli_control_notary_request.md new file mode 100644 index 0000000000..da2e3a708b --- /dev/null +++ b/docs/cli-commands/neofs-cli_control_notary_request.md @@ -0,0 +1,37 @@ +## neofs-cli control notary request + +Create and send a notary request + +### Synopsis + +Create and send a notary request with one of the following methods: +- newEpoch, transaction for creating of new NeoFS epoch event in FS chain, no args +- setConfig, transaction to add/update global config value in the NeoFS network, 1 arg in the form key=val +- removeNode, transaction to move nodes to the Offline state in the candidates list, 1 arg is the public key of the node + +``` +neofs-cli control notary request [flags] +``` + +### Options + +``` + --address string Address of wallet account + --endpoint string Remote node control address (as 'multiaddr' or ':') + -h, --help help for request + --method string Requested method + -t, --timeout duration Timeout for the operation (default 15s) + -w, --wallet string Path to the wallet +``` + +### Options inherited from parent commands + +``` + -c, --config string Config file (default is $HOME/.config/neofs-cli/config.yaml) + -v, --verbose Verbose output +``` + +### SEE ALSO + +* [neofs-cli control notary](neofs-cli_control_notary.md) - Commands with notary request with alphabet key of inner ring node + diff --git a/docs/cli-commands/neofs-cli_control_notary_sign.md b/docs/cli-commands/neofs-cli_control_notary_sign.md new file mode 100644 index 0000000000..bc34497fa5 --- /dev/null +++ b/docs/cli-commands/neofs-cli_control_notary_sign.md @@ -0,0 +1,34 @@ +## neofs-cli control notary sign + +Sign notary request by its hash + +### Synopsis + +Sign notary request by its hash + +``` +neofs-cli control notary sign [flags] +``` + +### Options + +``` + --address string Address of wallet account + --endpoint string Remote node control address (as 'multiaddr' or ':') + --hash string hash of the notary request + -h, --help help for sign + -t, --timeout duration Timeout for the operation (default 15s) + -w, --wallet string Path to the wallet +``` + +### Options inherited from parent commands + +``` + -c, --config string Config file (default is $HOME/.config/neofs-cli/config.yaml) + -v, --verbose Verbose output +``` + +### SEE ALSO + +* [neofs-cli control notary](neofs-cli_control_notary.md) - Commands with notary request with alphabet key of inner ring node + diff --git a/pkg/innerring/innerring.go b/pkg/innerring/innerring.go index efc6f3c7d0..9e392d378c 100644 --- a/pkg/innerring/innerring.go +++ b/pkg/innerring/innerring.go @@ -1273,6 +1273,7 @@ func serveControl(server *Server, log *zap.Logger, cfg *viper.Viper, errChan cha p.SetPrivateKey(*server.key) p.SetHealthChecker(server) + p.SetNetworkManager(server) controlSvc := controlsrv.New(p, controlsrv.WithAllowedKeys(authKeys), diff --git a/pkg/innerring/network.go b/pkg/innerring/network.go new file mode 100644 index 0000000000..e54351c362 --- /dev/null +++ b/pkg/innerring/network.go @@ -0,0 +1,190 @@ +package innerring + +import ( + "crypto/elliptic" + "errors" + "fmt" + "strconv" + + "github.com/nspcc-dev/neo-go/pkg/crypto/keys" + "github.com/nspcc-dev/neo-go/pkg/util" + "github.com/nspcc-dev/neofs-contract/rpc/netmap" + netmapcore "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap" + "go.uber.org/zap" +) + +// ListNotaryRequests list hashes of all P2PNotaryRequest transactions +// that are currently in the RPC node's notary request pool. +func (s *Server) ListNotaryRequests() ([]util.Uint256, error) { + hashesMap, err := s.netmapClient.Morph().GetRawNotaryPool() + if err != nil { + return nil, err + } + + result := make([]util.Uint256, 0, len(hashesMap.Hashes)) + for k := range hashesMap.Hashes { + result = append(result, k) + } + return result, nil +} + +// RequestNotary create and send a notary request with +// the sign of current node with the following methods and args: +// +// - "newEpoch", transaction for creating of new NeoFS epoch event in FS chain, no args; +// +// - "setConfig", transaction to add/update global config value +// in the NeoFS network, 2 args - key and value UTF-8 encoded strings; +// +// - "removeNode", transaction to move nodes to the netmap.NodeStateOffline state +// in the candidates list, 1 arg is the public key of the node in binary form. +func (s *Server) RequestNotary(method string, args ...[]byte) (util.Uint256, error) { + if !s.IsAlphabet() { + s.log.Info("non alphabet mode, ignore request") + return util.Uint256{}, errors.New("non alphabet mode, ignore request") + } + + var ( + hash util.Uint256 + err error + ) + + switch method { + case "newEpoch": + epoch := s.EpochCounter() + + hash, err = s.netmapClient.Morph().NotaryInvoke(s.netmapClient.ContractAddress(), 0, 1, nil, method, epoch+1) + if err != nil { + s.log.Warn("external request: can't invoke newEpoch method in netmap", + zap.Uint64("epoch", epoch), + zap.Error(err)) + } + case "setConfig": + if len(args) < 2 { + return util.Uint256{}, errors.New("invalid config pairs") + } + if len(args) > 2 { + s.log.Warn("2 args expected: key and value; all others will be ignored", + zap.String("method", method), + zap.ByteStrings("args", args)) + } + + var v any + k := string(args[0]) + v, err = convertKnownConfigValues(k, string(args[1])) + if err != nil { + return util.Uint256{}, err + } + + hash, err = s.netmapClient.Morph().NotaryInvoke(s.netmapClient.ContractAddress(), 0, 1, nil, method, nil, k, v) + if err != nil { + s.log.Warn("external request: can't invoke setConfig method in netmap", + zap.String("key", k), + zap.Any("value", v), + zap.Error(err)) + } + case "removeNode": + if len(args) == 0 { + return util.Uint256{}, errors.New("empty node key") + } + if len(args) > 1 { + s.log.Warn("1 public key expected, all but the first one will be ignored", + zap.String("method", method), + zap.ByteStrings("args", args)) + } + + nodePubKey, err := keys.NewPublicKeyFromBytes(args[0], elliptic.P256()) + if err != nil { + return util.Uint256{}, fmt.Errorf("can't parse node public key: %w", err) + } + + hash, err = s.netmapClient.Morph().NotaryInvoke( + s.netmapClient.ContractAddress(), 0, 1, nil, + "updateStateIR", netmap.NodeStateOffline, nodePubKey.Bytes()) + if err != nil { + s.log.Warn("external request: can't invoke updateSateIR method in netmap", + zap.String("node pub key", nodePubKey.String()), + zap.Error(err)) + } + default: + return util.Uint256{}, errors.New("invalid method") + } + + return hash, err +} + +// SignNotary get a notary transaction by its hash, then send it with sign of the current node. +func (s *Server) SignNotary(hash util.Uint256) error { + tx, err := s.netmapClient.Morph().GetRawNotaryTransactionVerbose(hash) + if err != nil { + return err + } + + ok, err := s.netmapClient.Morph().IsValidScript(tx.Script, tx.Signers) + if err != nil { + s.log.Warn("error in validation script", + zap.String("hash", tx.Hash().StringLE()), + zap.Error(err)) + return err + } + if !ok { + s.log.Warn("non-halt notary transaction", + zap.String("hash", tx.Hash().StringLE()), + zap.Error(err)) + return err + } + + // tx arrives already signed by another node, + // and method `NotarySignAndInvokeTX` (more precisely, method actor.Sign inside) + // works when there is no signature, so we delete it + // TODO: delete after resolve https://github.com/nspcc-dev/neo-go/issues/3770 + for i, wit := range tx.Scripts { + if len(wit.InvocationScript) != 0 { + tx.Scripts[i].InvocationScript = tx.Scripts[i].InvocationScript[:0] + } + } + + err = s.netmapClient.Morph().NotarySignAndInvokeTX(tx, false) + if err != nil { + return err + } + + return nil +} + +func convertKnownConfigValues(k, v string) (any, error) { + var ( + val any + err error + ) + switch k { + case netmapcore.AuditFeeConfig, netmapcore.BasicIncomeRateConfig, + netmapcore.ContainerFeeConfig, netmapcore.ContainerAliasFeeConfig, + netmapcore.EigenTrustIterationsConfig, + netmapcore.EpochDurationConfig, netmapcore.InnerRingCandidateFeeConfig, + netmapcore.MaxObjectSizeConfig, netmapcore.WithdrawFeeConfig: + val, err = strconv.ParseInt(v, 10, 64) + if err != nil { + err = fmt.Errorf("invalid value for %s key, expected int, got '%s'", k, v) + } + case netmapcore.EigenTrustAlphaConfig: + // just check that it could + // be parsed correctly + _, err = strconv.ParseFloat(v, 64) + if err != nil { + err = fmt.Errorf("invalid value for %s key, expected float, got '%s'", k, v) + } + + val = v + case netmapcore.HomomorphicHashingDisabledKey, netmapcore.MaintenanceModeAllowedConfig: + val, err = strconv.ParseBool(v) + if err != nil { + err = fmt.Errorf("invalid value for %s key, expected bool, got '%s'", k, v) + } + + default: + val = v + } + + return val, err +} diff --git a/pkg/innerring/processors/netmap/process_cleanup.go b/pkg/innerring/processors/netmap/process_cleanup.go index 3ddcd3299b..e9fca27706 100644 --- a/pkg/innerring/processors/netmap/process_cleanup.go +++ b/pkg/innerring/processors/netmap/process_cleanup.go @@ -29,7 +29,7 @@ func (np *Processor) processNetmapCleanupTick(ev netmapCleanupTick) { // See https://github.com/nspcc-dev/neofs-contract/issues/225 const methodUpdateStateNotary = "updateStateIR" - err = np.netmapClient.Morph().NotaryInvoke( + _, err = np.netmapClient.Morph().NotaryInvoke( np.netmapClient.ContractAddress(), 0, uint32(ev.epoch), diff --git a/pkg/innerring/state.go b/pkg/innerring/state.go index 3e6d83c8ff..abd5dfec7f 100644 --- a/pkg/innerring/state.go +++ b/pkg/innerring/state.go @@ -134,7 +134,7 @@ func (s *Server) voteForFSChainValidator(validators keys.PublicKeys, trigger *ut } s.contracts.alphabet.iterate(func(ind int, contract util.Uint160) { - err := s.morphClient.NotaryInvoke(contract, 0, nonce, vubP, voteMethod, epoch, validators) + _, err := s.morphClient.NotaryInvoke(contract, 0, nonce, vubP, voteMethod, epoch, validators) if err != nil { s.log.Warn("can't invoke vote method in alphabet contract", zap.Int("alphabet_index", ind), diff --git a/pkg/morph/client/client.go b/pkg/morph/client/client.go index 8bd8429b66..ba5ffe6e1a 100644 --- a/pkg/morph/client/client.go +++ b/pkg/morph/client/client.go @@ -560,3 +560,29 @@ func (c *Client) AccountVote(addr util.Uint160) (*keys.PublicKey, error) { return accountState.VoteTo, nil } + +// GetRawNotaryPool returns hashes of main P2PNotaryRequest transactions +// that are currently in the RPC node's notary request pool with the +// corresponding hashes of fallback transactions. +func (c *Client) GetRawNotaryPool() (*result.RawNotaryPool, error) { + var conn = c.conn.Load() + + if conn == nil { + return nil, ErrConnectionLost + } + + return conn.client.GetRawNotaryPool() +} + +// GetRawNotaryTransactionVerbose returns main or fallback transaction +// from the RPC node's notary request pool. +// NOTE: to get transaction.ID and transaction.Size, use t.Hash() and io.GetVarSize(t) respectively. +func (c *Client) GetRawNotaryTransactionVerbose(hash util.Uint256) (*transaction.Transaction, error) { + var conn = c.conn.Load() + + if conn == nil { + return nil, ErrConnectionLost + } + + return conn.client.GetRawNotaryTransactionVerbose(hash) +} diff --git a/pkg/morph/client/notary.go b/pkg/morph/client/notary.go index 54a8ad5dc6..e56c6bd33f 100644 --- a/pkg/morph/client/notary.go +++ b/pkg/morph/client/notary.go @@ -305,13 +305,13 @@ func (c *Client) UpdateNeoFSAlphabetList(alphas keys.PublicKeys, txHash util.Uin } // NotaryInvoke invokes contract method by sending tx to notary contract in -// blockchain. Fallback tx is a `RET`. If Notary support is not enabled -// it fallbacks to a simple `Invoke()`. +// blockchain and returns the hash of tx. Fallback tx is a `RET`. If Notary support is not enabled +// it fallbacks to a simple `Invoke()`, but doesn't return the hash of tx. // // `nonce` and `vub` are used only if notary is enabled. -func (c *Client) NotaryInvoke(contract util.Uint160, fee fixedn.Fixed8, nonce uint32, vub *uint32, method string, args ...any) error { +func (c *Client) NotaryInvoke(contract util.Uint160, fee fixedn.Fixed8, nonce uint32, vub *uint32, method string, args ...any) (util.Uint256, error) { if c.notary == nil { - return c.Invoke(contract, false, fee, method, args...) + return util.Uint256{}, c.Invoke(contract, false, fee, method, args...) } return c.notaryInvoke(false, true, contract, nonce, vub, method, args...) @@ -327,7 +327,8 @@ func (c *Client) NotaryInvokeNotAlpha(contract util.Uint160, fee fixedn.Fixed8, return c.Invoke(contract, false, fee, method, args...) } - return c.notaryInvoke(false, false, contract, rand.Uint32(), nil, method, args...) + _, err := c.notaryInvoke(false, false, contract, rand.Uint32(), nil, method, args...) + return err } // NotarySignAndInvokeTX signs and sends notary request that was received from @@ -441,19 +442,20 @@ func (c *Client) NotarySignAndInvokeTX(mainTx *transaction.Transaction, await bo func (c *Client) notaryInvokeAsCommittee(method string, nonce, vub uint32, args ...any) error { designate := c.GetDesignateHash() - return c.notaryInvoke(true, true, designate, nonce, &vub, method, args...) + _, err := c.notaryInvoke(true, true, designate, nonce, &vub, method, args...) + return err } -func (c *Client) notaryInvoke(committee, invokedByAlpha bool, contract util.Uint160, nonce uint32, vub *uint32, method string, args ...any) error { +func (c *Client) notaryInvoke(committee, invokedByAlpha bool, contract util.Uint160, nonce uint32, vub *uint32, method string, args ...any) (util.Uint256, error) { var conn = c.conn.Load() if conn == nil { - return ErrConnectionLost + return util.Uint256{}, ErrConnectionLost } alphabetList, err := c.notary.alphabetSource() // prepare arguments for test invocation if err != nil { - return err + return util.Uint256{}, err } var until uint32 @@ -463,18 +465,18 @@ func (c *Client) notaryInvoke(committee, invokedByAlpha bool, contract util.Uint } else { until, err = c.notaryTxValidationLimit(conn) if err != nil { - return err + return util.Uint256{}, err } } cosigners, err := c.notaryCosigners(invokedByAlpha, alphabetList, committee) if err != nil { - return err + return util.Uint256{}, err } nAct, err := notary.NewActor(conn.client, cosigners, c.acc) if err != nil { - return err + return util.Uint256{}, err } mainH, fbH, untilActual, err := nAct.Notarize(nAct.MakeTunedCall(contract, method, nil, func(r *result.Invoke, t *transaction.Transaction) error { @@ -489,7 +491,7 @@ func (c *Client) notaryInvoke(committee, invokedByAlpha bool, contract util.Uint }, args...)) if err != nil && !alreadyOnChainError(err) { - return err + return util.Uint256{}, err } c.logger.Debug("notary request invoked", @@ -498,7 +500,7 @@ func (c *Client) notaryInvoke(committee, invokedByAlpha bool, contract util.Uint zap.String("tx_hash", mainH.StringLE()), zap.String("fallback_hash", fbH.StringLE())) - return nil + return mainH, nil } func (c *Client) runAlphabetNotaryScript(script []byte, nonce uint32) error { diff --git a/pkg/morph/client/static.go b/pkg/morph/client/static.go index 787af70245..d91aba5c2e 100644 --- a/pkg/morph/client/static.go +++ b/pkg/morph/client/static.go @@ -145,7 +145,8 @@ func (s StaticClient) Invoke(prm InvokePrm) error { vubP = &vub } - return s.client.NotaryInvoke(s.scScriptHash, fee, nonce, vubP, prm.method, prm.args...) + _, err = s.client.NotaryInvoke(s.scScriptHash, fee, nonce, vubP, prm.method, prm.args...) + return err } return s.client.NotaryInvokeNotAlpha(s.scScriptHash, fee, prm.method, prm.args...) diff --git a/pkg/services/control/ir/convert.go b/pkg/services/control/ir/convert.go index 24235e520e..04796ad5e4 100644 --- a/pkg/services/control/ir/convert.go +++ b/pkg/services/control/ir/convert.go @@ -32,3 +32,60 @@ func (w *healthCheckResponseWrapper) FromGRPCMessage(m grpc.Message) error { return nil } + +type notaryListResponseWrapper struct { + m *NotaryListResponse +} + +func (w *notaryListResponseWrapper) ToGRPCMessage() grpc.Message { + return w.m +} + +func (w *notaryListResponseWrapper) FromGRPCMessage(m grpc.Message) error { + var ok bool + + w.m, ok = m.(*NotaryListResponse) + if !ok { + return message.NewUnexpectedMessageType(m, w.m) + } + + return nil +} + +type notaryRequestResponseWrapper struct { + m *NotaryRequestResponse +} + +func (w *notaryRequestResponseWrapper) ToGRPCMessage() grpc.Message { + return w.m +} + +func (w *notaryRequestResponseWrapper) FromGRPCMessage(m grpc.Message) error { + var ok bool + + w.m, ok = m.(*NotaryRequestResponse) + if !ok { + return message.NewUnexpectedMessageType(m, w.m) + } + + return nil +} + +type notarySignResponseWrapper struct { + m *NotarySignResponse +} + +func (w *notarySignResponseWrapper) ToGRPCMessage() grpc.Message { + return w.m +} + +func (w *notarySignResponseWrapper) FromGRPCMessage(m grpc.Message) error { + var ok bool + + w.m, ok = m.(*NotarySignResponse) + if !ok { + return message.NewUnexpectedMessageType(m, w.m) + } + + return nil +} diff --git a/pkg/services/control/ir/rpc.go b/pkg/services/control/ir/rpc.go index e7b7c23204..09e3d847f7 100644 --- a/pkg/services/control/ir/rpc.go +++ b/pkg/services/control/ir/rpc.go @@ -8,7 +8,10 @@ import ( const serviceName = "ircontrol.ControlService" const ( - rpcHealthCheck = "HealthCheck" + rpcHealthCheck = "HealthCheck" + rpcNotaryList = "NotaryList" + rpcNotaryRequest = "NotaryRequest" + rpcNotarySign = "NotarySign" ) // HealthCheck executes ControlService.HealthCheck RPC. @@ -32,3 +35,69 @@ func HealthCheck( return wResp.m, nil } + +// NotaryList executes ControlService.NotaryList RPC. +func NotaryList( + cli *client.Client, + req *NotaryListRequest, + opts ...client.CallOption, +) (*NotaryListResponse, error) { + wResp := ¬aryListResponseWrapper{ + m: new(NotaryListResponse), + } + + wReq := &requestWrapper{ + m: req, + } + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcNotaryList), wReq, wResp, opts...) + if err != nil { + return nil, err + } + + return wResp.m, nil +} + +// NotaryRequest executes ControlService.NotaryRequest RPC. +func NotaryRequest( + cli *client.Client, + req *NotaryRequestRequest, + opts ...client.CallOption, +) (*NotaryRequestResponse, error) { + wResp := ¬aryRequestResponseWrapper{ + m: new(NotaryRequestResponse), + } + + wReq := &requestWrapper{ + m: req, + } + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcNotaryRequest), wReq, wResp, opts...) + if err != nil { + return nil, err + } + + return wResp.m, nil +} + +// NotarySign executes ControlService.NotarySign RPC. +func NotarySign( + cli *client.Client, + req *NotarySignRequest, + opts ...client.CallOption, +) (*NotarySignResponse, error) { + wResp := ¬arySignResponseWrapper{ + m: new(NotarySignResponse), + } + + wReq := &requestWrapper{ + m: req, + } + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcNotarySign), wReq, wResp, opts...) + if err != nil { + return nil, err + } + + return wResp.m, nil +} diff --git a/pkg/services/control/ir/server/calls.go b/pkg/services/control/ir/server/calls.go index c567eed7b9..a9ce3f0da2 100644 --- a/pkg/services/control/ir/server/calls.go +++ b/pkg/services/control/ir/server/calls.go @@ -3,6 +3,7 @@ package control import ( "context" + "github.com/nspcc-dev/neo-go/pkg/util" control "github.com/nspcc-dev/neofs-node/pkg/services/control/ir" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -32,3 +33,90 @@ func (s *Server) HealthCheck(_ context.Context, req *control.HealthCheckRequest) return resp, nil } + +// NotaryList returns list of transactions dumbs of the IR notary requests. +// +// If request is not signed with a key from white list, permission error returns. +func (s *Server) NotaryList(_ context.Context, req *control.NotaryListRequest) (*control.NotaryListResponse, error) { + if err := s.isValidRequest(req); err != nil { + return nil, status.Error(codes.PermissionDenied, err.Error()) + } + + resp := new(control.NotaryListResponse) + + body := new(control.NotaryListResponse_Body) + resp.SetBody(body) + + txs, err := s.prm.notaryManager.ListNotaryRequests() + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + txsInfo := make([]*control.TransactionInfo, 0, len(txs)) + for _, tx := range txs { + txsInfo = append(txsInfo, &control.TransactionInfo{ + Hash: tx.BytesBE(), + }) + } + body.SetTransactions(txsInfo) + + if err := SignMessage(&s.prm.key.PrivateKey, resp); err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return resp, nil +} + +// NotaryRequest create and send notary request and returns a hash of this request. +// +// If request is not signed with a key from white list, permission error returns. +func (s *Server) NotaryRequest(_ context.Context, req *control.NotaryRequestRequest) (*control.NotaryRequestResponse, error) { + if err := s.isValidRequest(req); err != nil { + return nil, status.Error(codes.PermissionDenied, err.Error()) + } + + resp := new(control.NotaryRequestResponse) + + body := new(control.NotaryRequestResponse_Body) + resp.SetBody(body) + + hash, err := s.prm.notaryManager.RequestNotary(req.GetBody().GetMethod(), req.GetBody().Args...) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + body.SetHash(hash.BytesBE()) + + if err := SignMessage(&s.prm.key.PrivateKey, resp); err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return resp, nil +} + +// NotarySign send notary request to forceful container removal and returns a hash of this request. +// +// If request is not signed with a key from white list, permission error returns. +func (s *Server) NotarySign(_ context.Context, req *control.NotarySignRequest) (*control.NotarySignResponse, error) { + if err := s.isValidRequest(req); err != nil { + return nil, status.Error(codes.PermissionDenied, err.Error()) + } + + resp := new(control.NotarySignResponse) + + body := new(control.NotarySignResponse_Body) + resp.SetBody(body) + + hash, err := util.Uint256DecodeBytesBE(req.GetBody().GetHash()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + err = s.prm.notaryManager.SignNotary(hash) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + if err := SignMessage(&s.prm.key.PrivateKey, resp); err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return resp, nil +} diff --git a/pkg/services/control/ir/server/deps.go b/pkg/services/control/ir/server/deps.go index 9b38101b40..b4efe9ad3c 100644 --- a/pkg/services/control/ir/server/deps.go +++ b/pkg/services/control/ir/server/deps.go @@ -1,6 +1,9 @@ package control -import control "github.com/nspcc-dev/neofs-node/pkg/services/control/ir" +import ( + "github.com/nspcc-dev/neo-go/pkg/util" + control "github.com/nspcc-dev/neofs-node/pkg/services/control/ir" +) // HealthChecker is component interface for calculating // the current health status of a node. @@ -11,3 +14,15 @@ type HealthChecker interface { // control.HealthStatus_HEALTH_STATUS_UNDEFINED should be returned. HealthStatus() control.HealthStatus } + +// NotaryManager is component interface for working with the network. +type NotaryManager interface { + // ListNotaryRequests must return a list of hashes from notary pool. + ListNotaryRequests() ([]util.Uint256, error) + + // RequestNotary must send a notary request with the given method and arguments. + RequestNotary(method string, args ...[]byte) (util.Uint256, error) + + // SignNotary must sign an existing notary transaction with the given hash. + SignNotary(hash util.Uint256) error +} diff --git a/pkg/services/control/ir/server/prm.go b/pkg/services/control/ir/server/prm.go index b4f1f25179..41a002e09c 100644 --- a/pkg/services/control/ir/server/prm.go +++ b/pkg/services/control/ir/server/prm.go @@ -10,6 +10,7 @@ type Prm struct { key keys.PrivateKey healthChecker HealthChecker + notaryManager NotaryManager } // SetPrivateKey sets private key to sign responses. @@ -22,3 +23,9 @@ func (x *Prm) SetPrivateKey(key keys.PrivateKey) { func (x *Prm) SetHealthChecker(hc HealthChecker) { x.healthChecker = hc } + +// SetNetworkManager sets NotaryManager to calculate +// health status. +func (x *Prm) SetNetworkManager(nm NotaryManager) { + x.notaryManager = nm +} diff --git a/pkg/services/control/ir/server/server.go b/pkg/services/control/ir/server/server.go index c75c1504e1..1dfd1db5d7 100644 --- a/pkg/services/control/ir/server/server.go +++ b/pkg/services/control/ir/server/server.go @@ -24,7 +24,8 @@ func panicOnPrmValue(n string, v any) { // // Panics if: // - parameterized private key is nil; -// - parameterized HealthChecker is nil. +// - parameterized HealthChecker is nil; +// - parameterized NotaryManager is nil. // // Forms white list from all keys specified via // WithAllowedKeys option and a public key of @@ -34,6 +35,8 @@ func New(prm Prm, opts ...Option) *Server { switch { case prm.healthChecker == nil: panicOnPrmValue("health checker", prm.healthChecker) + case prm.notaryManager == nil: + panicOnPrmValue("notary manager", prm.notaryManager) } // compute optional parameters diff --git a/pkg/services/control/ir/service.go b/pkg/services/control/ir/service.go index dc04e49043..7b3186b387 100644 --- a/pkg/services/control/ir/service.go +++ b/pkg/services/control/ir/service.go @@ -20,3 +20,80 @@ func (x *HealthCheckResponse) SetBody(v *HealthCheckResponse_Body) { x.Body = v } } + +// SetBody sets notary list request body. +func (x *NotaryListRequest) SetBody(v *NotaryListRequest_Body) { + if x != nil { + x.Body = v + } +} + +// SetTransactions sets list of transactions of the IR notary requests. +func (x *NotaryListResponse_Body) SetTransactions(v []*TransactionInfo) { + if x != nil { + x.Transactions = v + } +} + +// SetBody sets network list response body. +func (x *NotaryListResponse) SetBody(v *NotaryListResponse_Body) { + if x != nil { + x.Body = v + } +} + +// SetMethod sets notary transaction method to request body. +func (x *NotaryRequestRequest_Body) SetMethod(v string) { + if x != nil { + x.Method = v + } +} + +// SetArgs sets notary transaction args to request body. +func (x *NotaryRequestRequest_Body) SetArgs(v [][]byte) { + if x != nil { + x.Args = v + } +} + +// SetBody sets notary request request body. +func (x *NotaryRequestRequest) SetBody(v *NotaryRequestRequest_Body) { + if x != nil { + x.Body = v + } +} + +// SetHash sets hash of the IR notary request. +func (x *NotaryRequestResponse_Body) SetHash(v []byte) { + if x != nil { + x.Hash = v + } +} + +// SetBody sets network epoch tick response body. +func (x *NotaryRequestResponse) SetBody(v *NotaryRequestResponse_Body) { + if x != nil { + x.Body = v + } +} + +// SetHash sets hash of the IR notary request to tick epoch. +func (x *NotarySignRequest_Body) SetHash(v []byte) { + if x != nil { + x.Hash = v + } +} + +// SetBody sets notary sign request body. +func (x *NotarySignRequest) SetBody(v *NotarySignRequest_Body) { + if x != nil { + x.Body = v + } +} + +// SetBody sets notary sign response body. +func (x *NotarySignResponse) SetBody(v *NotarySignResponse_Body) { + if x != nil { + x.Body = v + } +} diff --git a/pkg/services/control/ir/service.pb.go b/pkg/services/control/ir/service.pb.go index 47c65adf5c..3a286e8c6a 100644 --- a/pkg/services/control/ir/service.pb.go +++ b/pkg/services/control/ir/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.21.9 +// protoc-gen-go v1.34.2 +// protoc v5.28.0 // source: pkg/services/control/ir/service.proto package control @@ -138,6 +138,354 @@ func (x *HealthCheckResponse) GetSignature() *Signature { return nil } +// NotaryList request. +type NotaryListRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of request message. + Body *NotaryListRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Body signature. + Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *NotaryListRequest) Reset() { + *x = NotaryListRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotaryListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotaryListRequest) ProtoMessage() {} + +func (x *NotaryListRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotaryListRequest.ProtoReflect.Descriptor instead. +func (*NotaryListRequest) Descriptor() ([]byte, []int) { + return file_pkg_services_control_ir_service_proto_rawDescGZIP(), []int{2} +} + +func (x *NotaryListRequest) GetBody() *NotaryListRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *NotaryListRequest) GetSignature() *Signature { + if x != nil { + return x.Signature + } + return nil +} + +// NotaryList response. +type NotaryListResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of request message. + Body *NotaryListResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Body signature. + Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *NotaryListResponse) Reset() { + *x = NotaryListResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotaryListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotaryListResponse) ProtoMessage() {} + +func (x *NotaryListResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotaryListResponse.ProtoReflect.Descriptor instead. +func (*NotaryListResponse) Descriptor() ([]byte, []int) { + return file_pkg_services_control_ir_service_proto_rawDescGZIP(), []int{3} +} + +func (x *NotaryListResponse) GetBody() *NotaryListResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *NotaryListResponse) GetSignature() *Signature { + if x != nil { + return x.Signature + } + return nil +} + +// NotaryRequest request. +type NotaryRequestRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of request message. + Body *NotaryRequestRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Body signature. + Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *NotaryRequestRequest) Reset() { + *x = NotaryRequestRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotaryRequestRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotaryRequestRequest) ProtoMessage() {} + +func (x *NotaryRequestRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotaryRequestRequest.ProtoReflect.Descriptor instead. +func (*NotaryRequestRequest) Descriptor() ([]byte, []int) { + return file_pkg_services_control_ir_service_proto_rawDescGZIP(), []int{4} +} + +func (x *NotaryRequestRequest) GetBody() *NotaryRequestRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *NotaryRequestRequest) GetSignature() *Signature { + if x != nil { + return x.Signature + } + return nil +} + +// NotaryRequest response. +type NotaryRequestResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of request message. + Body *NotaryRequestResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Body signature. + Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *NotaryRequestResponse) Reset() { + *x = NotaryRequestResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotaryRequestResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotaryRequestResponse) ProtoMessage() {} + +func (x *NotaryRequestResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotaryRequestResponse.ProtoReflect.Descriptor instead. +func (*NotaryRequestResponse) Descriptor() ([]byte, []int) { + return file_pkg_services_control_ir_service_proto_rawDescGZIP(), []int{5} +} + +func (x *NotaryRequestResponse) GetBody() *NotaryRequestResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *NotaryRequestResponse) GetSignature() *Signature { + if x != nil { + return x.Signature + } + return nil +} + +// NotarySign request. +type NotarySignRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of request message. + Body *NotarySignRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Body signature. + Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *NotarySignRequest) Reset() { + *x = NotarySignRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotarySignRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotarySignRequest) ProtoMessage() {} + +func (x *NotarySignRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotarySignRequest.ProtoReflect.Descriptor instead. +func (*NotarySignRequest) Descriptor() ([]byte, []int) { + return file_pkg_services_control_ir_service_proto_rawDescGZIP(), []int{6} +} + +func (x *NotarySignRequest) GetBody() *NotarySignRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *NotarySignRequest) GetSignature() *Signature { + if x != nil { + return x.Signature + } + return nil +} + +// NotarySign response. +type NotarySignResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of request message. + Body *NotarySignResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Body signature. + Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *NotarySignResponse) Reset() { + *x = NotarySignResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotarySignResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotarySignResponse) ProtoMessage() {} + +func (x *NotarySignResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotarySignResponse.ProtoReflect.Descriptor instead. +func (*NotarySignResponse) Descriptor() ([]byte, []int) { + return file_pkg_services_control_ir_service_proto_rawDescGZIP(), []int{7} +} + +func (x *NotarySignResponse) GetBody() *NotarySignResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *NotarySignResponse) GetSignature() *Signature { + if x != nil { + return x.Signature + } + return nil +} + // Health check request body. type HealthCheckRequest_Body struct { state protoimpl.MessageState @@ -145,23 +493,153 @@ type HealthCheckRequest_Body struct { unknownFields protoimpl.UnknownFields } -func (x *HealthCheckRequest_Body) Reset() { - *x = HealthCheckRequest_Body{} +func (x *HealthCheckRequest_Body) Reset() { + *x = HealthCheckRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HealthCheckRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HealthCheckRequest_Body) ProtoMessage() {} + +func (x *HealthCheckRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HealthCheckRequest_Body.ProtoReflect.Descriptor instead. +func (*HealthCheckRequest_Body) Descriptor() ([]byte, []int) { + return file_pkg_services_control_ir_service_proto_rawDescGZIP(), []int{0, 0} +} + +// Health check response body +type HealthCheckResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Health status of IR node application. + HealthStatus HealthStatus `protobuf:"varint,1,opt,name=health_status,json=healthStatus,proto3,enum=ircontrol.HealthStatus" json:"health_status,omitempty"` +} + +func (x *HealthCheckResponse_Body) Reset() { + *x = HealthCheckResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HealthCheckResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HealthCheckResponse_Body) ProtoMessage() {} + +func (x *HealthCheckResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HealthCheckResponse_Body.ProtoReflect.Descriptor instead. +func (*HealthCheckResponse_Body) Descriptor() ([]byte, []int) { + return file_pkg_services_control_ir_service_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *HealthCheckResponse_Body) GetHealthStatus() HealthStatus { + if x != nil { + return x.HealthStatus + } + return HealthStatus_HEALTH_STATUS_UNDEFINED +} + +// Request body structure. +type NotaryListRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *NotaryListRequest_Body) Reset() { + *x = NotaryListRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotaryListRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotaryListRequest_Body) ProtoMessage() {} + +func (x *NotaryListRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotaryListRequest_Body.ProtoReflect.Descriptor instead. +func (*NotaryListRequest_Body) Descriptor() ([]byte, []int) { + return file_pkg_services_control_ir_service_proto_rawDescGZIP(), []int{2, 0} +} + +// Request body structure. +type NotaryListResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Transaction of the notary request. + Transactions []*TransactionInfo `protobuf:"bytes,1,rep,name=transactions,proto3" json:"transactions,omitempty"` +} + +func (x *NotaryListResponse_Body) Reset() { + *x = NotaryListResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_services_control_ir_service_proto_msgTypes[2] + mi := &file_pkg_services_control_ir_service_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *HealthCheckRequest_Body) String() string { +func (x *NotaryListResponse_Body) String() string { return protoimpl.X.MessageStringOf(x) } -func (*HealthCheckRequest_Body) ProtoMessage() {} +func (*NotaryListResponse_Body) ProtoMessage() {} -func (x *HealthCheckRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_pkg_services_control_ir_service_proto_msgTypes[2] +func (x *NotaryListResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -172,38 +650,45 @@ func (x *HealthCheckRequest_Body) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use HealthCheckRequest_Body.ProtoReflect.Descriptor instead. -func (*HealthCheckRequest_Body) Descriptor() ([]byte, []int) { - return file_pkg_services_control_ir_service_proto_rawDescGZIP(), []int{0, 0} +// Deprecated: Use NotaryListResponse_Body.ProtoReflect.Descriptor instead. +func (*NotaryListResponse_Body) Descriptor() ([]byte, []int) { + return file_pkg_services_control_ir_service_proto_rawDescGZIP(), []int{3, 0} } -// Health check response body -type HealthCheckResponse_Body struct { +func (x *NotaryListResponse_Body) GetTransactions() []*TransactionInfo { + if x != nil { + return x.Transactions + } + return nil +} + +// Request body structure. +type NotaryRequestRequest_Body struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Health status of IR node application. - HealthStatus HealthStatus `protobuf:"varint,1,opt,name=health_status,json=healthStatus,proto3,enum=ircontrol.HealthStatus" json:"health_status,omitempty"` + Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` + Args [][]byte `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"` } -func (x *HealthCheckResponse_Body) Reset() { - *x = HealthCheckResponse_Body{} +func (x *NotaryRequestRequest_Body) Reset() { + *x = NotaryRequestRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_services_control_ir_service_proto_msgTypes[3] + mi := &file_pkg_services_control_ir_service_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *HealthCheckResponse_Body) String() string { +func (x *NotaryRequestRequest_Body) String() string { return protoimpl.X.MessageStringOf(x) } -func (*HealthCheckResponse_Body) ProtoMessage() {} +func (*NotaryRequestRequest_Body) ProtoMessage() {} -func (x *HealthCheckResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_pkg_services_control_ir_service_proto_msgTypes[3] +func (x *NotaryRequestRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -214,16 +699,160 @@ func (x *HealthCheckResponse_Body) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use HealthCheckResponse_Body.ProtoReflect.Descriptor instead. -func (*HealthCheckResponse_Body) Descriptor() ([]byte, []int) { - return file_pkg_services_control_ir_service_proto_rawDescGZIP(), []int{1, 0} +// Deprecated: Use NotaryRequestRequest_Body.ProtoReflect.Descriptor instead. +func (*NotaryRequestRequest_Body) Descriptor() ([]byte, []int) { + return file_pkg_services_control_ir_service_proto_rawDescGZIP(), []int{4, 0} } -func (x *HealthCheckResponse_Body) GetHealthStatus() HealthStatus { +func (x *NotaryRequestRequest_Body) GetMethod() string { if x != nil { - return x.HealthStatus + return x.Method } - return HealthStatus_HEALTH_STATUS_UNDEFINED + return "" +} + +func (x *NotaryRequestRequest_Body) GetArgs() [][]byte { + if x != nil { + return x.Args + } + return nil +} + +// Request body structure. +type NotaryRequestResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Result hash of transaction. + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (x *NotaryRequestResponse_Body) Reset() { + *x = NotaryRequestResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotaryRequestResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotaryRequestResponse_Body) ProtoMessage() {} + +func (x *NotaryRequestResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotaryRequestResponse_Body.ProtoReflect.Descriptor instead. +func (*NotaryRequestResponse_Body) Descriptor() ([]byte, []int) { + return file_pkg_services_control_ir_service_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *NotaryRequestResponse_Body) GetHash() []byte { + if x != nil { + return x.Hash + } + return nil +} + +// Request body structure. +type NotarySignRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Hash of transaction that need to be signed. + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (x *NotarySignRequest_Body) Reset() { + *x = NotarySignRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotarySignRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotarySignRequest_Body) ProtoMessage() {} + +func (x *NotarySignRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotarySignRequest_Body.ProtoReflect.Descriptor instead. +func (*NotarySignRequest_Body) Descriptor() ([]byte, []int) { + return file_pkg_services_control_ir_service_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *NotarySignRequest_Body) GetHash() []byte { + if x != nil { + return x.Hash + } + return nil +} + +// Request body structure. +type NotarySignResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *NotarySignResponse_Body) Reset() { + *x = NotarySignResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotarySignResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotarySignResponse_Body) ProtoMessage() {} + +func (x *NotarySignResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_pkg_services_control_ir_service_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotarySignResponse_Body.ProtoReflect.Descriptor instead. +func (*NotarySignResponse_Body) Descriptor() ([]byte, []int) { + return file_pkg_services_control_ir_service_proto_rawDescGZIP(), []int{7, 0} } var File_pkg_services_control_ir_service_proto protoreflect.FileDescriptor @@ -255,17 +884,94 @@ var file_pkg_services_control_ir_service_proto_rawDesc = []byte{ 0x3c, 0x0a, 0x0d, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0x5e, 0x0a, - 0x0e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x4c, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1d, - 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, - 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x39, 0x5a, - 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, - 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x6e, 0x6f, 0x64, 0x65, - 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x69, 0x72, - 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x86, 0x01, + 0x0a, 0x11, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x4e, 0x6f, + 0x74, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x32, 0x0a, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x06, + 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xc8, 0x01, 0x0a, 0x12, 0x4e, 0x6f, 0x74, 0x61, 0x72, + 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x72, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x32, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x46, 0x0a, 0x04, 0x42, 0x6f, 0x64, + 0x79, 0x12, 0x3e, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x22, 0xb8, 0x01, 0x0a, 0x14, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x12, 0x32, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x32, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, + 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0xa2, 0x01, 0x0a, + 0x15, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x2e, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x12, 0x32, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x1a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x12, 0x0a, + 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, + 0x68, 0x22, 0x9a, 0x01, 0x0a, 0x11, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x2e, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x32, + 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x1a, 0x1a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x22, 0x88, + 0x01, 0x0a, 0x12, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, + 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x32, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x1a, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x32, 0xc8, 0x02, 0x0a, 0x0e, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x0b, + 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1d, 0x2e, 0x69, 0x72, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x69, 0x72, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x4e, 0x6f, + 0x74, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x2e, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x2e, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x2e, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x4e, 0x6f, 0x74, + 0x61, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x1c, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x2e, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x69, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x2e, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x6f, + 0x66, 0x73, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x2f, 0x69, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -280,28 +986,60 @@ func file_pkg_services_control_ir_service_proto_rawDescGZIP() []byte { return file_pkg_services_control_ir_service_proto_rawDescData } -var file_pkg_services_control_ir_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_pkg_services_control_ir_service_proto_goTypes = []interface{}{ - (*HealthCheckRequest)(nil), // 0: ircontrol.HealthCheckRequest - (*HealthCheckResponse)(nil), // 1: ircontrol.HealthCheckResponse - (*HealthCheckRequest_Body)(nil), // 2: ircontrol.HealthCheckRequest.Body - (*HealthCheckResponse_Body)(nil), // 3: ircontrol.HealthCheckResponse.Body - (*Signature)(nil), // 4: ircontrol.Signature - (HealthStatus)(0), // 5: ircontrol.HealthStatus +var file_pkg_services_control_ir_service_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_pkg_services_control_ir_service_proto_goTypes = []any{ + (*HealthCheckRequest)(nil), // 0: ircontrol.HealthCheckRequest + (*HealthCheckResponse)(nil), // 1: ircontrol.HealthCheckResponse + (*NotaryListRequest)(nil), // 2: ircontrol.NotaryListRequest + (*NotaryListResponse)(nil), // 3: ircontrol.NotaryListResponse + (*NotaryRequestRequest)(nil), // 4: ircontrol.NotaryRequestRequest + (*NotaryRequestResponse)(nil), // 5: ircontrol.NotaryRequestResponse + (*NotarySignRequest)(nil), // 6: ircontrol.NotarySignRequest + (*NotarySignResponse)(nil), // 7: ircontrol.NotarySignResponse + (*HealthCheckRequest_Body)(nil), // 8: ircontrol.HealthCheckRequest.Body + (*HealthCheckResponse_Body)(nil), // 9: ircontrol.HealthCheckResponse.Body + (*NotaryListRequest_Body)(nil), // 10: ircontrol.NotaryListRequest.Body + (*NotaryListResponse_Body)(nil), // 11: ircontrol.NotaryListResponse.Body + (*NotaryRequestRequest_Body)(nil), // 12: ircontrol.NotaryRequestRequest.Body + (*NotaryRequestResponse_Body)(nil), // 13: ircontrol.NotaryRequestResponse.Body + (*NotarySignRequest_Body)(nil), // 14: ircontrol.NotarySignRequest.Body + (*NotarySignResponse_Body)(nil), // 15: ircontrol.NotarySignResponse.Body + (*Signature)(nil), // 16: ircontrol.Signature + (HealthStatus)(0), // 17: ircontrol.HealthStatus + (*TransactionInfo)(nil), // 18: ircontrol.TransactionInfo } var file_pkg_services_control_ir_service_proto_depIdxs = []int32{ - 2, // 0: ircontrol.HealthCheckRequest.body:type_name -> ircontrol.HealthCheckRequest.Body - 4, // 1: ircontrol.HealthCheckRequest.signature:type_name -> ircontrol.Signature - 3, // 2: ircontrol.HealthCheckResponse.body:type_name -> ircontrol.HealthCheckResponse.Body - 4, // 3: ircontrol.HealthCheckResponse.signature:type_name -> ircontrol.Signature - 5, // 4: ircontrol.HealthCheckResponse.Body.health_status:type_name -> ircontrol.HealthStatus - 0, // 5: ircontrol.ControlService.HealthCheck:input_type -> ircontrol.HealthCheckRequest - 1, // 6: ircontrol.ControlService.HealthCheck:output_type -> ircontrol.HealthCheckResponse - 6, // [6:7] is the sub-list for method output_type - 5, // [5:6] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 8, // 0: ircontrol.HealthCheckRequest.body:type_name -> ircontrol.HealthCheckRequest.Body + 16, // 1: ircontrol.HealthCheckRequest.signature:type_name -> ircontrol.Signature + 9, // 2: ircontrol.HealthCheckResponse.body:type_name -> ircontrol.HealthCheckResponse.Body + 16, // 3: ircontrol.HealthCheckResponse.signature:type_name -> ircontrol.Signature + 10, // 4: ircontrol.NotaryListRequest.body:type_name -> ircontrol.NotaryListRequest.Body + 16, // 5: ircontrol.NotaryListRequest.signature:type_name -> ircontrol.Signature + 11, // 6: ircontrol.NotaryListResponse.body:type_name -> ircontrol.NotaryListResponse.Body + 16, // 7: ircontrol.NotaryListResponse.signature:type_name -> ircontrol.Signature + 12, // 8: ircontrol.NotaryRequestRequest.body:type_name -> ircontrol.NotaryRequestRequest.Body + 16, // 9: ircontrol.NotaryRequestRequest.signature:type_name -> ircontrol.Signature + 13, // 10: ircontrol.NotaryRequestResponse.body:type_name -> ircontrol.NotaryRequestResponse.Body + 16, // 11: ircontrol.NotaryRequestResponse.signature:type_name -> ircontrol.Signature + 14, // 12: ircontrol.NotarySignRequest.body:type_name -> ircontrol.NotarySignRequest.Body + 16, // 13: ircontrol.NotarySignRequest.signature:type_name -> ircontrol.Signature + 15, // 14: ircontrol.NotarySignResponse.body:type_name -> ircontrol.NotarySignResponse.Body + 16, // 15: ircontrol.NotarySignResponse.signature:type_name -> ircontrol.Signature + 17, // 16: ircontrol.HealthCheckResponse.Body.health_status:type_name -> ircontrol.HealthStatus + 18, // 17: ircontrol.NotaryListResponse.Body.transactions:type_name -> ircontrol.TransactionInfo + 0, // 18: ircontrol.ControlService.HealthCheck:input_type -> ircontrol.HealthCheckRequest + 2, // 19: ircontrol.ControlService.NotaryList:input_type -> ircontrol.NotaryListRequest + 4, // 20: ircontrol.ControlService.NotaryRequest:input_type -> ircontrol.NotaryRequestRequest + 6, // 21: ircontrol.ControlService.NotarySign:input_type -> ircontrol.NotarySignRequest + 1, // 22: ircontrol.ControlService.HealthCheck:output_type -> ircontrol.HealthCheckResponse + 3, // 23: ircontrol.ControlService.NotaryList:output_type -> ircontrol.NotaryListResponse + 5, // 24: ircontrol.ControlService.NotaryRequest:output_type -> ircontrol.NotaryRequestResponse + 7, // 25: ircontrol.ControlService.NotarySign:output_type -> ircontrol.NotarySignResponse + 22, // [22:26] is the sub-list for method output_type + 18, // [18:22] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_pkg_services_control_ir_service_proto_init() } @@ -311,7 +1049,7 @@ func file_pkg_services_control_ir_service_proto_init() { } file_pkg_services_control_ir_types_proto_init() if !protoimpl.UnsafeEnabled { - file_pkg_services_control_ir_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_pkg_services_control_ir_service_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*HealthCheckRequest); i { case 0: return &v.state @@ -323,7 +1061,7 @@ func file_pkg_services_control_ir_service_proto_init() { return nil } } - file_pkg_services_control_ir_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_pkg_services_control_ir_service_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*HealthCheckResponse); i { case 0: return &v.state @@ -335,7 +1073,79 @@ func file_pkg_services_control_ir_service_proto_init() { return nil } } - file_pkg_services_control_ir_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_pkg_services_control_ir_service_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*NotaryListRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_services_control_ir_service_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*NotaryListResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_services_control_ir_service_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*NotaryRequestRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_services_control_ir_service_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*NotaryRequestResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_services_control_ir_service_proto_msgTypes[6].Exporter = func(v any, i int) any { + switch v := v.(*NotarySignRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_services_control_ir_service_proto_msgTypes[7].Exporter = func(v any, i int) any { + switch v := v.(*NotarySignResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_services_control_ir_service_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*HealthCheckRequest_Body); i { case 0: return &v.state @@ -347,7 +1157,7 @@ func file_pkg_services_control_ir_service_proto_init() { return nil } } - file_pkg_services_control_ir_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_pkg_services_control_ir_service_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*HealthCheckResponse_Body); i { case 0: return &v.state @@ -359,6 +1169,78 @@ func file_pkg_services_control_ir_service_proto_init() { return nil } } + file_pkg_services_control_ir_service_proto_msgTypes[10].Exporter = func(v any, i int) any { + switch v := v.(*NotaryListRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_services_control_ir_service_proto_msgTypes[11].Exporter = func(v any, i int) any { + switch v := v.(*NotaryListResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_services_control_ir_service_proto_msgTypes[12].Exporter = func(v any, i int) any { + switch v := v.(*NotaryRequestRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_services_control_ir_service_proto_msgTypes[13].Exporter = func(v any, i int) any { + switch v := v.(*NotaryRequestResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_services_control_ir_service_proto_msgTypes[14].Exporter = func(v any, i int) any { + switch v := v.(*NotarySignRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_services_control_ir_service_proto_msgTypes[15].Exporter = func(v any, i int) any { + switch v := v.(*NotarySignResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -366,7 +1248,7 @@ func file_pkg_services_control_ir_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pkg_services_control_ir_service_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 16, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/services/control/ir/service.proto b/pkg/services/control/ir/service.proto index e330d0fcfa..3576ac8bff 100644 --- a/pkg/services/control/ir/service.proto +++ b/pkg/services/control/ir/service.proto @@ -10,6 +10,15 @@ option go_package = "github.com/nspcc-dev/neofs-node/pkg/services/ir/control"; service ControlService { // Performs health check of the IR node. rpc HealthCheck (HealthCheckRequest) returns (HealthCheckResponse); + + // NotaryList list notary requests from the network. + rpc NotaryList (NotaryListRequest) returns (NotaryListResponse); + + // NotaryRequest create and send notary request to the network. + rpc NotaryRequest (NotaryRequestRequest) returns (NotaryRequestResponse); + + // NotarySign sign a notary request by it hash. + rpc NotarySign (NotarySignRequest) returns (NotarySignResponse); } // Health check request. @@ -41,3 +50,89 @@ message HealthCheckResponse { // Body signature. Signature signature = 2; } + +// NotaryList request. +message NotaryListRequest { + // Request body structure. + message Body { + } + + // Body of request message. + Body body = 1; + + // Body signature. + Signature signature = 2; +} + +// NotaryList response. +message NotaryListResponse { + // Request body structure. + message Body { + // Transaction of the notary request. + repeated TransactionInfo transactions = 1; + } + + // Body of request message. + Body body = 1; + + // Body signature. + Signature signature = 2; +} + +// NotaryRequest request. +message NotaryRequestRequest { + // Request body structure. + message Body { + string method = 1; + repeated bytes args = 2; + } + + // Body of request message. + Body body = 1; + + // Body signature. + Signature signature = 2; +} + +// NotaryRequest response. +message NotaryRequestResponse { + // Request body structure. + message Body { + // Result hash of transaction. + bytes hash = 1; + } + + // Body of request message. + Body body = 1; + + // Body signature. + Signature signature = 2; +} + +// NotarySign request. +message NotarySignRequest { + // Request body structure. + message Body { + // Hash of transaction that need to be signed. + bytes hash = 1; + } + + // Body of request message. + Body body = 1; + + // Body signature. + Signature signature = 2; +} + +// NotarySign response. +message NotarySignResponse { + // Request body structure. + message Body { + } + + // Body of request message. + Body body = 1; + + // Body signature. + Signature signature = 2; +} \ No newline at end of file diff --git a/pkg/services/control/ir/service_grpc.pb.go b/pkg/services/control/ir/service_grpc.pb.go index 052c263426..29bc3cf211 100644 --- a/pkg/services/control/ir/service_grpc.pb.go +++ b/pkg/services/control/ir/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.9 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.28.0 // source: pkg/services/control/ir/service.proto package control @@ -15,19 +15,30 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( - ControlService_HealthCheck_FullMethodName = "/ircontrol.ControlService/HealthCheck" + ControlService_HealthCheck_FullMethodName = "/ircontrol.ControlService/HealthCheck" + ControlService_NotaryList_FullMethodName = "/ircontrol.ControlService/NotaryList" + ControlService_NotaryRequest_FullMethodName = "/ircontrol.ControlService/NotaryRequest" + ControlService_NotarySign_FullMethodName = "/ircontrol.ControlService/NotarySign" ) // ControlServiceClient is the client API for ControlService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// `ControlService` provides an interface for internal work with the Inner Ring node. type ControlServiceClient interface { // Performs health check of the IR node. HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) + // NotaryList list notary requests from the network. + NotaryList(ctx context.Context, in *NotaryListRequest, opts ...grpc.CallOption) (*NotaryListResponse, error) + // NotaryRequest create and send notary request to the network. + NotaryRequest(ctx context.Context, in *NotaryRequestRequest, opts ...grpc.CallOption) (*NotaryRequestResponse, error) + // NotarySign sign a notary request by it hash. + NotarySign(ctx context.Context, in *NotarySignRequest, opts ...grpc.CallOption) (*NotarySignResponse, error) } type controlServiceClient struct { @@ -39,8 +50,39 @@ func NewControlServiceClient(cc grpc.ClientConnInterface) ControlServiceClient { } func (c *controlServiceClient) HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(HealthCheckResponse) - err := c.cc.Invoke(ctx, ControlService_HealthCheck_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ControlService_HealthCheck_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controlServiceClient) NotaryList(ctx context.Context, in *NotaryListRequest, opts ...grpc.CallOption) (*NotaryListResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(NotaryListResponse) + err := c.cc.Invoke(ctx, ControlService_NotaryList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controlServiceClient) NotaryRequest(ctx context.Context, in *NotaryRequestRequest, opts ...grpc.CallOption) (*NotaryRequestResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(NotaryRequestResponse) + err := c.cc.Invoke(ctx, ControlService_NotaryRequest_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controlServiceClient) NotarySign(ctx context.Context, in *NotarySignRequest, opts ...grpc.CallOption) (*NotarySignResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(NotarySignResponse) + err := c.cc.Invoke(ctx, ControlService_NotarySign_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -49,19 +91,40 @@ func (c *controlServiceClient) HealthCheck(ctx context.Context, in *HealthCheckR // ControlServiceServer is the server API for ControlService service. // All implementations should embed UnimplementedControlServiceServer -// for forward compatibility +// for forward compatibility. +// +// `ControlService` provides an interface for internal work with the Inner Ring node. type ControlServiceServer interface { // Performs health check of the IR node. HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) + // NotaryList list notary requests from the network. + NotaryList(context.Context, *NotaryListRequest) (*NotaryListResponse, error) + // NotaryRequest create and send notary request to the network. + NotaryRequest(context.Context, *NotaryRequestRequest) (*NotaryRequestResponse, error) + // NotarySign sign a notary request by it hash. + NotarySign(context.Context, *NotarySignRequest) (*NotarySignResponse, error) } -// UnimplementedControlServiceServer should be embedded to have forward compatible implementations. -type UnimplementedControlServiceServer struct { -} +// UnimplementedControlServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedControlServiceServer struct{} func (UnimplementedControlServiceServer) HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method HealthCheck not implemented") } +func (UnimplementedControlServiceServer) NotaryList(context.Context, *NotaryListRequest) (*NotaryListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NotaryList not implemented") +} +func (UnimplementedControlServiceServer) NotaryRequest(context.Context, *NotaryRequestRequest) (*NotaryRequestResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NotaryRequest not implemented") +} +func (UnimplementedControlServiceServer) NotarySign(context.Context, *NotarySignRequest) (*NotarySignResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NotarySign not implemented") +} +func (UnimplementedControlServiceServer) testEmbeddedByValue() {} // UnsafeControlServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ControlServiceServer will @@ -71,6 +134,13 @@ type UnsafeControlServiceServer interface { } func RegisterControlServiceServer(s grpc.ServiceRegistrar, srv ControlServiceServer) { + // If the following call pancis, it indicates UnimplementedControlServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&ControlService_ServiceDesc, srv) } @@ -92,6 +162,60 @@ func _ControlService_HealthCheck_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } +func _ControlService_NotaryList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NotaryListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControlServiceServer).NotaryList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ControlService_NotaryList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControlServiceServer).NotaryList(ctx, req.(*NotaryListRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ControlService_NotaryRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NotaryRequestRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControlServiceServer).NotaryRequest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ControlService_NotaryRequest_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControlServiceServer).NotaryRequest(ctx, req.(*NotaryRequestRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ControlService_NotarySign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NotarySignRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControlServiceServer).NotarySign(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ControlService_NotarySign_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControlServiceServer).NotarySign(ctx, req.(*NotarySignRequest)) + } + return interceptor(ctx, in, info, handler) +} + // ControlService_ServiceDesc is the grpc.ServiceDesc for ControlService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -103,6 +227,18 @@ var ControlService_ServiceDesc = grpc.ServiceDesc{ MethodName: "HealthCheck", Handler: _ControlService_HealthCheck_Handler, }, + { + MethodName: "NotaryList", + Handler: _ControlService_NotaryList_Handler, + }, + { + MethodName: "NotaryRequest", + Handler: _ControlService_NotaryRequest_Handler, + }, + { + MethodName: "NotarySign", + Handler: _ControlService_NotarySign_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "pkg/services/control/ir/service.proto", diff --git a/pkg/services/control/ir/service_neofs.pb.go b/pkg/services/control/ir/service_neofs.pb.go index 77ce39f342..fa6e1664da 100644 --- a/pkg/services/control/ir/service_neofs.pb.go +++ b/pkg/services/control/ir/service_neofs.pb.go @@ -154,3 +154,471 @@ func (x *HealthCheckResponse) ReadSignedData(buf []byte) ([]byte, error) { func (x *HealthCheckResponse) SetSignature(sig *Signature) { x.Signature = sig } + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NotaryListRequest_Body) StableSize() (size int) { + return size +} + +// StableMarshal marshals x in protobuf binary format with stable field order. +// +// If buffer length is less than x.StableSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same binary format. +func (x *NotaryListRequest_Body) StableMarshal(buf []byte) []byte { + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NotaryListRequest) StableSize() (size int) { + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + return size +} + +// StableMarshal marshals x in protobuf binary format with stable field order. +// +// If buffer length is less than x.StableSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same binary format. +func (x *NotaryListRequest) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// ReadSignedData fills buf with signed data of x. +// If buffer length is less than x.SignedDataSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same signed data. +func (x *NotaryListRequest) SignedDataSize() int { + return x.GetBody().StableSize() +} + +// SignedDataSize returns size of the request signed data in bytes. +// +// Structures with the same field values have the same signed data size. +func (x *NotaryListRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *NotaryListRequest) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NotaryListResponse_Body) StableSize() (size int) { + for i := range x.Transactions { + size += proto.NestedStructureSize(1, x.Transactions[i]) + } + return size +} + +// StableMarshal marshals x in protobuf binary format with stable field order. +// +// If buffer length is less than x.StableSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same binary format. +func (x *NotaryListResponse_Body) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + for i := range x.Transactions { + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Transactions[i]) + } + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NotaryListResponse) StableSize() (size int) { + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + return size +} + +// StableMarshal marshals x in protobuf binary format with stable field order. +// +// If buffer length is less than x.StableSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same binary format. +func (x *NotaryListResponse) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// ReadSignedData fills buf with signed data of x. +// If buffer length is less than x.SignedDataSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same signed data. +func (x *NotaryListResponse) SignedDataSize() int { + return x.GetBody().StableSize() +} + +// SignedDataSize returns size of the request signed data in bytes. +// +// Structures with the same field values have the same signed data size. +func (x *NotaryListResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *NotaryListResponse) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NotaryRequestRequest_Body) StableSize() (size int) { + size += proto.StringSize(1, x.Method) + size += proto.RepeatedBytesSize(2, x.Args) + return size +} + +// StableMarshal marshals x in protobuf binary format with stable field order. +// +// If buffer length is less than x.StableSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same binary format. +func (x *NotaryRequestRequest_Body) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.StringMarshal(1, buf[offset:], x.Method) + offset += proto.RepeatedBytesMarshal(2, buf[offset:], x.Args) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NotaryRequestRequest) StableSize() (size int) { + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + return size +} + +// StableMarshal marshals x in protobuf binary format with stable field order. +// +// If buffer length is less than x.StableSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same binary format. +func (x *NotaryRequestRequest) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// ReadSignedData fills buf with signed data of x. +// If buffer length is less than x.SignedDataSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same signed data. +func (x *NotaryRequestRequest) SignedDataSize() int { + return x.GetBody().StableSize() +} + +// SignedDataSize returns size of the request signed data in bytes. +// +// Structures with the same field values have the same signed data size. +func (x *NotaryRequestRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *NotaryRequestRequest) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NotaryRequestResponse_Body) StableSize() (size int) { + size += proto.BytesSize(1, x.Hash) + return size +} + +// StableMarshal marshals x in protobuf binary format with stable field order. +// +// If buffer length is less than x.StableSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same binary format. +func (x *NotaryRequestResponse_Body) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.BytesMarshal(1, buf[offset:], x.Hash) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NotaryRequestResponse) StableSize() (size int) { + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + return size +} + +// StableMarshal marshals x in protobuf binary format with stable field order. +// +// If buffer length is less than x.StableSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same binary format. +func (x *NotaryRequestResponse) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// ReadSignedData fills buf with signed data of x. +// If buffer length is less than x.SignedDataSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same signed data. +func (x *NotaryRequestResponse) SignedDataSize() int { + return x.GetBody().StableSize() +} + +// SignedDataSize returns size of the request signed data in bytes. +// +// Structures with the same field values have the same signed data size. +func (x *NotaryRequestResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *NotaryRequestResponse) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NotarySignRequest_Body) StableSize() (size int) { + size += proto.BytesSize(1, x.Hash) + return size +} + +// StableMarshal marshals x in protobuf binary format with stable field order. +// +// If buffer length is less than x.StableSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same binary format. +func (x *NotarySignRequest_Body) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.BytesMarshal(1, buf[offset:], x.Hash) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NotarySignRequest) StableSize() (size int) { + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + return size +} + +// StableMarshal marshals x in protobuf binary format with stable field order. +// +// If buffer length is less than x.StableSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same binary format. +func (x *NotarySignRequest) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// ReadSignedData fills buf with signed data of x. +// If buffer length is less than x.SignedDataSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same signed data. +func (x *NotarySignRequest) SignedDataSize() int { + return x.GetBody().StableSize() +} + +// SignedDataSize returns size of the request signed data in bytes. +// +// Structures with the same field values have the same signed data size. +func (x *NotarySignRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *NotarySignRequest) SetSignature(sig *Signature) { + x.Signature = sig +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NotarySignResponse_Body) StableSize() (size int) { + return size +} + +// StableMarshal marshals x in protobuf binary format with stable field order. +// +// If buffer length is less than x.StableSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same binary format. +func (x *NotarySignResponse_Body) StableMarshal(buf []byte) []byte { + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NotarySignResponse) StableSize() (size int) { + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + return size +} + +// StableMarshal marshals x in protobuf binary format with stable field order. +// +// If buffer length is less than x.StableSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same binary format. +func (x *NotarySignResponse) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.NestedStructureMarshal(1, buf[offset:], x.Body) + offset += proto.NestedStructureMarshal(2, buf[offset:], x.Signature) + return buf +} + +// ReadSignedData fills buf with signed data of x. +// If buffer length is less than x.SignedDataSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same signed data. +func (x *NotarySignResponse) SignedDataSize() int { + return x.GetBody().StableSize() +} + +// SignedDataSize returns size of the request signed data in bytes. +// +// Structures with the same field values have the same signed data size. +func (x *NotarySignResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().StableMarshal(buf), nil +} + +func (x *NotarySignResponse) SetSignature(sig *Signature) { + x.Signature = sig +} diff --git a/pkg/services/control/ir/types.pb.go b/pkg/services/control/ir/types.pb.go index 7ac65414df..562b19dfb6 100644 --- a/pkg/services/control/ir/types.pb.go +++ b/pkg/services/control/ir/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.21.9 +// protoc-gen-go v1.34.2 +// protoc v5.28.0 // source: pkg/services/control/ir/types.proto package control @@ -31,8 +31,9 @@ const ( // IR application is started and serves all services. HealthStatus_READY HealthStatus = 2 // IR application is shutting down. - HealthStatus_SHUTTING_DOWN HealthStatus = 3 - HealthStatus_INITIALIZING_NETWORK HealthStatus = 5 + HealthStatus_SHUTTING_DOWN HealthStatus = 3 + // Initializing Neo network + HealthStatus_INITIALIZING_NETWORK HealthStatus = 4 ) // Enum value maps for HealthStatus. @@ -42,14 +43,14 @@ var ( 1: "STARTING", 2: "READY", 3: "SHUTTING_DOWN", - 5: "INITIALIZING_NETWORK", + 4: "INITIALIZING_NETWORK", } HealthStatus_value = map[string]int32{ "HEALTH_STATUS_UNDEFINED": 0, "STARTING": 1, "READY": 2, "SHUTTING_DOWN": 3, - "INITIALIZING_NETWORK": 5, + "INITIALIZING_NETWORK": 4, } ) @@ -138,6 +139,55 @@ func (x *Signature) GetSign() []byte { return nil } +// Info about transaction. +type TransactionInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Hash of transaction. + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (x *TransactionInfo) Reset() { + *x = TransactionInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_services_control_ir_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransactionInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionInfo) ProtoMessage() {} + +func (x *TransactionInfo) ProtoReflect() protoreflect.Message { + mi := &file_pkg_services_control_ir_types_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransactionInfo.ProtoReflect.Descriptor instead. +func (*TransactionInfo) Descriptor() ([]byte, []int) { + return file_pkg_services_control_ir_types_proto_rawDescGZIP(), []int{1} +} + +func (x *TransactionInfo) GetHash() []byte { + if x != nil { + return x.Hash + } + return nil +} + var File_pkg_services_control_ir_types_proto protoreflect.FileDescriptor var file_pkg_services_control_ir_types_proto_rawDesc = []byte{ @@ -147,18 +197,21 @@ var file_pkg_services_control_ir_types_proto_rawDesc = []byte{ 0x22, 0x36, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2a, 0x71, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x6c, - 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x17, 0x48, 0x45, 0x41, 0x4c, - 0x54, 0x48, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, - 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x54, 0x41, 0x52, 0x54, 0x49, 0x4e, - 0x47, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x45, 0x41, 0x44, 0x59, 0x10, 0x02, 0x12, 0x11, - 0x0a, 0x0d, 0x53, 0x48, 0x55, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x10, - 0x03, 0x12, 0x18, 0x0a, 0x14, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x4c, 0x49, 0x5a, 0x49, 0x4e, - 0x47, 0x5f, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x10, 0x05, 0x42, 0x39, 0x5a, 0x37, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, - 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x70, - 0x6b, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x69, 0x72, 0x2f, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x25, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x2a, + 0x71, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x1b, 0x0a, 0x17, 0x48, 0x45, 0x41, 0x4c, 0x54, 0x48, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, + 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, + 0x53, 0x54, 0x41, 0x52, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x45, + 0x41, 0x44, 0x59, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x48, 0x55, 0x54, 0x54, 0x49, 0x4e, + 0x47, 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x03, 0x12, 0x18, 0x0a, 0x14, 0x49, 0x4e, 0x49, 0x54, + 0x49, 0x41, 0x4c, 0x49, 0x5a, 0x49, 0x4e, 0x47, 0x5f, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, + 0x10, 0x04, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, + 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x2f, 0x69, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -174,10 +227,11 @@ func file_pkg_services_control_ir_types_proto_rawDescGZIP() []byte { } var file_pkg_services_control_ir_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_pkg_services_control_ir_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_pkg_services_control_ir_types_proto_goTypes = []interface{}{ - (HealthStatus)(0), // 0: ircontrol.HealthStatus - (*Signature)(nil), // 1: ircontrol.Signature +var file_pkg_services_control_ir_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_pkg_services_control_ir_types_proto_goTypes = []any{ + (HealthStatus)(0), // 0: ircontrol.HealthStatus + (*Signature)(nil), // 1: ircontrol.Signature + (*TransactionInfo)(nil), // 2: ircontrol.TransactionInfo } var file_pkg_services_control_ir_types_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -193,7 +247,7 @@ func file_pkg_services_control_ir_types_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_pkg_services_control_ir_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_pkg_services_control_ir_types_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*Signature); i { case 0: return &v.state @@ -205,6 +259,18 @@ func file_pkg_services_control_ir_types_proto_init() { return nil } } + file_pkg_services_control_ir_types_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*TransactionInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -212,7 +278,7 @@ func file_pkg_services_control_ir_types_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pkg_services_control_ir_types_proto_rawDesc, NumEnums: 1, - NumMessages: 1, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/services/control/ir/types.proto b/pkg/services/control/ir/types.proto index 91983663ab..aa82081997 100644 --- a/pkg/services/control/ir/types.proto +++ b/pkg/services/control/ir/types.proto @@ -30,3 +30,9 @@ enum HealthStatus { // Initializing Neo network INITIALIZING_NETWORK = 4; } + +// Info about transaction. +message TransactionInfo { + // Hash of transaction. + bytes hash = 1; +} diff --git a/pkg/services/control/ir/types_neofs.pb.go b/pkg/services/control/ir/types_neofs.pb.go index 1eefff6deb..487de548f3 100644 --- a/pkg/services/control/ir/types_neofs.pb.go +++ b/pkg/services/control/ir/types_neofs.pb.go @@ -33,3 +33,31 @@ func (x *Signature) StableMarshal(buf []byte) []byte { offset += proto.BytesMarshal(2, buf[offset:], x.Sign) return buf } + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *TransactionInfo) StableSize() (size int) { + size += proto.BytesSize(1, x.Hash) + return size +} + +// StableMarshal marshals x in protobuf binary format with stable field order. +// +// If buffer length is less than x.StableSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same binary format. +func (x *TransactionInfo) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.BytesMarshal(1, buf[offset:], x.Hash) + return buf +}