diff --git a/integration/fabric/atsa/chaincode/client.go b/integration/fabric/atsa/chaincode/client.go index 36e1bf4d9..72b1cfd15 100644 --- a/integration/fabric/atsa/chaincode/client.go +++ b/integration/fabric/atsa/chaincode/client.go @@ -9,13 +9,11 @@ package chaincode import ( "github.com/hyperledger-labs/fabric-smart-client/integration/fabric/atsa/chaincode/views" "github.com/hyperledger-labs/fabric-smart-client/integration/nwo/common" - "github.com/hyperledger-labs/fabric-smart-client/pkg/api" "github.com/hyperledger-labs/fabric-smart-client/platform/view/view" ) type ViewClient interface { CallView(fid string, in []byte) (interface{}, error) - IsTxFinal(txid string, opts ...api.ServiceOption) error } type Client struct { diff --git a/integration/fabric/atsa/fsc/client/client.go b/integration/fabric/atsa/fsc/client/client.go index fb2775097..0fddf7a45 100644 --- a/integration/fabric/atsa/fsc/client/client.go +++ b/integration/fabric/atsa/fsc/client/client.go @@ -9,14 +9,13 @@ package client import ( "github.com/hyperledger-labs/fabric-smart-client/integration/fabric/atsa/fsc/states" "github.com/hyperledger-labs/fabric-smart-client/integration/fabric/atsa/fsc/views" + views2 "github.com/hyperledger-labs/fabric-smart-client/integration/fabric/common/views" "github.com/hyperledger-labs/fabric-smart-client/integration/nwo/common" - "github.com/hyperledger-labs/fabric-smart-client/pkg/api" "github.com/hyperledger-labs/fabric-smart-client/platform/view/view" ) type ViewClient interface { CallView(fid string, in []byte) (interface{}, error) - IsTxFinal(txid string, opts ...api.ServiceOption) error } type Client struct { @@ -80,6 +79,10 @@ func (c *Client) Transfer(assetID string, agreementID string, recipient view.Ide return nil } -func (c *Client) IsTxFinal(id string, opts ...api.ServiceOption) error { - return c.c.IsTxFinal(id, opts...) +func (c *Client) IsTxFinal(id string) error { + _, err := c.c.CallView("finality", common.JSONMarshall(views2.Finality{TxID: id})) + if err != nil { + return err + } + return nil } diff --git a/integration/fabric/atsa/fsc/topology.go b/integration/fabric/atsa/fsc/topology.go index f46302653..448fa060c 100644 --- a/integration/fabric/atsa/fsc/topology.go +++ b/integration/fabric/atsa/fsc/topology.go @@ -9,6 +9,7 @@ package fsc import ( "github.com/hyperledger-labs/fabric-smart-client/integration" "github.com/hyperledger-labs/fabric-smart-client/integration/fabric/atsa/fsc/views" + cviews "github.com/hyperledger-labs/fabric-smart-client/integration/fabric/common/views" "github.com/hyperledger-labs/fabric-smart-client/integration/nwo/api" "github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fabric" "github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fsc" @@ -37,13 +38,15 @@ func Topology(sdk api2.SDK, commType fsc.P2PCommunicationType, replicationOpts * RegisterResponder(&views.ApproverView{}, &views.IssueView{}). RegisterResponder(&views.ApproverView{}, &views.AgreeToSellView{}). RegisterResponder(&views.ApproverView{}, &views.AgreeToBuyView{}). - RegisterResponder(&views.ApproverView{}, &views.TransferView{}) + RegisterResponder(&views.ApproverView{}, &views.TransferView{}). + RegisterViewFactory("finality", &cviews.FinalityViewFactory{}) // Issuer fscTopology.AddNodeByName("issuer"). AddOptions(fabric.WithOrganization("Org3")). AddOptions(replicationOpts.For("issuer")...). - RegisterViewFactory("issue", &views.IssueViewFactory{}) + RegisterViewFactory("issue", &views.IssueViewFactory{}). + RegisterViewFactory("finality", &cviews.FinalityViewFactory{}) // Alice fscTopology.AddNodeByName("alice"). @@ -53,7 +56,8 @@ func Topology(sdk api2.SDK, commType fsc.P2PCommunicationType, replicationOpts * RegisterViewFactory("agreeToSell", &views.AgreeToSellViewFactory{}). RegisterViewFactory("agreeToBuy", &views.AgreeToBuyViewFactory{}). RegisterResponder(&views.AcceptAssetView{}, &views.IssueView{}). - RegisterResponder(&views.TransferResponderView{}, &views.TransferView{}) + RegisterResponder(&views.TransferResponderView{}, &views.TransferView{}). + RegisterViewFactory("finality", &cviews.FinalityViewFactory{}) // Bob fscTopology.AddNodeByName("bob"). @@ -63,7 +67,8 @@ func Topology(sdk api2.SDK, commType fsc.P2PCommunicationType, replicationOpts * RegisterViewFactory("agreeToSell", &views.AgreeToSellViewFactory{}). RegisterViewFactory("agreeToBuy", &views.AgreeToBuyViewFactory{}). RegisterResponder(&views.AcceptAssetView{}, &views.IssueView{}). - RegisterResponder(&views.TransferResponderView{}, &views.TransferView{}) + RegisterResponder(&views.TransferResponderView{}, &views.TransferView{}). + RegisterViewFactory("finality", &cviews.FinalityViewFactory{}) // Add Fabric SDK to FSC Nodes fscTopology.AddSDK(sdk) diff --git a/integration/fabric/common/views/finality.go b/integration/fabric/common/views/finality.go new file mode 100644 index 000000000..8a81b2809 --- /dev/null +++ b/integration/fabric/common/views/finality.go @@ -0,0 +1,41 @@ +/* +Copyright IBM Corp All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package views + +import ( + "encoding/json" + + "github.com/hyperledger-labs/fabric-smart-client/platform/fabric" + "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/assert" + "github.com/hyperledger-labs/fabric-smart-client/platform/view/view" +) + +type Finality struct { + TxID string + Network string + Channel string +} + +type FinalityView struct { + *Finality +} + +func (a *FinalityView) Call(context view.Context) (interface{}, error) { + _, ch, err := fabric.GetChannel(context, a.Network, a.Channel) + assert.NoError(err, "failed getting channel [%s:%s]", a.Network, a.Channel) + err = ch.Finality().IsFinal(context.Context(), a.TxID) + return nil, err +} + +type FinalityViewFactory struct{} + +func (c *FinalityViewFactory) NewView(in []byte) (view.View, error) { + f := &FinalityView{Finality: &Finality{}} + err := json.Unmarshal(in, f.Finality) + assert.NoError(err, "failed unmarshalling input") + return f, nil +} diff --git a/integration/fabric/events/chaincode/client.go b/integration/fabric/events/chaincode/client.go index 3042b9803..2dffd3ee2 100644 --- a/integration/fabric/events/chaincode/client.go +++ b/integration/fabric/events/chaincode/client.go @@ -9,13 +9,11 @@ package chaincode import ( "github.com/hyperledger-labs/fabric-smart-client/integration/fabric/events/chaincode/views" "github.com/hyperledger-labs/fabric-smart-client/integration/nwo/common" - "github.com/hyperledger-labs/fabric-smart-client/pkg/api" "github.com/hyperledger-labs/fabric-smart-client/platform/view/view" ) type ViewClient interface { CallView(fid string, in []byte) (interface{}, error) - IsTxFinal(txid string, opts ...api.ServiceOption) error } type Client struct { diff --git a/integration/fabric/iou/commands.go b/integration/fabric/iou/commands.go index b27d6d65f..8ae08e9a2 100644 --- a/integration/fabric/iou/commands.go +++ b/integration/fabric/iou/commands.go @@ -10,6 +10,8 @@ import ( "context" "time" + cviews "github.com/hyperledger-labs/fabric-smart-client/integration/fabric/common/views" + "github.com/hyperledger-labs/fabric-smart-client/integration" "github.com/hyperledger-labs/fabric-smart-client/integration/fabric/iou/views" "github.com/hyperledger-labs/fabric-smart-client/integration/nwo/common" @@ -58,7 +60,8 @@ func UpdateIOUWithBorrower(ii *integration.Infrastructure, borrower, iouStateID ) Expect(err).NotTo(HaveOccurred()) txID := common.JSONUnmarshalString(txIDBoxed) - Expect(ii.Client("lender").IsTxFinal(txID)).NotTo(HaveOccurred()) + _, err = ii.Client("lender").CallView("finality", common.JSONMarshall(cviews.Finality{TxID: txID})) + Expect(err).NotTo(HaveOccurred()) } func InitApprover(ii *integration.Infrastructure, approver string) { diff --git a/integration/fabric/iou/topology.go b/integration/fabric/iou/topology.go index 714765caa..995ff949e 100644 --- a/integration/fabric/iou/topology.go +++ b/integration/fabric/iou/topology.go @@ -8,6 +8,7 @@ package iou import ( "github.com/hyperledger-labs/fabric-smart-client/integration" + cviews "github.com/hyperledger-labs/fabric-smart-client/integration/fabric/common/views" "github.com/hyperledger-labs/fabric-smart-client/integration/fabric/iou/views" "github.com/hyperledger-labs/fabric-smart-client/integration/nwo/api" "github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fabric" @@ -43,7 +44,8 @@ func Topology(sdk api2.SDK, commType fsc.P2PCommunicationType, replicationOpts * AddOptions(replicationOpts.For("approver1")...). RegisterResponder(&views.ApproverView{}, &views.CreateIOUView{}). RegisterResponder(&views.ApproverView{}, &views.UpdateIOUView{}). - RegisterViewFactory("init", &views.ApproverInitViewFactory{}) + RegisterViewFactory("init", &views.ApproverInitViewFactory{}). + RegisterViewFactory("finality", &cviews.FinalityViewFactory{}) // Add another approver as well fscTopology.AddNodeByName("approver2"). @@ -53,7 +55,8 @@ func Topology(sdk api2.SDK, commType fsc.P2PCommunicationType, replicationOpts * AddOptions(replicationOpts.For("approver2")...). RegisterResponder(&views.ApproverView{}, &views.CreateIOUView{}). RegisterResponder(&views.ApproverView{}, &views.UpdateIOUView{}). - RegisterViewFactory("init", &views.ApproverInitViewFactory{}) + RegisterViewFactory("init", &views.ApproverInitViewFactory{}). + RegisterViewFactory("finality", &cviews.FinalityViewFactory{}) // Add the borrower's FSC node fscTopology.AddNodeByName("borrower"). @@ -61,7 +64,8 @@ func Topology(sdk api2.SDK, commType fsc.P2PCommunicationType, replicationOpts * AddOptions(replicationOpts.For("borrower")...). RegisterViewFactory("create", &views.CreateIOUViewFactory{}). RegisterViewFactory("update", &views.UpdateIOUViewFactory{}). - RegisterViewFactory("query", &views.QueryViewFactory{}) + RegisterViewFactory("query", &views.QueryViewFactory{}). + RegisterViewFactory("finality", &cviews.FinalityViewFactory{}) // Add the lender's FSC node fscTopology.AddNodeByName("lender"). @@ -69,7 +73,8 @@ func Topology(sdk api2.SDK, commType fsc.P2PCommunicationType, replicationOpts * AddOptions(replicationOpts.For("lender")...). RegisterResponder(&views.CreateIOUResponderView{}, &views.CreateIOUView{}). RegisterResponder(&views.UpdateIOUResponderView{}, &views.UpdateIOUView{}). - RegisterViewFactory("query", &views.QueryViewFactory{}) + RegisterViewFactory("query", &views.QueryViewFactory{}). + RegisterViewFactory("finality", &cviews.FinalityViewFactory{}) // Monitoring monitoringTopology := monitoring.NewTopology() diff --git a/integration/fabric/iouhsm/topology.go b/integration/fabric/iouhsm/topology.go index b2c8ab295..d411b36ff 100644 --- a/integration/fabric/iouhsm/topology.go +++ b/integration/fabric/iouhsm/topology.go @@ -8,6 +8,7 @@ package iouhsm import ( "github.com/hyperledger-labs/fabric-smart-client/integration" + cviews "github.com/hyperledger-labs/fabric-smart-client/integration/fabric/common/views" "github.com/hyperledger-labs/fabric-smart-client/integration/fabric/iou/views" "github.com/hyperledger-labs/fabric-smart-client/integration/nwo/api" "github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fabric" @@ -36,7 +37,8 @@ func Topology(sdk api2.SDK, commType fsc.P2PCommunicationType, replicationOpts * AddOptions(fabric.WithOrganization("Org1"), fabric.WithDefaultIdentityByHSM()). AddOptions(replicationOpts.For("approver")...). RegisterResponder(&views.ApproverView{}, &views.CreateIOUView{}). - RegisterResponder(&views.ApproverView{}, &views.UpdateIOUView{}) + RegisterResponder(&views.ApproverView{}, &views.UpdateIOUView{}). + RegisterViewFactory("finality", &cviews.FinalityViewFactory{}) // Add the borrower's FSC node fscTopology.AddNodeByName("borrower"). @@ -44,7 +46,8 @@ func Topology(sdk api2.SDK, commType fsc.P2PCommunicationType, replicationOpts * AddOptions(replicationOpts.For("borrower")...). RegisterViewFactory("create", &views.CreateIOUViewFactory{}). RegisterViewFactory("update", &views.UpdateIOUViewFactory{}). - RegisterViewFactory("query", &views.QueryViewFactory{}) + RegisterViewFactory("query", &views.QueryViewFactory{}). + RegisterViewFactory("finality", &cviews.FinalityViewFactory{}) // Add the lender's FSC node fscTopology.AddNodeByName("lender"). @@ -52,7 +55,8 @@ func Topology(sdk api2.SDK, commType fsc.P2PCommunicationType, replicationOpts * AddOptions(replicationOpts.For("lender")...). RegisterResponder(&views.CreateIOUResponderView{}, &views.CreateIOUView{}). RegisterResponder(&views.UpdateIOUResponderView{}, &views.UpdateIOUView{}). - RegisterViewFactory("query", &views.QueryViewFactory{}) + RegisterViewFactory("query", &views.QueryViewFactory{}). + RegisterViewFactory("finality", &cviews.FinalityViewFactory{}) // Add Fabric SDK to FSC Nodes fscTopology.AddSDK(sdk) diff --git a/integration/nwo/api/api.go b/integration/nwo/api/api.go index 9fab2553d..8bc13fe6e 100644 --- a/integration/nwo/api/api.go +++ b/integration/nwo/api/api.go @@ -9,7 +9,6 @@ package api import ( "context" - "github.com/hyperledger-labs/fabric-smart-client/pkg/api" "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/client/view" "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/client/web" "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/grpc" @@ -88,7 +87,6 @@ type Builder interface { type ViewClient interface { CallViewWithContext(ctx context.Context, fid string, in []byte) (interface{}, error) CallView(fid string, in []byte) (interface{}, error) - IsTxFinal(txid string, opts ...api.ServiceOption) error } type GRPCClient interface { diff --git a/integration/nwo/fsc/cli.go b/integration/nwo/fsc/cli.go index 8fe892a28..a9cd1ee14 100644 --- a/integration/nwo/fsc/cli.go +++ b/integration/nwo/fsc/cli.go @@ -11,7 +11,6 @@ import ( "time" "github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fsc/commands" - "github.com/hyperledger-labs/fabric-smart-client/pkg/api" "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" ) @@ -38,7 +37,3 @@ func (f *fscCLIViewClient) CallViewWithContext(_ context.Context, fid string, in return string(sess.Out.Contents()), nil } - -func (f *fscCLIViewClient) IsTxFinal(txid string, opts ...api.ServiceOption) error { - panic("not implemented yet") -} diff --git a/pkg/api/client.go b/pkg/api/client.go index 4fd6d36f9..760c0c7d1 100644 --- a/pkg/api/client.go +++ b/pkg/api/client.go @@ -6,47 +6,6 @@ SPDX-License-Identifier: Apache-2.0 package api -import "time" - -type ServiceOptions struct { - Network string - Channel string - Timeout time.Duration -} - -func CompileServiceOptions(opts ...ServiceOption) (*ServiceOptions, error) { - txOptions := &ServiceOptions{} - for _, opt := range opts { - if err := opt(txOptions); err != nil { - return nil, err - } - } - return txOptions, nil -} - -type ServiceOption func(*ServiceOptions) error - -func WithNetwork(network string) ServiceOption { - return func(o *ServiceOptions) error { - o.Network = network - return nil - } -} - -func WithChannel(channel string) ServiceOption { - return func(o *ServiceOptions) error { - o.Channel = channel - return nil - } -} - -func WithTimeout(timeout time.Duration) ServiceOption { - return func(o *ServiceOptions) error { - o.Timeout = timeout - return nil - } -} - type ViewClient interface { // CallView takes in input a view factory identifier, fid, and an input, in, and invokes the // factory f bound to fid on input in. The view returned by the factory is invoked on @@ -59,12 +18,4 @@ type ViewClient interface { // a freshly created context whose identifier, cid, is immediately returned. // This call is non-blocking. Initiate(fid string, in []byte) (string, error) - - // Track takes in input a context identifier, cid, and returns the latest - // status of the context as set by the views using it. - Track(cid string) string - - // IsTxFinal takes in input a transaction id and return nil if the transaction has been committed, - // an error otherwise. - IsTxFinal(txid string, opts ...ServiceOption) error } diff --git a/pkg/node/node.go b/pkg/node/node.go index 476beef3e..4edba6911 100755 --- a/pkg/node/node.go +++ b/pkg/node/node.go @@ -14,7 +14,6 @@ import ( "runtime/debug" "github.com/hyperledger-labs/fabric-smart-client/pkg/api" - "github.com/hyperledger-labs/fabric-smart-client/platform/fabric" view2 "github.com/hyperledger-labs/fabric-smart-client/platform/view" "github.com/hyperledger-labs/fabric-smart-client/platform/view/core/config" tracing2 "github.com/hyperledger-labs/fabric-smart-client/platform/view/sdk/tracing" @@ -196,25 +195,6 @@ func (n *node) ResolveIdentities(endpoints ...string) ([]view.Identity, error) { return ids, nil } -func (n *node) IsTxFinal(txID string, opts ...api.ServiceOption) error { - options, err := api.CompileServiceOptions(opts...) - if err != nil { - return errors.Wrapf(err, "failed to compile service options") - } - c := context.Background() - if options.Timeout != 0 { - var cancel context.CancelFunc - c, cancel = context.WithTimeout(c, options.Timeout) - defer cancel() - } - // TODO: network might refer to orion - _, ch, err := fabric.GetChannel(n.registry, options.Network, options.Channel) - if err != nil { - return err - } - return ch.Finality().IsFinal(c, txID) -} - func (n *node) getTracer() trace.Tracer { if n.tracer == nil { n.tracer = tracing2.Get(n.registry).Tracer("node_view_client", tracing.WithMetricsOpts(tracing.MetricsOpts{ @@ -302,7 +282,3 @@ func (n *node) Context(contextID string) (view.Context, error) { func (n *node) Initiate(fid string, in []byte) (string, error) { panic("implement me") } - -func (n *node) Track(cid string) string { - panic("implement me") -} diff --git a/platform/view/sdk/dig/sdk.go b/platform/view/sdk/dig/sdk.go index c81e5a981..7823435b5 100644 --- a/platform/view/sdk/dig/sdk.go +++ b/platform/view/sdk/dig/sdk.go @@ -9,7 +9,6 @@ package sdk import ( "context" "errors" - "reflect" "github.com/go-kit/log" "github.com/hyperledger-labs/fabric-smart-client/pkg/node" @@ -164,11 +163,6 @@ func (p *SDK) Install() error { if err := p.C.Invoke(func(resolverService *endpoint.ResolverService) error { return resolverService.LoadResolvers() }); err != nil { return err } - if err := p.C.Invoke(func(server finality.Server, manager *finality.Manager) { - server.RegisterProcessor(reflect.TypeOf(&protos.Command_IsTxFinal{}), manager.IsTxFinal) - }); err != nil { - return err - } logger.Debugf("Services installed:\n%s", digutils.Visualize(p.C)) return nil } diff --git a/platform/view/sdk/finality/handler.go b/platform/view/sdk/finality/handler.go index 7e6348472..b698287ea 100644 --- a/platform/view/sdk/finality/handler.go +++ b/platform/view/sdk/finality/handler.go @@ -10,21 +10,9 @@ import ( "context" "reflect" - "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/flogging" view2 "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/server/view" - "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/server/view/protos" "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/tracing" "go.opentelemetry.io/otel/trace" - "go.uber.org/zap/zapcore" -) - -const ( - handlerTypeLabel tracing.LabelName = "handler_type" - successLabel tracing.LabelName = "success" -) - -var ( - logger = flogging.MustGetLogger("view-sdk.finality") ) type Registry interface { @@ -51,34 +39,6 @@ type Manager struct { tracer trace.Tracer } -func (s *Manager) IsTxFinal(ctx context.Context, command *protos.Command) (interface{}, error) { - newCtx, span := s.tracer.Start(ctx, "is_final") - defer span.End() - c := command.Payload.(*protos.Command_IsTxFinal).IsTxFinal - - if logger.IsEnabledFor(zapcore.DebugLevel) { - logger.Debugf("Answering: Is [%s] final on [%s:%s]?", c.Txid, c.Network, c.Channel) - } - - for _, handler := range s.Handlers { - span.AddEvent("start_handler", tracing.WithAttributes(tracing.String(handlerTypeLabel, reflect.TypeOf(handler).String()))) - if err := handler.IsFinal(newCtx, c.Network, c.Channel, c.Txid); err == nil { - span.AddEvent("end_handler", tracing.WithAttributes(tracing.Bool(successLabel, true))) - if logger.IsEnabledFor(zapcore.DebugLevel) { - logger.Debugf("Answering: Is [%s] final on [%s:%s]? Yes", c.Txid, c.Network, c.Channel) - } - return &protos.CommandResponse_IsTxFinalResponse{IsTxFinalResponse: &protos.IsTxFinalResponse{}}, nil - } else { - span.AddEvent("end_handler", tracing.WithAttributes(tracing.Bool(successLabel, false))) - logger.Debugf("Answering: Is [%s] final on [%s:%s]? err [%s]", c.Txid, c.Network, c.Channel, err) - } - } - - return &protos.CommandResponse_IsTxFinalResponse{IsTxFinalResponse: &protos.IsTxFinalResponse{ - Payload: []byte("no handler found for the request"), - }}, nil -} - func (s *Manager) AddHandler(handler Handler) { s.Handlers = append(s.Handlers, handler) } diff --git a/platform/view/services/client/view/client.go b/platform/view/services/client/view/client.go index 15b9a5b8b..b2e4288fa 100644 --- a/platform/view/services/client/view/client.go +++ b/platform/view/services/client/view/client.go @@ -13,7 +13,6 @@ import ( "io" "time" - "github.com/hyperledger-labs/fabric-smart-client/pkg/api" "github.com/hyperledger-labs/fabric-smart-client/pkg/utils/proto" "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/flogging" grpc2 "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/grpc" @@ -143,57 +142,6 @@ func (s *client) Initiate(fid string, in []byte) (string, error) { panic("implement me") } -func (s *client) Track(cid string) string { - panic("implement me") -} - -func (s *client) IsTxFinal(txid string, opts ...api.ServiceOption) error { - options, err := api.CompileServiceOptions(opts...) - if err != nil { - return err - } - - if logger.IsEnabledFor(zapcore.DebugLevel) { - logger.Debugf("Calling IsTxFinal on txid [%s]", txid) - } - payload := &protos.Command_IsTxFinal{IsTxFinal: &protos.IsTxFinal{ - Network: options.Network, - Channel: options.Channel, - Txid: txid, - }} - sc, err := s.CreateSignedCommand(payload, s.SigningIdentity) - if err != nil { - logger.Errorf("failed creating signed command to ask for finality of tx [%s] at [%s]", txid, s.Address) - return errors.Wrapf(err, "failed creating signed command to ask for finality of tx [%s] at [%s]", txid, s.Address) - } - - if logger.IsEnabledFor(zapcore.DebugLevel) { - logger.Debugf("Contact the server to ask if tx [%s] final at [%s]", txid, s.Address) - } - commandResp, err := s.processCommand(context.Background(), sc) - if err != nil { - logger.Errorf("failed process command to ask for finality of tx [%s] at [%s]", txid, s.Address) - return errors.Wrapf(err, "failed process command to ask for finality of tx [%s] at [%s]", txid, s.Address) - } - if logger.IsEnabledFor(zapcore.DebugLevel) { - logger.Debugf("Contact the server to ask if tx [%s] final at [%s]. Done", txid, s.Address) - } - - if commandResp.GetIsTxFinalResponse() == nil { - logger.Errorf("expected response, got nothing while asking for finality of tx [%s] at [%s]", txid, s.Address) - return errors.Errorf("expected response, got nothing while asking for finality of tx [%s] at [%s]", txid, s.Address) - } - - respPayload := commandResp.GetIsTxFinalResponse().GetPayload() - if logger.IsEnabledFor(zapcore.DebugLevel) { - logger.Debugf("Is tx [%s] final at [%s]? [%s]", txid, s.Address, string(respPayload)) - } - if len(respPayload) == 0 { - return nil - } - return errors.New(string(respPayload)) -} - func (s *client) StreamCallView(fid string, input []byte) (*Stream, error) { logger.Infof("Streaming view call [%s] on input [%s]", fid, string(input)) payload := &protos.Command_CallView{CallView: &protos.CallView{ @@ -353,12 +301,8 @@ func commandFromPayload(payload interface{}) (*protos.Command, error) { switch t := payload.(type) { case *protos.Command_InitiateView: return &protos.Command{Payload: t}, nil - case *protos.Command_TrackView: - return &protos.Command{Payload: t}, nil case *protos.Command_CallView: return &protos.Command{Payload: t}, nil - case *protos.Command_IsTxFinal: - return &protos.Command{Payload: t}, nil default: return nil, errors.Errorf("command type not recognized: %T", t) } diff --git a/platform/view/services/client/web/client.go b/platform/view/services/client/web/client.go index bf245c5aa..cfe948585 100644 --- a/platform/view/services/client/web/client.go +++ b/platform/view/services/client/web/client.go @@ -17,7 +17,6 @@ import ( "net/http" "os" - "github.com/hyperledger-labs/fabric-smart-client/pkg/api" "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/flogging" "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/server/view/protos" "github.com/pkg/errors" @@ -191,14 +190,6 @@ func (c *Client) Initiate(fid string, in []byte) (string, error) { panic("implement me") } -func (c *Client) Track(cid string) string { - panic("implement me") -} - -func (c *Client) IsTxFinal(txid string, opts ...api.ServiceOption) error { - panic("implement me") -} - func (c *Client) ServerVersion() (string, error) { url := fmt.Sprintf("%s/version", c.url) req, err := http.NewRequest(http.MethodGet, url, nil) diff --git a/platform/view/services/server/view/marshal.go b/platform/view/services/server/view/marshal.go index 5ca1eb190..9920fabbe 100644 --- a/platform/view/services/server/view/marshal.go +++ b/platform/view/services/server/view/marshal.go @@ -109,12 +109,8 @@ func commandResponseFromPayload(payload interface{}) (*protos.CommandResponse, e return &protos.CommandResponse{Payload: t}, nil case *protos.CommandResponse_InitiateViewResponse: return &protos.CommandResponse{Payload: t}, nil - case *protos.CommandResponse_TrackViewResponse: - return &protos.CommandResponse{Payload: t}, nil case *protos.CommandResponse_CallViewResponse: return &protos.CommandResponse{Payload: t}, nil - case *protos.CommandResponse_IsTxFinalResponse: - return &protos.CommandResponse{Payload: t}, nil default: return nil, errors.Errorf("command type not recognized: %T", t) } diff --git a/platform/view/services/server/view/protos/commands.pb.go b/platform/view/services/server/view/protos/commands.pb.go index 0bd5bbf08..b8fb3487f 100644 --- a/platform/view/services/server/view/protos/commands.pb.go +++ b/platform/view/services/server/view/protos/commands.pb.go @@ -1,284 +1,247 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.28.1 // source: commands.proto package protos import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) // InitiateView is used to initiate a view type InitiateView struct { - Fid string `protobuf:"bytes,1,opt,name=fid,proto3" json:"fid,omitempty"` - Input []byte `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *InitiateView) Reset() { *m = InitiateView{} } -func (m *InitiateView) String() string { return proto.CompactTextString(m) } -func (*InitiateView) ProtoMessage() {} -func (*InitiateView) Descriptor() ([]byte, []int) { - return fileDescriptor_0dff099eb2e3dfdb, []int{0} + Fid string `protobuf:"bytes,1,opt,name=fid,proto3" json:"fid,omitempty"` + Input []byte `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` } -func (m *InitiateView) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_InitiateView.Unmarshal(m, b) -} -func (m *InitiateView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_InitiateView.Marshal(b, m, deterministic) -} -func (m *InitiateView) XXX_Merge(src proto.Message) { - xxx_messageInfo_InitiateView.Merge(m, src) +func (x *InitiateView) Reset() { + *x = InitiateView{} + if protoimpl.UnsafeEnabled { + mi := &file_commands_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *InitiateView) XXX_Size() int { - return xxx_messageInfo_InitiateView.Size(m) + +func (x *InitiateView) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *InitiateView) XXX_DiscardUnknown() { - xxx_messageInfo_InitiateView.DiscardUnknown(m) + +func (*InitiateView) ProtoMessage() {} + +func (x *InitiateView) ProtoReflect() protoreflect.Message { + mi := &file_commands_proto_msgTypes[0] + 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) } -var xxx_messageInfo_InitiateView proto.InternalMessageInfo +// Deprecated: Use InitiateView.ProtoReflect.Descriptor instead. +func (*InitiateView) Descriptor() ([]byte, []int) { + return file_commands_proto_rawDescGZIP(), []int{0} +} -func (m *InitiateView) GetFid() string { - if m != nil { - return m.Fid +func (x *InitiateView) GetFid() string { + if x != nil { + return x.Fid } return "" } -func (m *InitiateView) GetInput() []byte { - if m != nil { - return m.Input +func (x *InitiateView) GetInput() []byte { + if x != nil { + return x.Input } return nil } type InitiateViewResponse struct { - Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *InitiateViewResponse) Reset() { *m = InitiateViewResponse{} } -func (m *InitiateViewResponse) String() string { return proto.CompactTextString(m) } -func (*InitiateViewResponse) ProtoMessage() {} -func (*InitiateViewResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0dff099eb2e3dfdb, []int{1} + Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` } -func (m *InitiateViewResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_InitiateViewResponse.Unmarshal(m, b) -} -func (m *InitiateViewResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_InitiateViewResponse.Marshal(b, m, deterministic) -} -func (m *InitiateViewResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_InitiateViewResponse.Merge(m, src) +func (x *InitiateViewResponse) Reset() { + *x = InitiateViewResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_commands_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *InitiateViewResponse) XXX_Size() int { - return xxx_messageInfo_InitiateViewResponse.Size(m) + +func (x *InitiateViewResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *InitiateViewResponse) XXX_DiscardUnknown() { - xxx_messageInfo_InitiateViewResponse.DiscardUnknown(m) + +func (*InitiateViewResponse) ProtoMessage() {} + +func (x *InitiateViewResponse) ProtoReflect() protoreflect.Message { + mi := &file_commands_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) } -var xxx_messageInfo_InitiateViewResponse proto.InternalMessageInfo +// Deprecated: Use InitiateViewResponse.ProtoReflect.Descriptor instead. +func (*InitiateViewResponse) Descriptor() ([]byte, []int) { + return file_commands_proto_rawDescGZIP(), []int{1} +} -func (m *InitiateViewResponse) GetCid() string { - if m != nil { - return m.Cid +func (x *InitiateViewResponse) GetCid() string { + if x != nil { + return x.Cid } return "" } // InitiateView is used to initiate a view type CallView struct { - Fid string `protobuf:"bytes,1,opt,name=fid,proto3" json:"fid,omitempty"` - Input []byte `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *CallView) Reset() { *m = CallView{} } -func (m *CallView) String() string { return proto.CompactTextString(m) } -func (*CallView) ProtoMessage() {} -func (*CallView) Descriptor() ([]byte, []int) { - return fileDescriptor_0dff099eb2e3dfdb, []int{2} + Fid string `protobuf:"bytes,1,opt,name=fid,proto3" json:"fid,omitempty"` + Input []byte `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` } -func (m *CallView) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CallView.Unmarshal(m, b) -} -func (m *CallView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CallView.Marshal(b, m, deterministic) -} -func (m *CallView) XXX_Merge(src proto.Message) { - xxx_messageInfo_CallView.Merge(m, src) +func (x *CallView) Reset() { + *x = CallView{} + if protoimpl.UnsafeEnabled { + mi := &file_commands_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *CallView) XXX_Size() int { - return xxx_messageInfo_CallView.Size(m) + +func (x *CallView) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CallView) XXX_DiscardUnknown() { - xxx_messageInfo_CallView.DiscardUnknown(m) + +func (*CallView) ProtoMessage() {} + +func (x *CallView) ProtoReflect() protoreflect.Message { + mi := &file_commands_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) } -var xxx_messageInfo_CallView proto.InternalMessageInfo +// Deprecated: Use CallView.ProtoReflect.Descriptor instead. +func (*CallView) Descriptor() ([]byte, []int) { + return file_commands_proto_rawDescGZIP(), []int{2} +} -func (m *CallView) GetFid() string { - if m != nil { - return m.Fid +func (x *CallView) GetFid() string { + if x != nil { + return x.Fid } return "" } -func (m *CallView) GetInput() []byte { - if m != nil { - return m.Input +func (x *CallView) GetInput() []byte { + if x != nil { + return x.Input } return nil } type CallViewResponse struct { - Result []byte `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *CallViewResponse) Reset() { *m = CallViewResponse{} } -func (m *CallViewResponse) String() string { return proto.CompactTextString(m) } -func (*CallViewResponse) ProtoMessage() {} -func (*CallViewResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0dff099eb2e3dfdb, []int{3} -} - -func (m *CallViewResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CallViewResponse.Unmarshal(m, b) -} -func (m *CallViewResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CallViewResponse.Marshal(b, m, deterministic) + Result []byte `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` } -func (m *CallViewResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CallViewResponse.Merge(m, src) -} -func (m *CallViewResponse) XXX_Size() int { - return xxx_messageInfo_CallViewResponse.Size(m) -} -func (m *CallViewResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CallViewResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CallViewResponse proto.InternalMessageInfo -func (m *CallViewResponse) GetResult() []byte { - if m != nil { - return m.Result +func (x *CallViewResponse) Reset() { + *x = CallViewResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_commands_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil -} - -type TrackView struct { - Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *TrackView) Reset() { *m = TrackView{} } -func (m *TrackView) String() string { return proto.CompactTextString(m) } -func (*TrackView) ProtoMessage() {} -func (*TrackView) Descriptor() ([]byte, []int) { - return fileDescriptor_0dff099eb2e3dfdb, []int{4} -} - -func (m *TrackView) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TrackView.Unmarshal(m, b) -} -func (m *TrackView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TrackView.Marshal(b, m, deterministic) -} -func (m *TrackView) XXX_Merge(src proto.Message) { - xxx_messageInfo_TrackView.Merge(m, src) -} -func (m *TrackView) XXX_Size() int { - return xxx_messageInfo_TrackView.Size(m) -} -func (m *TrackView) XXX_DiscardUnknown() { - xxx_messageInfo_TrackView.DiscardUnknown(m) +func (x *CallViewResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_TrackView proto.InternalMessageInfo +func (*CallViewResponse) ProtoMessage() {} -func (m *TrackView) GetCid() string { - if m != nil { - return m.Cid +func (x *CallViewResponse) ProtoReflect() protoreflect.Message { + mi := &file_commands_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 "" -} - -type TrackViewResponse struct { - Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TrackViewResponse) Reset() { *m = TrackViewResponse{} } -func (m *TrackViewResponse) String() string { return proto.CompactTextString(m) } -func (*TrackViewResponse) ProtoMessage() {} -func (*TrackViewResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0dff099eb2e3dfdb, []int{5} + return mi.MessageOf(x) } -func (m *TrackViewResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TrackViewResponse.Unmarshal(m, b) -} -func (m *TrackViewResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TrackViewResponse.Marshal(b, m, deterministic) -} -func (m *TrackViewResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TrackViewResponse.Merge(m, src) -} -func (m *TrackViewResponse) XXX_Size() int { - return xxx_messageInfo_TrackViewResponse.Size(m) -} -func (m *TrackViewResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TrackViewResponse.DiscardUnknown(m) +// Deprecated: Use CallViewResponse.ProtoReflect.Descriptor instead. +func (*CallViewResponse) Descriptor() ([]byte, []int) { + return file_commands_proto_rawDescGZIP(), []int{3} } -var xxx_messageInfo_TrackViewResponse proto.InternalMessageInfo - -func (m *TrackViewResponse) GetPayload() []byte { - if m != nil { - return m.Payload +func (x *CallViewResponse) GetResult() []byte { + if x != nil { + return x.Result } return nil } // Header is a generic replay prevention and identity message to include in a signed command type Header struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Timestamp is the local time when the message was created // by the sender - Timestamp *timestamp.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Nonce is a sufficiently long random value // used to ensure the request has enough entropy. Nonce []byte `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"` @@ -286,142 +249,125 @@ type Header struct { Creator []byte `protobuf:"bytes,4,opt,name=creator,proto3" json:"creator,omitempty"` // TlsCertHash represents the hash of the client's TLS certificate // when mutual TLS is enabled - TlsCertHash []byte `protobuf:"bytes,5,opt,name=tls_cert_hash,json=tlsCertHash,proto3" json:"tls_cert_hash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + TlsCertHash []byte `protobuf:"bytes,5,opt,name=tls_cert_hash,json=tlsCertHash,proto3" json:"tls_cert_hash,omitempty"` } -func (m *Header) Reset() { *m = Header{} } -func (m *Header) String() string { return proto.CompactTextString(m) } -func (*Header) ProtoMessage() {} -func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_0dff099eb2e3dfdb, []int{6} +func (x *Header) Reset() { + *x = Header{} + if protoimpl.UnsafeEnabled { + mi := &file_commands_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Header) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Header.Unmarshal(m, b) -} -func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Header.Marshal(b, m, deterministic) -} -func (m *Header) XXX_Merge(src proto.Message) { - xxx_messageInfo_Header.Merge(m, src) +func (x *Header) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Header) XXX_Size() int { - return xxx_messageInfo_Header.Size(m) -} -func (m *Header) XXX_DiscardUnknown() { - xxx_messageInfo_Header.DiscardUnknown(m) + +func (*Header) ProtoMessage() {} + +func (x *Header) ProtoReflect() protoreflect.Message { + mi := &file_commands_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) } -var xxx_messageInfo_Header proto.InternalMessageInfo +// Deprecated: Use Header.ProtoReflect.Descriptor instead. +func (*Header) Descriptor() ([]byte, []int) { + return file_commands_proto_rawDescGZIP(), []int{4} +} -func (m *Header) GetTimestamp() *timestamp.Timestamp { - if m != nil { - return m.Timestamp +func (x *Header) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp } return nil } -func (m *Header) GetNonce() []byte { - if m != nil { - return m.Nonce +func (x *Header) GetNonce() []byte { + if x != nil { + return x.Nonce } return nil } -func (m *Header) GetCreator() []byte { - if m != nil { - return m.Creator +func (x *Header) GetCreator() []byte { + if x != nil { + return x.Creator } return nil } -func (m *Header) GetTlsCertHash() []byte { - if m != nil { - return m.TlsCertHash +func (x *Header) GetTlsCertHash() []byte { + if x != nil { + return x.TlsCertHash } return nil } // Command describes the type of operation that a client is requesting. type Command struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Header is the header of this command Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // Payload is the payload of this command. It can assume one of the following value // - // Types that are valid to be assigned to Payload: + // Types that are assignable to Payload: + // // *Command_InitiateView - // *Command_TrackView // *Command_CallView - // *Command_IsTxFinal - Payload isCommand_Payload `protobuf_oneof:"payload"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Command) Reset() { *m = Command{} } -func (m *Command) String() string { return proto.CompactTextString(m) } -func (*Command) ProtoMessage() {} -func (*Command) Descriptor() ([]byte, []int) { - return fileDescriptor_0dff099eb2e3dfdb, []int{7} -} - -func (m *Command) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Command.Unmarshal(m, b) -} -func (m *Command) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Command.Marshal(b, m, deterministic) -} -func (m *Command) XXX_Merge(src proto.Message) { - xxx_messageInfo_Command.Merge(m, src) -} -func (m *Command) XXX_Size() int { - return xxx_messageInfo_Command.Size(m) + Payload isCommand_Payload `protobuf_oneof:"payload"` } -func (m *Command) XXX_DiscardUnknown() { - xxx_messageInfo_Command.DiscardUnknown(m) -} - -var xxx_messageInfo_Command proto.InternalMessageInfo -func (m *Command) GetHeader() *Header { - if m != nil { - return m.Header +func (x *Command) Reset() { + *x = Command{} + if protoimpl.UnsafeEnabled { + mi := &file_commands_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil } -type isCommand_Payload interface { - isCommand_Payload() +func (x *Command) String() string { + return protoimpl.X.MessageStringOf(x) } -type Command_InitiateView struct { - InitiateView *InitiateView `protobuf:"bytes,2,opt,name=initiateView,proto3,oneof"` -} +func (*Command) ProtoMessage() {} -type Command_TrackView struct { - TrackView *TrackView `protobuf:"bytes,3,opt,name=trackView,proto3,oneof"` +func (x *Command) ProtoReflect() protoreflect.Message { + mi := &file_commands_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) } -type Command_CallView struct { - CallView *CallView `protobuf:"bytes,4,opt,name=callView,proto3,oneof"` +// Deprecated: Use Command.ProtoReflect.Descriptor instead. +func (*Command) Descriptor() ([]byte, []int) { + return file_commands_proto_rawDescGZIP(), []int{5} } -type Command_IsTxFinal struct { - IsTxFinal *IsTxFinal `protobuf:"bytes,5,opt,name=isTxFinal,proto3,oneof"` +func (x *Command) GetHeader() *Header { + if x != nil { + return x.Header + } + return nil } -func (*Command_InitiateView) isCommand_Payload() {} - -func (*Command_TrackView) isCommand_Payload() {} - -func (*Command_CallView) isCommand_Payload() {} - -func (*Command_IsTxFinal) isCommand_Payload() {} - func (m *Command) GetPayload() isCommand_Payload { if m != nil { return m.Payload @@ -429,290 +375,279 @@ func (m *Command) GetPayload() isCommand_Payload { return nil } -func (m *Command) GetInitiateView() *InitiateView { - if x, ok := m.GetPayload().(*Command_InitiateView); ok { +func (x *Command) GetInitiateView() *InitiateView { + if x, ok := x.GetPayload().(*Command_InitiateView); ok { return x.InitiateView } return nil } -func (m *Command) GetTrackView() *TrackView { - if x, ok := m.GetPayload().(*Command_TrackView); ok { - return x.TrackView +func (x *Command) GetCallView() *CallView { + if x, ok := x.GetPayload().(*Command_CallView); ok { + return x.CallView } return nil } -func (m *Command) GetCallView() *CallView { - if x, ok := m.GetPayload().(*Command_CallView); ok { - return x.CallView - } - return nil +type isCommand_Payload interface { + isCommand_Payload() } -func (m *Command) GetIsTxFinal() *IsTxFinal { - if x, ok := m.GetPayload().(*Command_IsTxFinal); ok { - return x.IsTxFinal - } - return nil +type Command_InitiateView struct { + InitiateView *InitiateView `protobuf:"bytes,2,opt,name=initiateView,proto3,oneof"` } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Command) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Command_InitiateView)(nil), - (*Command_TrackView)(nil), - (*Command_CallView)(nil), - (*Command_IsTxFinal)(nil), - } +type Command_CallView struct { + CallView *CallView `protobuf:"bytes,3,opt,name=callView,proto3,oneof"` } +func (*Command_InitiateView) isCommand_Payload() {} + +func (*Command_CallView) isCommand_Payload() {} + // SignedCommand is a command that carries the signature of the command's creator. type SignedCommand struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Command is the serialised version of a Command message Command []byte `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` // Signature is the signature over command - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` } -func (m *SignedCommand) Reset() { *m = SignedCommand{} } -func (m *SignedCommand) String() string { return proto.CompactTextString(m) } -func (*SignedCommand) ProtoMessage() {} -func (*SignedCommand) Descriptor() ([]byte, []int) { - return fileDescriptor_0dff099eb2e3dfdb, []int{8} +func (x *SignedCommand) Reset() { + *x = SignedCommand{} + if protoimpl.UnsafeEnabled { + mi := &file_commands_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SignedCommand) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SignedCommand.Unmarshal(m, b) -} -func (m *SignedCommand) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SignedCommand.Marshal(b, m, deterministic) +func (x *SignedCommand) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SignedCommand) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedCommand.Merge(m, src) -} -func (m *SignedCommand) XXX_Size() int { - return xxx_messageInfo_SignedCommand.Size(m) -} -func (m *SignedCommand) XXX_DiscardUnknown() { - xxx_messageInfo_SignedCommand.DiscardUnknown(m) + +func (*SignedCommand) ProtoMessage() {} + +func (x *SignedCommand) ProtoReflect() protoreflect.Message { + mi := &file_commands_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) } -var xxx_messageInfo_SignedCommand proto.InternalMessageInfo +// Deprecated: Use SignedCommand.ProtoReflect.Descriptor instead. +func (*SignedCommand) Descriptor() ([]byte, []int) { + return file_commands_proto_rawDescGZIP(), []int{6} +} -func (m *SignedCommand) GetCommand() []byte { - if m != nil { - return m.Command +func (x *SignedCommand) GetCommand() []byte { + if x != nil { + return x.Command } return nil } -func (m *SignedCommand) GetSignature() []byte { - if m != nil { - return m.Signature +func (x *SignedCommand) GetSignature() []byte { + if x != nil { + return x.Signature } return nil } type CommandResponseHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Timestamp is the time that the message // was created as defined by the sender - Timestamp *timestamp.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // CommandHash is the hash computed on the concatenation of the SignedCommand's command and signature fields. // If not specified differently, SHA256 is used // The hash is used to link a response with its request, both for bookeeping purposes on an // asynchronous system and for security reasons (accountability, non-repudiation) CommandHash []byte `protobuf:"bytes,2,opt,name=command_hash,json=commandHash,proto3" json:"command_hash,omitempty"` // Creator is the identity of the party creating this message - Creator []byte `protobuf:"bytes,3,opt,name=creator,proto3" json:"creator,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Creator []byte `protobuf:"bytes,3,opt,name=creator,proto3" json:"creator,omitempty"` } -func (m *CommandResponseHeader) Reset() { *m = CommandResponseHeader{} } -func (m *CommandResponseHeader) String() string { return proto.CompactTextString(m) } -func (*CommandResponseHeader) ProtoMessage() {} -func (*CommandResponseHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_0dff099eb2e3dfdb, []int{9} +func (x *CommandResponseHeader) Reset() { + *x = CommandResponseHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_commands_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *CommandResponseHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CommandResponseHeader.Unmarshal(m, b) +func (x *CommandResponseHeader) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CommandResponseHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CommandResponseHeader.Marshal(b, m, deterministic) -} -func (m *CommandResponseHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommandResponseHeader.Merge(m, src) -} -func (m *CommandResponseHeader) XXX_Size() int { - return xxx_messageInfo_CommandResponseHeader.Size(m) -} -func (m *CommandResponseHeader) XXX_DiscardUnknown() { - xxx_messageInfo_CommandResponseHeader.DiscardUnknown(m) + +func (*CommandResponseHeader) ProtoMessage() {} + +func (x *CommandResponseHeader) ProtoReflect() protoreflect.Message { + mi := &file_commands_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) } -var xxx_messageInfo_CommandResponseHeader proto.InternalMessageInfo +// Deprecated: Use CommandResponseHeader.ProtoReflect.Descriptor instead. +func (*CommandResponseHeader) Descriptor() ([]byte, []int) { + return file_commands_proto_rawDescGZIP(), []int{7} +} -func (m *CommandResponseHeader) GetTimestamp() *timestamp.Timestamp { - if m != nil { - return m.Timestamp +func (x *CommandResponseHeader) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp } return nil } -func (m *CommandResponseHeader) GetCommandHash() []byte { - if m != nil { - return m.CommandHash +func (x *CommandResponseHeader) GetCommandHash() []byte { + if x != nil { + return x.CommandHash } return nil } -func (m *CommandResponseHeader) GetCreator() []byte { - if m != nil { - return m.Creator +func (x *CommandResponseHeader) GetCreator() []byte { + if x != nil { + return x.Creator } return nil } // Error reports an application error type Error struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Message associated with this response. Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // Payload that can be used to include metadata with this response. - Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` } -func (m *Error) Reset() { *m = Error{} } -func (m *Error) String() string { return proto.CompactTextString(m) } -func (*Error) ProtoMessage() {} -func (*Error) Descriptor() ([]byte, []int) { - return fileDescriptor_0dff099eb2e3dfdb, []int{10} +func (x *Error) Reset() { + *x = Error{} + if protoimpl.UnsafeEnabled { + mi := &file_commands_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Error) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Error.Unmarshal(m, b) -} -func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Error.Marshal(b, m, deterministic) -} -func (m *Error) XXX_Merge(src proto.Message) { - xxx_messageInfo_Error.Merge(m, src) -} -func (m *Error) XXX_Size() int { - return xxx_messageInfo_Error.Size(m) +func (x *Error) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Error) XXX_DiscardUnknown() { - xxx_messageInfo_Error.DiscardUnknown(m) + +func (*Error) ProtoMessage() {} + +func (x *Error) ProtoReflect() protoreflect.Message { + mi := &file_commands_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) } -var xxx_messageInfo_Error proto.InternalMessageInfo +// Deprecated: Use Error.ProtoReflect.Descriptor instead. +func (*Error) Descriptor() ([]byte, []int) { + return file_commands_proto_rawDescGZIP(), []int{8} +} -func (m *Error) GetMessage() string { - if m != nil { - return m.Message +func (x *Error) GetMessage() string { + if x != nil { + return x.Message } return "" } -func (m *Error) GetPayload() []byte { - if m != nil { - return m.Payload +func (x *Error) GetPayload() []byte { + if x != nil { + return x.Payload } return nil } // A CommnandResponse is returned from a server to the command submitter. type CommandResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Header of the response. Header *CommandResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // Payload of the response. // - // Types that are valid to be assigned to Payload: + // Types that are assignable to Payload: + // // *CommandResponse_Err // *CommandResponse_InitiateViewResponse - // *CommandResponse_TrackViewResponse // *CommandResponse_CallViewResponse - // *CommandResponse_IsTxFinalResponse - Payload isCommandResponse_Payload `protobuf_oneof:"payload"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Payload isCommandResponse_Payload `protobuf_oneof:"payload"` } -func (m *CommandResponse) Reset() { *m = CommandResponse{} } -func (m *CommandResponse) String() string { return proto.CompactTextString(m) } -func (*CommandResponse) ProtoMessage() {} -func (*CommandResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0dff099eb2e3dfdb, []int{11} -} - -func (m *CommandResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CommandResponse.Unmarshal(m, b) -} -func (m *CommandResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CommandResponse.Marshal(b, m, deterministic) -} -func (m *CommandResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommandResponse.Merge(m, src) -} -func (m *CommandResponse) XXX_Size() int { - return xxx_messageInfo_CommandResponse.Size(m) -} -func (m *CommandResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CommandResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CommandResponse proto.InternalMessageInfo - -func (m *CommandResponse) GetHeader() *CommandResponseHeader { - if m != nil { - return m.Header +func (x *CommandResponse) Reset() { + *x = CommandResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_commands_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil } -type isCommandResponse_Payload interface { - isCommandResponse_Payload() +func (x *CommandResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -type CommandResponse_Err struct { - Err *Error `protobuf:"bytes,2,opt,name=err,proto3,oneof"` -} +func (*CommandResponse) ProtoMessage() {} -type CommandResponse_InitiateViewResponse struct { - InitiateViewResponse *InitiateViewResponse `protobuf:"bytes,3,opt,name=initiateViewResponse,proto3,oneof"` -} - -type CommandResponse_TrackViewResponse struct { - TrackViewResponse *TrackViewResponse `protobuf:"bytes,4,opt,name=trackViewResponse,proto3,oneof"` +func (x *CommandResponse) ProtoReflect() protoreflect.Message { + mi := &file_commands_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) } -type CommandResponse_CallViewResponse struct { - CallViewResponse *CallViewResponse `protobuf:"bytes,5,opt,name=callViewResponse,proto3,oneof"` +// Deprecated: Use CommandResponse.ProtoReflect.Descriptor instead. +func (*CommandResponse) Descriptor() ([]byte, []int) { + return file_commands_proto_rawDescGZIP(), []int{9} } -type CommandResponse_IsTxFinalResponse struct { - IsTxFinalResponse *IsTxFinalResponse `protobuf:"bytes,6,opt,name=isTxFinalResponse,proto3,oneof"` +func (x *CommandResponse) GetHeader() *CommandResponseHeader { + if x != nil { + return x.Header + } + return nil } -func (*CommandResponse_Err) isCommandResponse_Payload() {} - -func (*CommandResponse_InitiateViewResponse) isCommandResponse_Payload() {} - -func (*CommandResponse_TrackViewResponse) isCommandResponse_Payload() {} - -func (*CommandResponse_CallViewResponse) isCommandResponse_Payload() {} - -func (*CommandResponse_IsTxFinalResponse) isCommandResponse_Payload() {} - func (m *CommandResponse) GetPayload() isCommandResponse_Payload { if m != nil { return m.Payload @@ -720,160 +655,398 @@ func (m *CommandResponse) GetPayload() isCommandResponse_Payload { return nil } -func (m *CommandResponse) GetErr() *Error { - if x, ok := m.GetPayload().(*CommandResponse_Err); ok { +func (x *CommandResponse) GetErr() *Error { + if x, ok := x.GetPayload().(*CommandResponse_Err); ok { return x.Err } return nil } -func (m *CommandResponse) GetInitiateViewResponse() *InitiateViewResponse { - if x, ok := m.GetPayload().(*CommandResponse_InitiateViewResponse); ok { +func (x *CommandResponse) GetInitiateViewResponse() *InitiateViewResponse { + if x, ok := x.GetPayload().(*CommandResponse_InitiateViewResponse); ok { return x.InitiateViewResponse } return nil } -func (m *CommandResponse) GetTrackViewResponse() *TrackViewResponse { - if x, ok := m.GetPayload().(*CommandResponse_TrackViewResponse); ok { - return x.TrackViewResponse +func (x *CommandResponse) GetCallViewResponse() *CallViewResponse { + if x, ok := x.GetPayload().(*CommandResponse_CallViewResponse); ok { + return x.CallViewResponse } return nil } -func (m *CommandResponse) GetCallViewResponse() *CallViewResponse { - if x, ok := m.GetPayload().(*CommandResponse_CallViewResponse); ok { - return x.CallViewResponse - } - return nil +type isCommandResponse_Payload interface { + isCommandResponse_Payload() } -func (m *CommandResponse) GetIsTxFinalResponse() *IsTxFinalResponse { - if x, ok := m.GetPayload().(*CommandResponse_IsTxFinalResponse); ok { - return x.IsTxFinalResponse - } - return nil +type CommandResponse_Err struct { + Err *Error `protobuf:"bytes,2,opt,name=err,proto3,oneof"` } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*CommandResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*CommandResponse_Err)(nil), - (*CommandResponse_InitiateViewResponse)(nil), - (*CommandResponse_TrackViewResponse)(nil), - (*CommandResponse_CallViewResponse)(nil), - (*CommandResponse_IsTxFinalResponse)(nil), - } +type CommandResponse_InitiateViewResponse struct { + InitiateViewResponse *InitiateViewResponse `protobuf:"bytes,3,opt,name=initiateViewResponse,proto3,oneof"` } +type CommandResponse_CallViewResponse struct { + CallViewResponse *CallViewResponse `protobuf:"bytes,4,opt,name=callViewResponse,proto3,oneof"` +} + +func (*CommandResponse_Err) isCommandResponse_Payload() {} + +func (*CommandResponse_InitiateViewResponse) isCommandResponse_Payload() {} + +func (*CommandResponse_CallViewResponse) isCommandResponse_Payload() {} + // SignedCommandResponse is a signed command response type SignedCommandResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Response is the serialised version of a CommandResponse message Response []byte `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` // Signature is the signature over command - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` } -func (m *SignedCommandResponse) Reset() { *m = SignedCommandResponse{} } -func (m *SignedCommandResponse) String() string { return proto.CompactTextString(m) } -func (*SignedCommandResponse) ProtoMessage() {} -func (*SignedCommandResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0dff099eb2e3dfdb, []int{12} +func (x *SignedCommandResponse) Reset() { + *x = SignedCommandResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_commands_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SignedCommandResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SignedCommandResponse.Unmarshal(m, b) -} -func (m *SignedCommandResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SignedCommandResponse.Marshal(b, m, deterministic) +func (x *SignedCommandResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SignedCommandResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedCommandResponse.Merge(m, src) -} -func (m *SignedCommandResponse) XXX_Size() int { - return xxx_messageInfo_SignedCommandResponse.Size(m) -} -func (m *SignedCommandResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SignedCommandResponse.DiscardUnknown(m) + +func (*SignedCommandResponse) ProtoMessage() {} + +func (x *SignedCommandResponse) ProtoReflect() protoreflect.Message { + mi := &file_commands_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) } -var xxx_messageInfo_SignedCommandResponse proto.InternalMessageInfo +// Deprecated: Use SignedCommandResponse.ProtoReflect.Descriptor instead. +func (*SignedCommandResponse) Descriptor() ([]byte, []int) { + return file_commands_proto_rawDescGZIP(), []int{10} +} -func (m *SignedCommandResponse) GetResponse() []byte { - if m != nil { - return m.Response +func (x *SignedCommandResponse) GetResponse() []byte { + if x != nil { + return x.Response } return nil } -func (m *SignedCommandResponse) GetSignature() []byte { - if m != nil { - return m.Signature +func (x *SignedCommandResponse) GetSignature() []byte { + if x != nil { + return x.Signature } return nil } -func init() { - proto.RegisterType((*InitiateView)(nil), "protos.InitiateView") - proto.RegisterType((*InitiateViewResponse)(nil), "protos.InitiateViewResponse") - proto.RegisterType((*CallView)(nil), "protos.CallView") - proto.RegisterType((*CallViewResponse)(nil), "protos.CallViewResponse") - proto.RegisterType((*TrackView)(nil), "protos.TrackView") - proto.RegisterType((*TrackViewResponse)(nil), "protos.TrackViewResponse") - proto.RegisterType((*Header)(nil), "protos.Header") - proto.RegisterType((*Command)(nil), "protos.Command") - proto.RegisterType((*SignedCommand)(nil), "protos.SignedCommand") - proto.RegisterType((*CommandResponseHeader)(nil), "protos.CommandResponseHeader") - proto.RegisterType((*Error)(nil), "protos.Error") - proto.RegisterType((*CommandResponse)(nil), "protos.CommandResponse") - proto.RegisterType((*SignedCommandResponse)(nil), "protos.SignedCommandResponse") -} - -func init() { proto.RegisterFile("commands.proto", fileDescriptor_0dff099eb2e3dfdb) } - -var fileDescriptor_0dff099eb2e3dfdb = []byte{ - // 629 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x95, 0x4d, 0x6f, 0xd3, 0x4c, - 0x10, 0xc7, 0xe3, 0xe6, 0x69, 0xda, 0x8c, 0xd3, 0x3e, 0xe9, 0x2a, 0x45, 0x26, 0x6a, 0x45, 0xeb, - 0x03, 0xaa, 0x90, 0x70, 0x45, 0x10, 0x08, 0xc1, 0xad, 0x15, 0xc5, 0x39, 0xb2, 0x54, 0x1c, 0xb8, - 0x54, 0x5b, 0x7b, 0x9b, 0xac, 0x70, 0xec, 0x68, 0x77, 0x23, 0xe8, 0x8d, 0x4f, 0xd0, 0x23, 0x9f, - 0x81, 0x8f, 0x89, 0xf6, 0x35, 0x8e, 0x13, 0x21, 0x21, 0x4e, 0xd9, 0xf1, 0xce, 0xcc, 0x7f, 0x5e, - 0x7e, 0xb1, 0x61, 0x3f, 0xab, 0x66, 0x33, 0x52, 0xe6, 0x22, 0x99, 0xf3, 0x4a, 0x56, 0xa8, 0xa3, - 0x7f, 0xc4, 0xf0, 0xc9, 0xa4, 0xaa, 0x26, 0x05, 0x3d, 0xd7, 0xe6, 0xed, 0xe2, 0xee, 0x5c, 0xb2, - 0x19, 0x15, 0x92, 0xcc, 0xe6, 0xc6, 0x71, 0xb8, 0x7f, 0xc7, 0x4a, 0x52, 0x30, 0x79, 0x6f, 0xec, - 0xf8, 0x35, 0xf4, 0xc6, 0x25, 0x93, 0x8c, 0x48, 0xfa, 0x99, 0xd1, 0x6f, 0xa8, 0x0f, 0xed, 0x3b, - 0x96, 0x47, 0xc1, 0x49, 0x70, 0xd6, 0xc5, 0xea, 0x88, 0x06, 0xb0, 0xcd, 0xca, 0xf9, 0x42, 0x46, - 0x5b, 0x27, 0xc1, 0x59, 0x0f, 0x1b, 0x23, 0x3e, 0x83, 0x41, 0x3d, 0x0e, 0x53, 0x31, 0xaf, 0x4a, - 0x41, 0x55, 0x7c, 0xb6, 0x8c, 0xcf, 0x58, 0x1e, 0x8f, 0x60, 0xf7, 0x92, 0x14, 0xc5, 0x5f, 0x65, - 0x7f, 0x06, 0x7d, 0x17, 0xe3, 0x33, 0x3f, 0x82, 0x0e, 0xa7, 0x62, 0x51, 0x48, 0x1d, 0xde, 0xc3, - 0xd6, 0x8a, 0x8f, 0xa1, 0x7b, 0xcd, 0x49, 0xf6, 0xd5, 0x09, 0x34, 0xe4, 0x9f, 0xc3, 0x81, 0xbf, - 0xf6, 0xb9, 0x22, 0xd8, 0x99, 0x93, 0xfb, 0xa2, 0x22, 0xb9, 0x4d, 0xe6, 0xcc, 0xf8, 0x67, 0x00, - 0x9d, 0x94, 0x92, 0x9c, 0x72, 0xf4, 0x06, 0xba, 0x7e, 0x7a, 0xda, 0x2d, 0x1c, 0x0d, 0x13, 0x33, - 0xdf, 0xc4, 0xcd, 0x37, 0xb9, 0x76, 0x1e, 0x78, 0xe9, 0xac, 0x9a, 0x2a, 0xab, 0x32, 0xa3, 0x51, - 0xdb, 0x34, 0xa5, 0x0d, 0x25, 0x9a, 0x71, 0x4a, 0x64, 0xc5, 0xa3, 0xff, 0x8c, 0xa8, 0x35, 0x51, - 0x0c, 0x7b, 0xb2, 0x10, 0x37, 0x19, 0xe5, 0xf2, 0x66, 0x4a, 0xc4, 0x34, 0xda, 0xd6, 0xf7, 0xa1, - 0x2c, 0xc4, 0x25, 0xe5, 0x32, 0x25, 0x62, 0x1a, 0x3f, 0x6c, 0xc1, 0xce, 0xa5, 0x59, 0x3a, 0x7a, - 0x0a, 0x9d, 0xa9, 0xae, 0xd1, 0x96, 0xb5, 0x6f, 0xea, 0x11, 0x89, 0xa9, 0x1c, 0xdb, 0x5b, 0xf4, - 0x16, 0x7a, 0xac, 0xb6, 0x24, 0x3d, 0xe3, 0x70, 0x34, 0x70, 0xde, 0xf5, 0x05, 0xa6, 0x2d, 0xbc, - 0xe2, 0x8b, 0x5e, 0x40, 0x57, 0xba, 0xb9, 0xe9, 0x3e, 0xc2, 0xd1, 0x81, 0x0b, 0xf4, 0x03, 0x4d, - 0x5b, 0x78, 0xe9, 0x85, 0x12, 0xd8, 0xcd, 0xec, 0xd6, 0x74, 0x87, 0xe1, 0xa8, 0xef, 0x22, 0xdc, - 0x36, 0xd3, 0x16, 0xf6, 0x3e, 0x4a, 0x82, 0x89, 0xeb, 0xef, 0x57, 0x8a, 0x48, 0xdd, 0x72, 0x4d, - 0x62, 0xec, 0x2e, 0x94, 0x84, 0xf7, 0xba, 0xe8, 0xfa, 0xc5, 0xc5, 0x1f, 0x60, 0xef, 0x13, 0x9b, - 0x94, 0x34, 0x77, 0x53, 0x51, 0xf3, 0x35, 0x47, 0xb7, 0x54, 0x6b, 0xa2, 0x23, 0xe8, 0x0a, 0x36, - 0x29, 0x89, 0x5c, 0x70, 0x6a, 0x41, 0x5b, 0x3e, 0x88, 0x1f, 0x02, 0x38, 0xb4, 0x39, 0x1c, 0x20, - 0xff, 0x4c, 0xc0, 0x29, 0xf4, 0xac, 0xb8, 0x59, 0xa8, 0x11, 0x0d, 0xed, 0x33, 0xb5, 0xd0, 0x3a, - 0x0e, 0xed, 0x15, 0x1c, 0xe2, 0x77, 0xb0, 0xfd, 0x9e, 0xf3, 0x8a, 0x2b, 0x97, 0x19, 0x15, 0x82, - 0x4c, 0xa8, 0x25, 0xda, 0x99, 0x75, 0x80, 0xb7, 0x56, 0x01, 0xfe, 0xd5, 0x86, 0xff, 0x1b, 0xdd, - 0xa0, 0x57, 0x0d, 0x5e, 0x8e, 0xfd, 0x5a, 0x36, 0xb5, 0xed, 0xf1, 0x39, 0x85, 0x36, 0xe5, 0xdc, - 0x52, 0xb3, 0xe7, 0x62, 0x74, 0x69, 0x69, 0x0b, 0xab, 0x3b, 0x84, 0x61, 0xc0, 0x36, 0xbc, 0x06, - 0x2c, 0x30, 0x47, 0x9b, 0x48, 0xf3, 0x62, 0x2d, 0xbc, 0x31, 0x16, 0x8d, 0xe1, 0x40, 0x36, 0xff, - 0xb1, 0x96, 0xa7, 0xc7, 0x6b, 0x04, 0xd6, 0xb2, 0xad, 0x47, 0xa1, 0x2b, 0xe8, 0x67, 0x8d, 0xf7, - 0x88, 0x05, 0x2d, 0x6a, 0x92, 0x59, 0x4b, 0xb4, 0x16, 0xa3, 0x4a, 0xf2, 0x0c, 0xfa, 0x44, 0x9d, - 0xd5, 0x92, 0xc6, 0x4d, 0x07, 0x55, 0xd2, 0x5a, 0x54, 0x9d, 0xe0, 0x8f, 0x70, 0xb8, 0x42, 0xb0, - 0x97, 0x1b, 0xc2, 0x2e, 0x77, 0x2a, 0x06, 0x65, 0x6f, 0xff, 0x99, 0xe5, 0x8b, 0xf0, 0x8b, 0xfd, - 0x12, 0xfc, 0x08, 0x82, 0x5b, 0x73, 0x7c, 0xf9, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xf2, 0x52, 0xf8, - 0x32, 0x2d, 0x06, 0x00, 0x00, +var File_commands_proto protoreflect.FileDescriptor + +var file_commands_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x36, 0x0a, 0x0c, 0x49, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x74, 0x65, 0x56, 0x69, 0x65, 0x77, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x66, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, + 0x6e, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, + 0x74, 0x22, 0x28, 0x0a, 0x14, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x65, 0x56, 0x69, 0x65, + 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x22, 0x32, 0x0a, 0x08, 0x43, + 0x61, 0x6c, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x66, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x70, + 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, + 0x2a, 0x0a, 0x10, 0x43, 0x61, 0x6c, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x96, 0x01, 0x0a, 0x06, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, + 0x12, 0x22, 0x0a, 0x0d, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, 0x6c, 0x73, 0x43, 0x65, 0x72, 0x74, + 0x48, 0x61, 0x73, 0x68, 0x22, 0xa8, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x12, 0x26, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x0c, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x61, 0x74, 0x65, 0x56, 0x69, 0x65, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x65, + 0x56, 0x69, 0x65, 0x77, 0x48, 0x00, 0x52, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x65, + 0x56, 0x69, 0x65, 0x77, 0x12, 0x2e, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x56, 0x69, 0x65, 0x77, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, + 0x43, 0x61, 0x6c, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x48, 0x00, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, + 0x56, 0x69, 0x65, 0x77, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, + 0x47, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x15, 0x43, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x21, 0x0a, 0x0c, + 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, + 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x3b, 0x0a, 0x05, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x92, 0x02, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x21, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, + 0x03, 0x65, 0x72, 0x72, 0x12, 0x52, 0x0a, 0x14, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x65, + 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x69, 0x74, + 0x69, 0x61, 0x74, 0x65, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x48, 0x00, 0x52, 0x14, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x65, 0x56, 0x69, 0x65, 0x77, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x10, 0x63, 0x61, 0x6c, 0x6c, + 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x61, 0x6c, 0x6c, + 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x10, + 0x63, 0x61, 0x6c, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x51, 0x0a, 0x15, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0x0d, + 0x5a, 0x08, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x80, 0x01, 0x01, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_commands_proto_rawDescOnce sync.Once + file_commands_proto_rawDescData = file_commands_proto_rawDesc +) + +func file_commands_proto_rawDescGZIP() []byte { + file_commands_proto_rawDescOnce.Do(func() { + file_commands_proto_rawDescData = protoimpl.X.CompressGZIP(file_commands_proto_rawDescData) + }) + return file_commands_proto_rawDescData +} + +var file_commands_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_commands_proto_goTypes = []any{ + (*InitiateView)(nil), // 0: protos.InitiateView + (*InitiateViewResponse)(nil), // 1: protos.InitiateViewResponse + (*CallView)(nil), // 2: protos.CallView + (*CallViewResponse)(nil), // 3: protos.CallViewResponse + (*Header)(nil), // 4: protos.Header + (*Command)(nil), // 5: protos.Command + (*SignedCommand)(nil), // 6: protos.SignedCommand + (*CommandResponseHeader)(nil), // 7: protos.CommandResponseHeader + (*Error)(nil), // 8: protos.Error + (*CommandResponse)(nil), // 9: protos.CommandResponse + (*SignedCommandResponse)(nil), // 10: protos.SignedCommandResponse + (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp +} +var file_commands_proto_depIdxs = []int32{ + 11, // 0: protos.Header.timestamp:type_name -> google.protobuf.Timestamp + 4, // 1: protos.Command.header:type_name -> protos.Header + 0, // 2: protos.Command.initiateView:type_name -> protos.InitiateView + 2, // 3: protos.Command.callView:type_name -> protos.CallView + 11, // 4: protos.CommandResponseHeader.timestamp:type_name -> google.protobuf.Timestamp + 7, // 5: protos.CommandResponse.header:type_name -> protos.CommandResponseHeader + 8, // 6: protos.CommandResponse.err:type_name -> protos.Error + 1, // 7: protos.CommandResponse.initiateViewResponse:type_name -> protos.InitiateViewResponse + 3, // 8: protos.CommandResponse.callViewResponse:type_name -> protos.CallViewResponse + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_commands_proto_init() } +func file_commands_proto_init() { + if File_commands_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_commands_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*InitiateView); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_commands_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*InitiateViewResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_commands_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*CallView); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_commands_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*CallViewResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_commands_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*Header); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_commands_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*Command); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_commands_proto_msgTypes[6].Exporter = func(v any, i int) any { + switch v := v.(*SignedCommand); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_commands_proto_msgTypes[7].Exporter = func(v any, i int) any { + switch v := v.(*CommandResponseHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_commands_proto_msgTypes[8].Exporter = func(v any, i int) any { + switch v := v.(*Error); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_commands_proto_msgTypes[9].Exporter = func(v any, i int) any { + switch v := v.(*CommandResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_commands_proto_msgTypes[10].Exporter = func(v any, i int) any { + switch v := v.(*SignedCommandResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_commands_proto_msgTypes[5].OneofWrappers = []any{ + (*Command_InitiateView)(nil), + (*Command_CallView)(nil), + } + file_commands_proto_msgTypes[9].OneofWrappers = []any{ + (*CommandResponse_Err)(nil), + (*CommandResponse_InitiateViewResponse)(nil), + (*CommandResponse_CallViewResponse)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_commands_proto_rawDesc, + NumEnums: 0, + NumMessages: 11, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_commands_proto_goTypes, + DependencyIndexes: file_commands_proto_depIdxs, + MessageInfos: file_commands_proto_msgTypes, + }.Build() + File_commands_proto = out.File + file_commands_proto_rawDesc = nil + file_commands_proto_goTypes = nil + file_commands_proto_depIdxs = nil } diff --git a/platform/view/services/server/view/protos/commands.proto b/platform/view/services/server/view/protos/commands.proto index 9f9f25c68..2a0e56281 100644 --- a/platform/view/services/server/view/protos/commands.proto +++ b/platform/view/services/server/view/protos/commands.proto @@ -12,7 +12,6 @@ option cc_generic_services = true; package protos; import "google/protobuf/timestamp.proto"; -import "finality.proto"; // InitiateView is used to initiate a view message InitiateView { @@ -36,15 +35,6 @@ message CallViewResponse { bytes result = 1; } -message TrackView { - string cid = 1; -} - -message TrackViewResponse { - bytes payload = 1; -} - - // Header is a generic replay prevention and identity message to include in a signed command message Header { // Timestamp is the local time when the message was created @@ -71,9 +61,7 @@ message Command { // Payload is the payload of this command. It can assume one of the following value oneof payload { InitiateView initiateView = 2; - TrackView trackView = 3; - CallView callView = 4; - IsTxFinal isTxFinal = 5; + CallView callView = 3; } } @@ -119,9 +107,7 @@ message CommandResponse { oneof payload { Error err = 2; InitiateViewResponse initiateViewResponse = 3; - TrackViewResponse trackViewResponse = 4; - CallViewResponse callViewResponse = 5; - IsTxFinalResponse isTxFinalResponse = 6; + CallViewResponse callViewResponse = 4; } } diff --git a/platform/view/services/server/view/protos/finality.pb.go b/platform/view/services/server/view/protos/finality.pb.go deleted file mode 100644 index 11a4175a0..000000000 --- a/platform/view/services/server/view/protos/finality.pb.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: finality.proto - -package protos - -import ( - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type IsTxFinal struct { - Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` - Channel string `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"` - Txid string `protobuf:"bytes,3,opt,name=txid,proto3" json:"txid,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *IsTxFinal) Reset() { *m = IsTxFinal{} } -func (m *IsTxFinal) String() string { return proto.CompactTextString(m) } -func (*IsTxFinal) ProtoMessage() {} -func (*IsTxFinal) Descriptor() ([]byte, []int) { - return fileDescriptor_0144d353a635b215, []int{0} -} - -func (m *IsTxFinal) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IsTxFinal.Unmarshal(m, b) -} -func (m *IsTxFinal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IsTxFinal.Marshal(b, m, deterministic) -} -func (m *IsTxFinal) XXX_Merge(src proto.Message) { - xxx_messageInfo_IsTxFinal.Merge(m, src) -} -func (m *IsTxFinal) XXX_Size() int { - return xxx_messageInfo_IsTxFinal.Size(m) -} -func (m *IsTxFinal) XXX_DiscardUnknown() { - xxx_messageInfo_IsTxFinal.DiscardUnknown(m) -} - -var xxx_messageInfo_IsTxFinal proto.InternalMessageInfo - -func (m *IsTxFinal) GetNetwork() string { - if m != nil { - return m.Network - } - return "" -} - -func (m *IsTxFinal) GetChannel() string { - if m != nil { - return m.Channel - } - return "" -} - -func (m *IsTxFinal) GetTxid() string { - if m != nil { - return m.Txid - } - return "" -} - -type IsTxFinalResponse struct { - Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *IsTxFinalResponse) Reset() { *m = IsTxFinalResponse{} } -func (m *IsTxFinalResponse) String() string { return proto.CompactTextString(m) } -func (*IsTxFinalResponse) ProtoMessage() {} -func (*IsTxFinalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0144d353a635b215, []int{1} -} - -func (m *IsTxFinalResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IsTxFinalResponse.Unmarshal(m, b) -} -func (m *IsTxFinalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IsTxFinalResponse.Marshal(b, m, deterministic) -} -func (m *IsTxFinalResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_IsTxFinalResponse.Merge(m, src) -} -func (m *IsTxFinalResponse) XXX_Size() int { - return xxx_messageInfo_IsTxFinalResponse.Size(m) -} -func (m *IsTxFinalResponse) XXX_DiscardUnknown() { - xxx_messageInfo_IsTxFinalResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_IsTxFinalResponse proto.InternalMessageInfo - -func (m *IsTxFinalResponse) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func init() { - proto.RegisterType((*IsTxFinal)(nil), "protos.IsTxFinal") - proto.RegisterType((*IsTxFinalResponse)(nil), "protos.IsTxFinalResponse") -} - -func init() { proto.RegisterFile("finality.proto", fileDescriptor_0144d353a635b215) } - -var fileDescriptor_0144d353a635b215 = []byte{ - // 145 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4b, 0xcb, 0xcc, 0x4b, - 0xcc, 0xc9, 0x2c, 0xa9, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x4a, - 0xc1, 0x5c, 0x9c, 0x9e, 0xc5, 0x21, 0x15, 0x6e, 0x20, 0x59, 0x21, 0x09, 0x2e, 0xf6, 0xbc, 0xd4, - 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x18, 0x17, 0x24, 0x93, - 0x9c, 0x91, 0x98, 0x97, 0x97, 0x9a, 0x23, 0xc1, 0x04, 0x91, 0x81, 0x72, 0x85, 0x84, 0xb8, 0x58, - 0x4a, 0x2a, 0x32, 0x53, 0x24, 0x98, 0xc1, 0xc2, 0x60, 0xb6, 0x92, 0x2e, 0x97, 0x20, 0xdc, 0xd0, - 0xa0, 0xd4, 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0x90, 0x11, 0x05, 0x89, 0x95, 0x39, 0xf9, 0x89, - 0x29, 0x60, 0xc3, 0x79, 0x82, 0x60, 0x5c, 0x27, 0xee, 0x28, 0xa8, 0x6b, 0x1a, 0x18, 0x19, 0x93, - 0x20, 0x4c, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbe, 0xaf, 0xf1, 0x45, 0xb1, 0x00, 0x00, - 0x00, -} diff --git a/platform/view/services/server/view/protos/finality.proto b/platform/view/services/server/view/protos/finality.proto deleted file mode 100644 index ff216b388..000000000 --- a/platform/view/services/server/view/protos/finality.proto +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ - -syntax = "proto3"; - -option go_package = "./protos"; -option cc_generic_services = true; - -package protos; - -message IsTxFinal { - string network = 1; - string channel = 2; - string txid = 3; -} - -message IsTxFinalResponse { - bytes payload = 1; -} diff --git a/platform/view/services/server/view/protos/generate.go b/platform/view/services/server/view/protos/generate.go index ee858b603..85439ce56 100644 --- a/platform/view/services/server/view/protos/generate.go +++ b/platform/view/services/server/view/protos/generate.go @@ -6,5 +6,5 @@ SPDX-License-Identifier: Apache-2.0 package protos -//go:generate protoc commands.proto finality.proto service.proto --go-grpc_out=Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp:. -//go:generate protoc commands.proto finality.proto --go-grpc_out=:. +//go:generate protoc --go_out=. --go-grpc_out=. --proto_path=. commands.proto service.proto +//go:generate protoc --go_out=. --proto_path=. commands.proto diff --git a/platform/view/services/server/view/protos/service.pb.go b/platform/view/services/server/view/protos/service.pb.go new file mode 100644 index 000000000..fc20b33de --- /dev/null +++ b/platform/view/services/server/view/protos/service.pb.go @@ -0,0 +1,87 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.28.1 +// source: service.proto + +package protos + +import ( + reflect "reflect" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_service_proto protoreflect.FileDescriptor + +var file_service_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x1a, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xa2, 0x01, 0x0a, 0x0b, 0x56, 0x69, 0x65, 0x77, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x4b, 0x0a, 0x0d, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x12, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x0d, 0x5a, 0x08, + 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x80, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var file_service_proto_goTypes = []any{ + (*SignedCommand)(nil), // 0: protos.SignedCommand + (*SignedCommandResponse)(nil), // 1: protos.SignedCommandResponse +} +var file_service_proto_depIdxs = []int32{ + 0, // 0: protos.ViewService.ProcessCommand:input_type -> protos.SignedCommand + 0, // 1: protos.ViewService.StreamCommand:input_type -> protos.SignedCommand + 1, // 2: protos.ViewService.ProcessCommand:output_type -> protos.SignedCommandResponse + 1, // 3: protos.ViewService.StreamCommand:output_type -> protos.SignedCommandResponse + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_service_proto_init() } +func file_service_proto_init() { + if File_service_proto != nil { + return + } + file_commands_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_proto_goTypes, + DependencyIndexes: file_service_proto_depIdxs, + }.Build() + File_service_proto = out.File + file_service_proto_rawDesc = nil + file_service_proto_goTypes = nil + file_service_proto_depIdxs = nil +} diff --git a/platform/view/services/server/view/protos/service_grpc.pb.go b/platform/view/services/server/view/protos/service_grpc.pb.go index 93addc0cc..3298be790 100644 --- a/platform/view/services/server/view/protos/service_grpc.pb.go +++ b/platform/view/services/server/view/protos/service_grpc.pb.go @@ -5,8 +5,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v4.23.4 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.28.1 // source: service.proto package protos @@ -21,8 +21,8 @@ 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 ( ViewService_ProcessCommand_FullMethodName = "/protos.ViewService/ProcessCommand" @@ -32,13 +32,15 @@ const ( // ViewServiceClient is the client API for ViewService 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. +// +// ViewService provides support to view management type ViewServiceClient interface { // ProcessCommand processes the passed command ensuring proper access control. // The returned response allows the client to understand if the // operation was successfully executed and if not, the response // reports the reason of the failure. ProcessCommand(ctx context.Context, in *SignedCommand, opts ...grpc.CallOption) (*SignedCommandResponse, error) - StreamCommand(ctx context.Context, opts ...grpc.CallOption) (ViewService_StreamCommandClient, error) + StreamCommand(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SignedCommand, SignedCommandResponse], error) } type viewServiceClient struct { @@ -50,69 +52,58 @@ func NewViewServiceClient(cc grpc.ClientConnInterface) ViewServiceClient { } func (c *viewServiceClient) ProcessCommand(ctx context.Context, in *SignedCommand, opts ...grpc.CallOption) (*SignedCommandResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(SignedCommandResponse) - err := c.cc.Invoke(ctx, ViewService_ProcessCommand_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ViewService_ProcessCommand_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *viewServiceClient) StreamCommand(ctx context.Context, opts ...grpc.CallOption) (ViewService_StreamCommandClient, error) { - stream, err := c.cc.NewStream(ctx, &ViewService_ServiceDesc.Streams[0], ViewService_StreamCommand_FullMethodName, opts...) +func (c *viewServiceClient) StreamCommand(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SignedCommand, SignedCommandResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &ViewService_ServiceDesc.Streams[0], ViewService_StreamCommand_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &viewServiceStreamCommandClient{stream} + x := &grpc.GenericClientStream[SignedCommand, SignedCommandResponse]{ClientStream: stream} return x, nil } -type ViewService_StreamCommandClient interface { - Send(*SignedCommand) error - Recv() (*SignedCommandResponse, error) - grpc.ClientStream -} - -type viewServiceStreamCommandClient struct { - grpc.ClientStream -} - -func (x *viewServiceStreamCommandClient) Send(m *SignedCommand) error { - return x.ClientStream.SendMsg(m) -} - -func (x *viewServiceStreamCommandClient) Recv() (*SignedCommandResponse, error) { - m := new(SignedCommandResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ViewService_StreamCommandClient = grpc.BidiStreamingClient[SignedCommand, SignedCommandResponse] // ViewServiceServer is the server API for ViewService service. // All implementations must embed UnimplementedViewServiceServer -// for forward compatibility +// for forward compatibility. +// +// ViewService provides support to view management type ViewServiceServer interface { // ProcessCommand processes the passed command ensuring proper access control. // The returned response allows the client to understand if the // operation was successfully executed and if not, the response // reports the reason of the failure. ProcessCommand(context.Context, *SignedCommand) (*SignedCommandResponse, error) - StreamCommand(ViewService_StreamCommandServer) error + StreamCommand(grpc.BidiStreamingServer[SignedCommand, SignedCommandResponse]) error mustEmbedUnimplementedViewServiceServer() } -// UnimplementedViewServiceServer must be embedded to have forward compatible implementations. -type UnimplementedViewServiceServer struct { -} +// UnimplementedViewServiceServer must 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 UnimplementedViewServiceServer struct{} func (UnimplementedViewServiceServer) ProcessCommand(context.Context, *SignedCommand) (*SignedCommandResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ProcessCommand not implemented") } -func (UnimplementedViewServiceServer) StreamCommand(ViewService_StreamCommandServer) error { +func (UnimplementedViewServiceServer) StreamCommand(grpc.BidiStreamingServer[SignedCommand, SignedCommandResponse]) error { return status.Errorf(codes.Unimplemented, "method StreamCommand not implemented") } func (UnimplementedViewServiceServer) mustEmbedUnimplementedViewServiceServer() {} +func (UnimplementedViewServiceServer) testEmbeddedByValue() {} // UnsafeViewServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ViewServiceServer will @@ -122,6 +113,13 @@ type UnsafeViewServiceServer interface { } func RegisterViewServiceServer(s grpc.ServiceRegistrar, srv ViewServiceServer) { + // If the following call pancis, it indicates UnimplementedViewServiceServer 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(&ViewService_ServiceDesc, srv) } @@ -144,30 +142,11 @@ func _ViewService_ProcessCommand_Handler(srv interface{}, ctx context.Context, d } func _ViewService_StreamCommand_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ViewServiceServer).StreamCommand(&viewServiceStreamCommandServer{stream}) -} - -type ViewService_StreamCommandServer interface { - Send(*SignedCommandResponse) error - Recv() (*SignedCommand, error) - grpc.ServerStream -} - -type viewServiceStreamCommandServer struct { - grpc.ServerStream + return srv.(ViewServiceServer).StreamCommand(&grpc.GenericServerStream[SignedCommand, SignedCommandResponse]{ServerStream: stream}) } -func (x *viewServiceStreamCommandServer) Send(m *SignedCommandResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *viewServiceStreamCommandServer) Recv() (*SignedCommand, error) { - m := new(SignedCommand) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ViewService_StreamCommandServer = grpc.BidiStreamingServer[SignedCommand, SignedCommandResponse] // ViewService_ServiceDesc is the grpc.ServiceDesc for ViewService service. // It's only intended for direct use with grpc.RegisterService, diff --git a/samples/fabric/iou/README.md b/samples/fabric/iou/README.md index bf349ea5d..63505d262 100644 --- a/samples/fabric/iou/README.md +++ b/samples/fabric/iou/README.md @@ -524,7 +524,7 @@ If you reached this point, you can now invoke the business views on the FSC node To create an IOU, you can run the following command in a new terminal window: ```shell -./iou view -c ./testdata/fsc/nodes/borrower.0/client-config.yaml -f create -i '{"Amount":10}' +./iou views -c ./testdata/fsc/nodes/borrower.0/client-config.yaml -f create -i '{"Amount":10}' ``` The above command invoke the `create` view on the borrower's FSC node. The `-c` option specifies the client configuration file. @@ -540,7 +540,7 @@ The above is the IOU ID that we will use to update the IOU or query it. Indeed, once the IOU is created, you can query the IOUs by running the following command (substituting the IOU LinearID output from the previous command): ```shell -./iou view -c ./testdata/fsc/nodes/borrower.0/client-config.yaml -f query -i '{"LinearID":"bd90b6c8-0a54-4719-8caa-00759bad7d69"}' +./iou views -c ./testdata/fsc/nodes/borrower.0/client-config.yaml -f query -i '{"LinearID":"bd90b6c8-0a54-4719-8caa-00759bad7d69"}' ``` The above command will query the IOU with the linear ID `bd90b6c8-0a54-4719-8caa-00759bad7d69` on the borrower's FSC node. @@ -549,13 +549,13 @@ If everything is successful, you will the current amount contained in the IOU st If you want to query the IOU start on the lender node, you can run the following command: ```shell -./iou view -c ./testdata/fsc/nodes/lender.0/client-config.yaml -f query -i '{"LinearID":"bd90b6c8-0a54-4719-8caa-00759bad7d69"}' +./iou views -c ./testdata/fsc/nodes/lender.0/client-config.yaml -f query -i '{"LinearID":"bd90b6c8-0a54-4719-8caa-00759bad7d69"}' ``` To update the IOU, you can run the following command: ```shell -./iou view -c ./testdata/fsc/nodes/borrower.0/client-config.yaml -f update -i '{"LinearID":"bd90b6c8-0a54-4719-8caa-00759bad7d69","Amount":8}' +./iou views -c ./testdata/fsc/nodes/borrower.0/client-config.yaml -f update -i '{"LinearID":"bd90b6c8-0a54-4719-8caa-00759bad7d69","Amount":8}' ``` The above command will update the IOU with the linear ID `bd90b6c8-0a54-4719-8caa-00759bad7d69`. The new amount will be 8.