diff --git a/apps/poa/poa_test.go b/apps/poa/poa_test.go index b86f9dbc..fa57173b 100644 --- a/apps/poa/poa_test.go +++ b/apps/poa/poa_test.go @@ -152,7 +152,7 @@ func runNode(poaNode *Poa, mockP2P *p2p.MockP2p, wg *sync.WaitGroup) { k := kernel.NewKernel(cfg, env, land) for i := 0; i < 10; i++ { - err := k.LocalRun() + err := k.LoopRun() if err != nil { panic(err) } diff --git a/core/context/read.go b/core/context/read.go index 66b46bb0..09425c6e 100644 --- a/core/context/read.go +++ b/core/context/read.go @@ -46,6 +46,10 @@ func (rc *ReadContext) GetBlockHash() *common.Hash { return rc.BlockHash } +func (rc *ReadContext) GetParams() string { + return rc.rdCall.Params +} + func (rc *ReadContext) Json(code int, v any) { rc.resp = &ResponseData{ StatusCode: code, diff --git a/core/kernel/run.go b/core/kernel/run.go index 6f2f88dc..13f3f34f 100644 --- a/core/kernel/run.go +++ b/core/kernel/run.go @@ -20,39 +20,27 @@ func (k *Kernel) Run() { } }() - - switch k.RunMode { - case LocalNode: - for { - select { - case <-k.stopChan: - logrus.Info("Stop the Chain!") + for { + select { + case <-k.stopChan: + logrus.Info("Stop the Chain!") + return + default: + block, err := k.LoopRun() + if err != nil { + logrus.Panicf("local-run blockchain error: %s on Block(%d)", err.Error(), block.Height) + } + if block.Height == k.cfg.MaxBlockNum { + logrus.Infof("Stop the Chain on Block(%d)", block.Height) return - default: - block, err := k.LocalRun() - if err != nil { - logrus.Panicf("local-run blockchain error: %s on Block(%d)", err.Error(), block.Height) - } - if block.Height == k.cfg.MaxBlockNum { - logrus.Infof("Stop the Chain on Block(%d)", block.Height) - return - } } - - } - case MasterWorker: - for { - err := k.MasterWorkerRun() - logrus.Errorf("master-worker-run blockchain error: %s", err.Error()) } - default: - logrus.Panic(NoRunMode) } } -func (k *Kernel) LocalRun() (newBlock *Block, err error) { +func (k *Kernel) LoopRun() (newBlock *Block, err error) { newBlock, err = k.makeNewBasicBlock() if err != nil { return @@ -61,9 +49,12 @@ func (k *Kernel) LocalRun() (newBlock *Block, err error) { // start a new block err = k.Land.RangeList(func(tri *Tripod) error { // start := time.Now() - tri.BlockCycle.StartBlock(newBlock) + err = tri.StartBlock(newBlock) + if err != nil { + logrus.Errorf("tripod(%s) StartBlock failed: %v", tri.Name(), err) + } + return err // metrics.StartBlockDuration.WithLabelValues(strconv.FormatInt(int64(newBlock.Height), 10), tri.Name()).Observe(time.Now().Sub(start).Seconds()) - return nil }) if err != nil { return @@ -72,9 +63,12 @@ func (k *Kernel) LocalRun() (newBlock *Block, err error) { // end block err = k.Land.RangeList(func(tri *Tripod) error { // start := time.Now() - tri.BlockCycle.EndBlock(newBlock) + err = tri.EndBlock(newBlock) + if err != nil { + logrus.Errorf("tripod(%s) EndBlock failed: %v", tri.Name(), err) + } + return err // metrics.EndBlockDuration.WithLabelValues(strconv.FormatInt(int64(newBlock.Height), 10), tri.Name()).Observe(time.Now().Sub(start).Seconds()) - return nil }) if err != nil { return @@ -83,9 +77,12 @@ func (k *Kernel) LocalRun() (newBlock *Block, err error) { // finalize this block err = k.Land.RangeList(func(tri *Tripod) error { // start := time.Now() - tri.BlockCycle.FinalizeBlock(newBlock) + err = tri.FinalizeBlock(newBlock) + if err != nil { + logrus.Errorf("tripod(%s) FinalizeBlock failed: %v", tri.Name(), err) + } + return err // metrics.FinalizeBlockDuration.WithLabelValues(strconv.FormatInt(int64(newBlock.Height), 10), tri.Name()).Observe(time.Now().Sub(start).Seconds()) - return nil }) return } @@ -188,42 +185,43 @@ func (k *Kernel) PostExecute(block *Block, receipts map[Hash]*Receipt) error { return err } -func (k *Kernel) MasterWorkerRun() error { - //workersIps, err := k.allWorkersIP() - //if err != nil { - // return err - //} - // - //newBlock := k.Chain.NewDefaultBlock() - // - //err = k.nortifyWorker(workersIps, StartBlockPath, newBlock) - //if err != nil { - // return err - //} - // - //// todo: if need broadcast block, - //// k.readyBroadcastBlock(newBlock) - // - //err = k.SyncTxns(newBlock) - //if err != nil { - // return err - //} - // - //err = k.nortifyWorker(workersIps, EndBlockPath, newBlock) - //if err != nil { - // return err - //} - // - //go func() { - // err := k.nortifyWorker(workersIps, ExecuteTxnsPath, newBlock) - // if err != nil { - // logrus.Errorf("nortify worker executing txns error: %s", err.Error()) - // } - //}() - // - //return k.nortifyWorker(workersIps, FinalizeBlockPath, newBlock) - return nil -} +//func (k *Kernel) MasterWorkerRun() (newBlock *Block, err error) { +// newBlock, err = k.makeNewBasicBlock() +// if err != nil { +// return +// } +// +// // start a new block +// err = k.Land.RangeList(func(tri *Tripod) error { +// // start := time.Now() +// tri.BlockCycle.StartBlock(newBlock) +// // metrics.StartBlockDuration.WithLabelValues(strconv.FormatInt(int64(newBlock.Height), 10), tri.Name()).Observe(time.Now().Sub(start).Seconds()) +// return nil +// }) +// if err != nil { +// return +// } +// +// // end block +// err = k.Land.RangeList(func(tri *Tripod) error { +// // start := time.Now() +// tri.BlockCycle.EndBlock(newBlock) +// // metrics.EndBlockDuration.WithLabelValues(strconv.FormatInt(int64(newBlock.Height), 10), tri.Name()).Observe(time.Now().Sub(start).Seconds()) +// return nil +// }) +// if err != nil { +// return +// } +// +// // finalize this block +// err = k.Land.RangeList(func(tri *Tripod) error { +// // start := time.Now() +// tri.BlockCycle.FinalizeBlock(newBlock) +// // metrics.FinalizeBlockDuration.WithLabelValues(strconv.FormatInt(int64(newBlock.Height), 10), tri.Name()).Observe(time.Now().Sub(start).Seconds()) +// return nil +// }) +// return +//} func (k *Kernel) HandleError(err error, ctx *context.WriteContext, block *Block, stxn *SignedTxn) *Receipt { logrus.Error("push error: ", err.Error()) diff --git a/core/startup/grpc.go b/core/startup/grpc.go index 546e9e58..5a746147 100644 --- a/core/startup/grpc.go +++ b/core/startup/grpc.go @@ -1,20 +1,30 @@ package startup -//func StartGrpcServer(cfg *config.KernelConf) { -// if cfg.RunMode != common.MasterWorker { -// return -// } -// lis, err := net.Listen("tcp", cfg.GrpcPort) -// if err != nil { -// logrus.Fatal("listen for grpc failed: ", err) -// } -// grpcServer := grpc.NewServer() -// goproto.RegisterStateDBServer(grpcServer, state.NewGrpcMptKV(StateDB)) -// goproto.RegisterLandServer(grpcServer, tripod.NewGrpcLand(Land)) -// // TODO: add chain server, pool server, txndb server. -// -// err = grpcServer.Serve(lis) -// if err != nil { -// logrus.Fatal("failed to serve grpc: ", err) -// } -//} +import ( + "github.com/sirupsen/logrus" + "github.com/yu-org/yu/common" + "github.com/yu-org/yu/config" + "github.com/yu-org/yu/core/tripod" + "github.com/yu-org/yu/core/types/goproto" + "google.golang.org/grpc" + "net" +) + +func StartGrpcServer(cfg *config.KernelConf) { + if cfg.RunMode != common.MasterWorker { + return + } + lis, err := net.Listen("tcp", cfg.GrpcPort) + if err != nil { + logrus.Fatal("listen for grpc failed: ", err) + } + grpcServer := grpc.NewServer() + //goproto.RegisterStateDBServer(grpcServer, state.NewGrpcMptKV(StateDB)) + goproto.RegisterLandServer(grpcServer, tripod.NewGrpcLand(Land)) + // TODO: add chain server, pool server, txndb server. + + err = grpcServer.Serve(lis) + if err != nil { + logrus.Fatal("failed to serve grpc: ", err) + } +} diff --git a/core/startup/startup.go b/core/startup/startup.go index 9b0fb040..4c4aa6b2 100644 --- a/core/startup/startup.go +++ b/core/startup/startup.go @@ -80,7 +80,7 @@ func InitKernel(cfg *config.KernelConf) *kernel.Kernel { StateDB = state.NewStateDB(cfg.StatedbType, kvdb) } - // StartGrpcServer(cfg) + StartGrpcServer(cfg) chainEnv := &env.ChainEnv{ State: StateDB, diff --git a/core/tripod/dev/funcs_grpc.go b/core/tripod/dev/funcs_grpc.go index 05e04092..ca1520db 100644 --- a/core/tripod/dev/funcs_grpc.go +++ b/core/tripod/dev/funcs_grpc.go @@ -1,75 +1,83 @@ package dev -// -//type GrpcWrRd struct { -// targetAddr string -// tripodName string -// funcName string -//} -// -//func NewGrpcWrRd(targetAddr, tripodName, funcName string) *GrpcWrRd { -// return &GrpcWrRd{ -// targetAddr: targetAddr, -// tripodName: tripodName, -// funcName: funcName, -// } -//} -// -//func (rpc *GrpcWrRd) Write(ctx *WriteContext) error { -// conn, err := grpc.Dial(rpc.targetAddr) -// if err != nil { -// return err -// } -// defer conn.Close() -// -// cli := goproto.NewWritingClient(conn) -// res, err := cli.Write(context.Background(), &goproto.WriteContext{ -// ReadContext: &goproto.ReadContext{ -// ParamsStr: ctx.ParamsStr, -// Response: nil, -// TripodName: rpc.tripodName, -// FuncName: rpc.funcName, -// }, -// Block: ctx.Block.ToPb(), -// Txn: ctx.Txn.ToPb(), -// LeiCost: ctx.LeiCost, -// }) -// if err != nil { -// return err -// } -// if res.Error != nil { -// return errors.New(res.Error.GetMsg()) -// } -// -// events := make([]*Event, 0) -// for _, value := range res.Values { -// events = append(events, &Event{Value: value}) -// } -// ctx.Events = events -// return nil -//} +import ( + "context" + "errors" + . "github.com/yu-org/yu/core/context" + "github.com/yu-org/yu/core/types" + "github.com/yu-org/yu/core/types/goproto" + "google.golang.org/grpc" +) -//func (rpc *GrpcWrRd) Read(ctx *ReadContext) error { -// conn, err := grpc.Dial(rpc.targetAddr) -// if err != nil { -// return err -// } -// defer conn.Close() -// -// cli := goproto.NewReadingClient(conn) -// res, err := cli.Read(context.Background(), &goproto.ReadContext{ -// ParamsStr: ctx.ParamsStr, -// Response: nil, -// TripodName: rpc.tripodName, -// FuncName: rpc.funcName, -// }) -// if err != nil { -// return err -// } -// if res.Error != nil { -// return errors.New(res.Error.GetMsg()) -// } -// -// ctx.Bytes(res.GetResponse()) -// return nil -//} +type GrpcWrRd struct { + targetAddr string + tripodName string + funcName string +} + +func NewGrpcWrRd(targetAddr, tripodName, funcName string) *GrpcWrRd { + return &GrpcWrRd{ + targetAddr: targetAddr, + tripodName: tripodName, + funcName: funcName, + } +} + +func (rpc *GrpcWrRd) Write(ctx *WriteContext) error { + conn, err := grpc.NewClient(rpc.targetAddr) + if err != nil { + return err + } + defer conn.Close() + + cli := goproto.NewWritingClient(conn) + res, err := cli.Write(context.Background(), &goproto.WriteContext{ + ReadContext: &goproto.ReadContext{ + ParamsStr: ctx.ParamsStr, + Response: nil, + TripodName: rpc.tripodName, + FuncName: rpc.funcName, + }, + Block: ctx.Block.ToPb(), + Txn: ctx.Txn.ToPb(), + LeiCost: ctx.LeiCost, + }) + if err != nil { + return err + } + if res.Error != nil { + return errors.New(res.Error.GetMsg()) + } + + events := make([]*types.Event, 0) + for _, value := range res.Values { + events = append(events, &types.Event{Value: value}) + } + ctx.Events = events + return nil +} + +func (rpc *GrpcWrRd) Read(ctx *ReadContext) error { + conn, err := grpc.NewClient(rpc.targetAddr) + if err != nil { + return err + } + defer conn.Close() + + cli := goproto.NewReadingClient(conn) + res, err := cli.Read(context.Background(), &goproto.ReadContext{ + ParamsStr: ctx.GetParams(), + Response: nil, + TripodName: rpc.tripodName, + FuncName: rpc.funcName, + }) + if err != nil { + return err + } + if res.Error != nil { + return errors.New(res.Error.GetMsg()) + } + + ctx.Data(int(res.GetCode()), res.GetContentType(), res.GetData()) + return nil +} diff --git a/core/tripod/land_grpc.go b/core/tripod/land_grpc.go index 3a134afe..be0ee075 100644 --- a/core/tripod/land_grpc.go +++ b/core/tripod/land_grpc.go @@ -1,29 +1,43 @@ package tripod -type GrpcLand struct { +import ( + "context" + "github.com/yu-org/yu/core/types/goproto" + "google.golang.org/grpc" + "google.golang.org/protobuf/types/known/emptypb" +) + +type GrpcLandServer struct { land *Land } -func NewGrpcLand(land *Land) *GrpcLand { - return &GrpcLand{land} +func NewGrpcLand(land *Land) *GrpcLandServer { + return &GrpcLandServer{land} } -//func (g *GrpcLand) SetTripods(_ context.Context, info *goproto.TripodsInfo) (*emptypb.Empty, error) { -// tripods := make([]*Tripod, 0) -// for _, triInfo := range info.Tripods { -// tripod := NewTripodWithName(triInfo.Name) -// for _, wrName := range triInfo.Writings { -// wrRd := dev.NewGrpcWrRd(triInfo.Endpoint, triInfo.Name, wrName) -// tripod.writings[wrName] = wrRd.Write -// } -// //for _, rdName := range triInfo.Readings { -// // wrRd := dev.NewGrpcWrRd(triInfo.Endpoint, triInfo.Name, rdName) -// // tripod.readings[rdName] = wrRd.Read -// //} -// // todo: set p2pHandles -// -// tripods = append(tripods) -// } -// g.land.SetTripods(tripods...) -// return nil, nil -//} +func (g *GrpcLandServer) SetTripods(_ context.Context, info *goproto.TripodsInfo) (*emptypb.Empty, error) { + tripods := make([]*Tripod, 0) + + for _, triInfo := range info.Tripods { + conn, err := grpc.NewClient(triInfo.Endpoint) + if err != nil { + return nil, err + } + tripod := NewTripodWithName(triInfo.Name).WithGrpcConn(conn) + ////set writings + //for _, wrName := range triInfo.Writings { + // wrRd := dev.NewGrpcWrRd(triInfo.Endpoint, triInfo.Name, wrName) + // tripod.writings[wrName] = wrRd.Write + //} + ////set readings + //for _, rdName := range triInfo.Readings { + // wrRd := dev.NewGrpcWrRd(triInfo.Endpoint, triInfo.Name, rdName) + // tripod.readings[rdName] = wrRd.Read + //} + // todo: set p2pHandles + + tripods = append(tripods, tripod) + } + g.land.SetTripods(tripods...) + return nil, nil +} diff --git a/core/tripod/tripod.go b/core/tripod/tripod.go index 328977b7..279e38c6 100644 --- a/core/tripod/tripod.go +++ b/core/tripod/tripod.go @@ -1,12 +1,16 @@ package tripod import ( + "context" + "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/yu-org/yu/common" - "github.com/yu-org/yu/core/context" + yucontext "github.com/yu-org/yu/core/context" "github.com/yu-org/yu/core/env" "github.com/yu-org/yu/core/tripod/dev" "github.com/yu-org/yu/core/types" + "github.com/yu-org/yu/core/types/goproto" + "google.golang.org/grpc" "path/filepath" "reflect" "runtime" @@ -30,6 +34,8 @@ type Tripod struct { Instance any name string + // only MasterWorker mode need this + rpcClient goproto.TripodClient // Key: Writing Name writings map[string]dev.Writing // Key: Reading Name @@ -58,6 +64,11 @@ func NewTripodWithName(name string) *Tripod { } } +func (t *Tripod) WithGrpcConn(rpcConn *grpc.ClientConn) *Tripod { + t.rpcClient = goproto.NewTripodClient(rpcConn) + return t +} + func (t *Tripod) SetInstance(tripodInstance any) { if t.name == "" { pkgStruct := reflect.TypeOf(tripodInstance).String() @@ -105,6 +116,66 @@ func (t *Tripod) Name() string { return t.name } +func (t *Tripod) StartBlock(b *types.Block) error { + if t.rpcClient != nil { + resp, err := t.rpcClient.StartBlock(context.Background(), &goproto.TripodBlockRequest{Block: b.ToPb()}) + if err != nil { + return err + } + if resp.Error != "" { + return errors.New(resp.Error) + } + block, err := types.BlockFromPb(resp.Block) + if err != nil { + return err + } + b.CopyFrom(block) + } else { + t.BlockCycle.StartBlock(b) + } + return nil +} + +func (t *Tripod) EndBlock(b *types.Block) error { + if t.rpcClient != nil { + resp, err := t.rpcClient.EndBlock(context.Background(), &goproto.TripodBlockRequest{Block: b.ToPb()}) + if err != nil { + return err + } + if resp.Error != "" { + return errors.New(resp.Error) + } + block, err := types.BlockFromPb(resp.Block) + if err != nil { + return err + } + b.CopyFrom(block) + } else { + t.BlockCycle.EndBlock(b) + } + return nil +} + +func (t *Tripod) FinalizeBlock(b *types.Block) error { + if t.rpcClient != nil { + resp, err := t.rpcClient.FinalizeBlock(context.Background(), &goproto.TripodBlockRequest{Block: b.ToPb()}) + if err != nil { + return err + } + if resp.Error != "" { + return errors.New(resp.Error) + } + block, err := types.BlockFromPb(resp.Block) + if err != nil { + return err + } + b.CopyFrom(block) + } else { + t.BlockCycle.FinalizeBlock(b) + } + return nil +} + func (t *Tripod) GetCurrentCompactBlock() (*types.CompactBlock, error) { return t.Chain.GetEndCompactBlock() } @@ -240,20 +311,20 @@ func (t *Tripod) PostExecute(block *types.Block, receipts map[common.Hash]*types return err } -func (t *Tripod) HandleError(err error, ctx *context.WriteContext, block *types.Block, stxn *types.SignedTxn) *types.Receipt { +func (t *Tripod) HandleError(err error, ctx *yucontext.WriteContext, block *types.Block, stxn *types.SignedTxn) *types.Receipt { logrus.Error("push error: ", err.Error()) receipt := types.NewReceipt(ctx.Events, err, ctx.Extra) t.HandleReceipt(ctx, receipt, block, stxn) return receipt } -func (t *Tripod) HandleEvent(ctx *context.WriteContext, block *types.Block, stxn *types.SignedTxn) *types.Receipt { +func (t *Tripod) HandleEvent(ctx *yucontext.WriteContext, block *types.Block, stxn *types.SignedTxn) *types.Receipt { receipt := types.NewReceipt(ctx.Events, nil, ctx.Extra) t.HandleReceipt(ctx, receipt, block, stxn) return receipt } -func (t *Tripod) HandleReceipt(ctx *context.WriteContext, receipt *types.Receipt, block *types.Block, stxn *types.SignedTxn) { +func (t *Tripod) HandleReceipt(ctx *yucontext.WriteContext, receipt *types.Receipt, block *types.Block, stxn *types.SignedTxn) { receipt.FillMetadata(block, stxn, ctx.LeiCost) receipt.BlockStage = common.ExecuteTxnsStage diff --git a/core/types/goproto/blockchain_grpc.pb.go b/core/types/goproto/blockchain_grpc.pb.go new file mode 100644 index 00000000..df120649 --- /dev/null +++ b/core/types/goproto/blockchain_grpc.pb.go @@ -0,0 +1,500 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v4.25.2 +// source: blockchain.proto + +package goproto + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + BlockChain_GetGenesis_FullMethodName = "/BlockChain/GetGenesis" + BlockChain_SetGenesis_FullMethodName = "/BlockChain/SetGenesis" + BlockChain_AppendBlock_FullMethodName = "/BlockChain/AppendBlock" + BlockChain_GetBlock_FullMethodName = "/BlockChain/GetBlock" + BlockChain_ExistsBlock_FullMethodName = "/BlockChain/ExistsBlock" + BlockChain_UpdateBlock_FullMethodName = "/BlockChain/UpdateBlock" + BlockChain_Children_FullMethodName = "/BlockChain/Children" + BlockChain_Finalize_FullMethodName = "/BlockChain/Finalize" + BlockChain_GetFinalizedBlock_FullMethodName = "/BlockChain/GetFinalizedBlock" + BlockChain_GetEndBlock_FullMethodName = "/BlockChain/GetEndBlock" + BlockChain_GetRangeBlocks_FullMethodName = "/BlockChain/GetRangeBlocks" +) + +// BlockChainClient is the client API for BlockChain 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. +type BlockChainClient interface { + GetGenesis(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*BlockResponse, error) + SetGenesis(ctx context.Context, in *CompactBlock, opts ...grpc.CallOption) (*Err, error) + AppendBlock(ctx context.Context, in *CompactBlock, opts ...grpc.CallOption) (*Err, error) + GetBlock(ctx context.Context, in *BlockHash, opts ...grpc.CallOption) (*BlockResponse, error) + ExistsBlock(ctx context.Context, in *BlockHash, opts ...grpc.CallOption) (*Bool, error) + UpdateBlock(ctx context.Context, in *CompactBlock, opts ...grpc.CallOption) (*Err, error) + Children(ctx context.Context, in *BlockHash, opts ...grpc.CallOption) (*BlocksResponse, error) + Finalize(ctx context.Context, in *BlockHash, opts ...grpc.CallOption) (*Err, error) + GetFinalizedBlock(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*BlockResponse, error) + GetEndBlock(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*BlockResponse, error) + GetRangeBlocks(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*BlocksResponse, error) +} + +type blockChainClient struct { + cc grpc.ClientConnInterface +} + +func NewBlockChainClient(cc grpc.ClientConnInterface) BlockChainClient { + return &blockChainClient{cc} +} + +func (c *blockChainClient) GetGenesis(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*BlockResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BlockResponse) + err := c.cc.Invoke(ctx, BlockChain_GetGenesis_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockChainClient) SetGenesis(ctx context.Context, in *CompactBlock, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, BlockChain_SetGenesis_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockChainClient) AppendBlock(ctx context.Context, in *CompactBlock, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, BlockChain_AppendBlock_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockChainClient) GetBlock(ctx context.Context, in *BlockHash, opts ...grpc.CallOption) (*BlockResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BlockResponse) + err := c.cc.Invoke(ctx, BlockChain_GetBlock_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockChainClient) ExistsBlock(ctx context.Context, in *BlockHash, opts ...grpc.CallOption) (*Bool, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Bool) + err := c.cc.Invoke(ctx, BlockChain_ExistsBlock_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockChainClient) UpdateBlock(ctx context.Context, in *CompactBlock, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, BlockChain_UpdateBlock_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockChainClient) Children(ctx context.Context, in *BlockHash, opts ...grpc.CallOption) (*BlocksResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BlocksResponse) + err := c.cc.Invoke(ctx, BlockChain_Children_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockChainClient) Finalize(ctx context.Context, in *BlockHash, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, BlockChain_Finalize_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockChainClient) GetFinalizedBlock(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*BlockResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BlockResponse) + err := c.cc.Invoke(ctx, BlockChain_GetFinalizedBlock_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockChainClient) GetEndBlock(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*BlockResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BlockResponse) + err := c.cc.Invoke(ctx, BlockChain_GetEndBlock_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blockChainClient) GetRangeBlocks(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*BlocksResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BlocksResponse) + err := c.cc.Invoke(ctx, BlockChain_GetRangeBlocks_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// BlockChainServer is the server API for BlockChain service. +// All implementations should embed UnimplementedBlockChainServer +// for forward compatibility. +type BlockChainServer interface { + GetGenesis(context.Context, *emptypb.Empty) (*BlockResponse, error) + SetGenesis(context.Context, *CompactBlock) (*Err, error) + AppendBlock(context.Context, *CompactBlock) (*Err, error) + GetBlock(context.Context, *BlockHash) (*BlockResponse, error) + ExistsBlock(context.Context, *BlockHash) (*Bool, error) + UpdateBlock(context.Context, *CompactBlock) (*Err, error) + Children(context.Context, *BlockHash) (*BlocksResponse, error) + Finalize(context.Context, *BlockHash) (*Err, error) + GetFinalizedBlock(context.Context, *emptypb.Empty) (*BlockResponse, error) + GetEndBlock(context.Context, *emptypb.Empty) (*BlockResponse, error) + GetRangeBlocks(context.Context, *RangeRequest) (*BlocksResponse, error) +} + +// UnimplementedBlockChainServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedBlockChainServer struct{} + +func (UnimplementedBlockChainServer) GetGenesis(context.Context, *emptypb.Empty) (*BlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGenesis not implemented") +} +func (UnimplementedBlockChainServer) SetGenesis(context.Context, *CompactBlock) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetGenesis not implemented") +} +func (UnimplementedBlockChainServer) AppendBlock(context.Context, *CompactBlock) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method AppendBlock not implemented") +} +func (UnimplementedBlockChainServer) GetBlock(context.Context, *BlockHash) (*BlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBlock not implemented") +} +func (UnimplementedBlockChainServer) ExistsBlock(context.Context, *BlockHash) (*Bool, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExistsBlock not implemented") +} +func (UnimplementedBlockChainServer) UpdateBlock(context.Context, *CompactBlock) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateBlock not implemented") +} +func (UnimplementedBlockChainServer) Children(context.Context, *BlockHash) (*BlocksResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Children not implemented") +} +func (UnimplementedBlockChainServer) Finalize(context.Context, *BlockHash) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method Finalize not implemented") +} +func (UnimplementedBlockChainServer) GetFinalizedBlock(context.Context, *emptypb.Empty) (*BlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetFinalizedBlock not implemented") +} +func (UnimplementedBlockChainServer) GetEndBlock(context.Context, *emptypb.Empty) (*BlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEndBlock not implemented") +} +func (UnimplementedBlockChainServer) GetRangeBlocks(context.Context, *RangeRequest) (*BlocksResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRangeBlocks not implemented") +} +func (UnimplementedBlockChainServer) testEmbeddedByValue() {} + +// UnsafeBlockChainServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to BlockChainServer will +// result in compilation errors. +type UnsafeBlockChainServer interface { + mustEmbedUnimplementedBlockChainServer() +} + +func RegisterBlockChainServer(s grpc.ServiceRegistrar, srv BlockChainServer) { + // If the following call pancis, it indicates UnimplementedBlockChainServer 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(&BlockChain_ServiceDesc, srv) +} + +func _BlockChain_GetGenesis_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockChainServer).GetGenesis(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BlockChain_GetGenesis_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockChainServer).GetGenesis(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockChain_SetGenesis_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CompactBlock) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockChainServer).SetGenesis(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BlockChain_SetGenesis_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockChainServer).SetGenesis(ctx, req.(*CompactBlock)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockChain_AppendBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CompactBlock) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockChainServer).AppendBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BlockChain_AppendBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockChainServer).AppendBlock(ctx, req.(*CompactBlock)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockChain_GetBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockHash) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockChainServer).GetBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BlockChain_GetBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockChainServer).GetBlock(ctx, req.(*BlockHash)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockChain_ExistsBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockHash) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockChainServer).ExistsBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BlockChain_ExistsBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockChainServer).ExistsBlock(ctx, req.(*BlockHash)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockChain_UpdateBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CompactBlock) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockChainServer).UpdateBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BlockChain_UpdateBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockChainServer).UpdateBlock(ctx, req.(*CompactBlock)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockChain_Children_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockHash) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockChainServer).Children(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BlockChain_Children_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockChainServer).Children(ctx, req.(*BlockHash)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockChain_Finalize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockHash) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockChainServer).Finalize(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BlockChain_Finalize_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockChainServer).Finalize(ctx, req.(*BlockHash)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockChain_GetFinalizedBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockChainServer).GetFinalizedBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BlockChain_GetFinalizedBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockChainServer).GetFinalizedBlock(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockChain_GetEndBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockChainServer).GetEndBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BlockChain_GetEndBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockChainServer).GetEndBlock(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlockChain_GetRangeBlocks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RangeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlockChainServer).GetRangeBlocks(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BlockChain_GetRangeBlocks_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlockChainServer).GetRangeBlocks(ctx, req.(*RangeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// BlockChain_ServiceDesc is the grpc.ServiceDesc for BlockChain service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var BlockChain_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "BlockChain", + HandlerType: (*BlockChainServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetGenesis", + Handler: _BlockChain_GetGenesis_Handler, + }, + { + MethodName: "SetGenesis", + Handler: _BlockChain_SetGenesis_Handler, + }, + { + MethodName: "AppendBlock", + Handler: _BlockChain_AppendBlock_Handler, + }, + { + MethodName: "GetBlock", + Handler: _BlockChain_GetBlock_Handler, + }, + { + MethodName: "ExistsBlock", + Handler: _BlockChain_ExistsBlock_Handler, + }, + { + MethodName: "UpdateBlock", + Handler: _BlockChain_UpdateBlock_Handler, + }, + { + MethodName: "Children", + Handler: _BlockChain_Children_Handler, + }, + { + MethodName: "Finalize", + Handler: _BlockChain_Finalize_Handler, + }, + { + MethodName: "GetFinalizedBlock", + Handler: _BlockChain_GetFinalizedBlock_Handler, + }, + { + MethodName: "GetEndBlock", + Handler: _BlockChain_GetEndBlock_Handler, + }, + { + MethodName: "GetRangeBlocks", + Handler: _BlockChain_GetRangeBlocks_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "blockchain.proto", +} diff --git a/core/types/goproto/funcs.pb.go b/core/types/goproto/funcs.pb.go index 6193cc97..694cc792 100644 --- a/core/types/goproto/funcs.pb.go +++ b/core/types/goproto/funcs.pb.go @@ -222,8 +222,10 @@ type ReadResult struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Response []byte `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - Error *Err `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + ContentType string `protobuf:"bytes,2,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Error *Err `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` } func (x *ReadResult) Reset() { @@ -258,9 +260,23 @@ func (*ReadResult) Descriptor() ([]byte, []int) { return file_funcs_proto_rawDescGZIP(), []int{3} } -func (x *ReadResult) GetResponse() []byte { +func (x *ReadResult) GetCode() int32 { if x != nil { - return x.Response + return x.Code + } + return 0 +} + +func (x *ReadResult) GetContentType() string { + if x != nil { + return x.ContentType + } + return "" +} + +func (x *ReadResult) GetData() []byte { + if x != nil { + return x.Data } return nil } @@ -300,19 +316,22 @@ var file_funcs_proto_rawDesc = []byte{ 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x04, 0x2e, 0x45, 0x72, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x44, 0x0a, 0x0a, - 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 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, 0x1a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x45, 0x72, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x32, 0x2f, 0x0a, 0x07, 0x57, 0x72, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x24, 0x0a, - 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x0d, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x78, 0x74, 0x1a, 0x0c, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x32, 0x2c, 0x0a, 0x07, 0x52, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x21, - 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x0c, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x78, 0x74, 0x1a, 0x0b, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x04, 0x2e, 0x45, 0x72, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x73, 0x0a, 0x0a, + 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x45, 0x72, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x32, 0x2f, 0x0a, 0x07, 0x57, 0x72, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x24, 0x0a, 0x05, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x0d, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x1a, 0x0c, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x32, 0x2c, 0x0a, 0x07, 0x52, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x21, 0x0a, + 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x0c, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x78, 0x74, 0x1a, 0x0b, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/core/types/goproto/funcs_grpc.pb.go b/core/types/goproto/funcs_grpc.pb.go new file mode 100644 index 00000000..4a17b2b6 --- /dev/null +++ b/core/types/goproto/funcs_grpc.pb.go @@ -0,0 +1,219 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v4.25.2 +// source: funcs.proto + +package goproto + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Writing_Write_FullMethodName = "/Writing/Write" +) + +// WritingClient is the client API for Writing 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. +type WritingClient interface { + Write(ctx context.Context, in *WriteContext, opts ...grpc.CallOption) (*WriteResult, error) +} + +type writingClient struct { + cc grpc.ClientConnInterface +} + +func NewWritingClient(cc grpc.ClientConnInterface) WritingClient { + return &writingClient{cc} +} + +func (c *writingClient) Write(ctx context.Context, in *WriteContext, opts ...grpc.CallOption) (*WriteResult, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(WriteResult) + err := c.cc.Invoke(ctx, Writing_Write_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// WritingServer is the server API for Writing service. +// All implementations should embed UnimplementedWritingServer +// for forward compatibility. +type WritingServer interface { + Write(context.Context, *WriteContext) (*WriteResult, error) +} + +// UnimplementedWritingServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedWritingServer struct{} + +func (UnimplementedWritingServer) Write(context.Context, *WriteContext) (*WriteResult, error) { + return nil, status.Errorf(codes.Unimplemented, "method Write not implemented") +} +func (UnimplementedWritingServer) testEmbeddedByValue() {} + +// UnsafeWritingServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to WritingServer will +// result in compilation errors. +type UnsafeWritingServer interface { + mustEmbedUnimplementedWritingServer() +} + +func RegisterWritingServer(s grpc.ServiceRegistrar, srv WritingServer) { + // If the following call pancis, it indicates UnimplementedWritingServer 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(&Writing_ServiceDesc, srv) +} + +func _Writing_Write_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WriteContext) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WritingServer).Write(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Writing_Write_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WritingServer).Write(ctx, req.(*WriteContext)) + } + return interceptor(ctx, in, info, handler) +} + +// Writing_ServiceDesc is the grpc.ServiceDesc for Writing service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Writing_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "Writing", + HandlerType: (*WritingServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Write", + Handler: _Writing_Write_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "funcs.proto", +} + +const ( + Reading_Read_FullMethodName = "/Reading/Read" +) + +// ReadingClient is the client API for Reading 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. +type ReadingClient interface { + Read(ctx context.Context, in *ReadContext, opts ...grpc.CallOption) (*ReadResult, error) +} + +type readingClient struct { + cc grpc.ClientConnInterface +} + +func NewReadingClient(cc grpc.ClientConnInterface) ReadingClient { + return &readingClient{cc} +} + +func (c *readingClient) Read(ctx context.Context, in *ReadContext, opts ...grpc.CallOption) (*ReadResult, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ReadResult) + err := c.cc.Invoke(ctx, Reading_Read_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ReadingServer is the server API for Reading service. +// All implementations should embed UnimplementedReadingServer +// for forward compatibility. +type ReadingServer interface { + Read(context.Context, *ReadContext) (*ReadResult, error) +} + +// UnimplementedReadingServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedReadingServer struct{} + +func (UnimplementedReadingServer) Read(context.Context, *ReadContext) (*ReadResult, error) { + return nil, status.Errorf(codes.Unimplemented, "method Read not implemented") +} +func (UnimplementedReadingServer) testEmbeddedByValue() {} + +// UnsafeReadingServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ReadingServer will +// result in compilation errors. +type UnsafeReadingServer interface { + mustEmbedUnimplementedReadingServer() +} + +func RegisterReadingServer(s grpc.ServiceRegistrar, srv ReadingServer) { + // If the following call pancis, it indicates UnimplementedReadingServer 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(&Reading_ServiceDesc, srv) +} + +func _Reading_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReadContext) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReadingServer).Read(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Reading_Read_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReadingServer).Read(ctx, req.(*ReadContext)) + } + return interceptor(ctx, in, info, handler) +} + +// Reading_ServiceDesc is the grpc.ServiceDesc for Reading service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Reading_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "Reading", + HandlerType: (*ReadingServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Read", + Handler: _Reading_Read_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "funcs.proto", +} diff --git a/core/types/goproto/p2p_grpc.pb.go b/core/types/goproto/p2p_grpc.pb.go new file mode 100644 index 00000000..e9c8ee1d --- /dev/null +++ b/core/types/goproto/p2p_grpc.pb.go @@ -0,0 +1,280 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v4.25.2 +// source: p2p.proto + +package goproto + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + P2PNetwork_RequestPeer_FullMethodName = "/P2pNetwork/RequestPeer" + P2PNetwork_HandleRequest_FullMethodName = "/P2pNetwork/HandleRequest" + P2PNetwork_AddTopic_FullMethodName = "/P2pNetwork/AddTopic" + P2PNetwork_PubP2P_FullMethodName = "/P2pNetwork/PubP2P" + P2PNetwork_SubP2P_FullMethodName = "/P2pNetwork/SubP2P" +) + +// P2PNetworkClient is the client API for P2PNetwork 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. +type P2PNetworkClient interface { + // kernel(rpc server) + // tripods --call--> kernel + RequestPeer(ctx context.Context, in *StreamRequest, opts ...grpc.CallOption) (*StreamResponse, error) + // kernel(rpc client) + // kernel --call--> tripods + HandleRequest(ctx context.Context, in *Bytes, opts ...grpc.CallOption) (*StreamResponse, error) + AddTopic(ctx context.Context, in *String, opts ...grpc.CallOption) (*emptypb.Empty, error) + PubP2P(ctx context.Context, in *PubRequest, opts ...grpc.CallOption) (*Err, error) + SubP2P(ctx context.Context, in *SubRequest, opts ...grpc.CallOption) (*SubResponse, error) +} + +type p2PNetworkClient struct { + cc grpc.ClientConnInterface +} + +func NewP2PNetworkClient(cc grpc.ClientConnInterface) P2PNetworkClient { + return &p2PNetworkClient{cc} +} + +func (c *p2PNetworkClient) RequestPeer(ctx context.Context, in *StreamRequest, opts ...grpc.CallOption) (*StreamResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StreamResponse) + err := c.cc.Invoke(ctx, P2PNetwork_RequestPeer_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *p2PNetworkClient) HandleRequest(ctx context.Context, in *Bytes, opts ...grpc.CallOption) (*StreamResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StreamResponse) + err := c.cc.Invoke(ctx, P2PNetwork_HandleRequest_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *p2PNetworkClient) AddTopic(ctx context.Context, in *String, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, P2PNetwork_AddTopic_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *p2PNetworkClient) PubP2P(ctx context.Context, in *PubRequest, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, P2PNetwork_PubP2P_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *p2PNetworkClient) SubP2P(ctx context.Context, in *SubRequest, opts ...grpc.CallOption) (*SubResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SubResponse) + err := c.cc.Invoke(ctx, P2PNetwork_SubP2P_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// P2PNetworkServer is the server API for P2PNetwork service. +// All implementations should embed UnimplementedP2PNetworkServer +// for forward compatibility. +type P2PNetworkServer interface { + // kernel(rpc server) + // tripods --call--> kernel + RequestPeer(context.Context, *StreamRequest) (*StreamResponse, error) + // kernel(rpc client) + // kernel --call--> tripods + HandleRequest(context.Context, *Bytes) (*StreamResponse, error) + AddTopic(context.Context, *String) (*emptypb.Empty, error) + PubP2P(context.Context, *PubRequest) (*Err, error) + SubP2P(context.Context, *SubRequest) (*SubResponse, error) +} + +// UnimplementedP2PNetworkServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedP2PNetworkServer struct{} + +func (UnimplementedP2PNetworkServer) RequestPeer(context.Context, *StreamRequest) (*StreamResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RequestPeer not implemented") +} +func (UnimplementedP2PNetworkServer) HandleRequest(context.Context, *Bytes) (*StreamResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HandleRequest not implemented") +} +func (UnimplementedP2PNetworkServer) AddTopic(context.Context, *String) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddTopic not implemented") +} +func (UnimplementedP2PNetworkServer) PubP2P(context.Context, *PubRequest) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method PubP2P not implemented") +} +func (UnimplementedP2PNetworkServer) SubP2P(context.Context, *SubRequest) (*SubResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubP2P not implemented") +} +func (UnimplementedP2PNetworkServer) testEmbeddedByValue() {} + +// UnsafeP2PNetworkServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to P2PNetworkServer will +// result in compilation errors. +type UnsafeP2PNetworkServer interface { + mustEmbedUnimplementedP2PNetworkServer() +} + +func RegisterP2PNetworkServer(s grpc.ServiceRegistrar, srv P2PNetworkServer) { + // If the following call pancis, it indicates UnimplementedP2PNetworkServer 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(&P2PNetwork_ServiceDesc, srv) +} + +func _P2PNetwork_RequestPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StreamRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(P2PNetworkServer).RequestPeer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: P2PNetwork_RequestPeer_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(P2PNetworkServer).RequestPeer(ctx, req.(*StreamRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _P2PNetwork_HandleRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Bytes) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(P2PNetworkServer).HandleRequest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: P2PNetwork_HandleRequest_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(P2PNetworkServer).HandleRequest(ctx, req.(*Bytes)) + } + return interceptor(ctx, in, info, handler) +} + +func _P2PNetwork_AddTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(String) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(P2PNetworkServer).AddTopic(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: P2PNetwork_AddTopic_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(P2PNetworkServer).AddTopic(ctx, req.(*String)) + } + return interceptor(ctx, in, info, handler) +} + +func _P2PNetwork_PubP2P_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PubRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(P2PNetworkServer).PubP2P(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: P2PNetwork_PubP2P_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(P2PNetworkServer).PubP2P(ctx, req.(*PubRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _P2PNetwork_SubP2P_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SubRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(P2PNetworkServer).SubP2P(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: P2PNetwork_SubP2P_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(P2PNetworkServer).SubP2P(ctx, req.(*SubRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// P2PNetwork_ServiceDesc is the grpc.ServiceDesc for P2PNetwork service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var P2PNetwork_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "P2pNetwork", + HandlerType: (*P2PNetworkServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "RequestPeer", + Handler: _P2PNetwork_RequestPeer_Handler, + }, + { + MethodName: "HandleRequest", + Handler: _P2PNetwork_HandleRequest_Handler, + }, + { + MethodName: "AddTopic", + Handler: _P2PNetwork_AddTopic_Handler, + }, + { + MethodName: "PubP2P", + Handler: _P2PNetwork_PubP2P_Handler, + }, + { + MethodName: "SubP2P", + Handler: _P2PNetwork_SubP2P_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "p2p.proto", +} diff --git a/core/types/goproto/statedb_grpc.pb.go b/core/types/goproto/statedb_grpc.pb.go new file mode 100644 index 00000000..673beebe --- /dev/null +++ b/core/types/goproto/statedb_grpc.pb.go @@ -0,0 +1,500 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v4.25.2 +// source: statedb.proto + +package goproto + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + StateDB_Get_FullMethodName = "/StateDB/Get" + StateDB_Set_FullMethodName = "/StateDB/Set" + StateDB_Delete_FullMethodName = "/StateDB/Delete" + StateDB_Exist_FullMethodName = "/StateDB/Exist" + StateDB_GetByBlockHash_FullMethodName = "/StateDB/GetByBlockHash" + StateDB_GetFinalized_FullMethodName = "/StateDB/GetFinalized" + StateDB_StartBlock_FullMethodName = "/StateDB/StartBlock" + StateDB_Commit_FullMethodName = "/StateDB/Commit" + StateDB_Discard_FullMethodName = "/StateDB/Discard" + StateDB_DiscardAll_FullMethodName = "/StateDB/DiscardAll" + StateDB_NextTxn_FullMethodName = "/StateDB/NextTxn" +) + +// StateDBClient is the client API for StateDB 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. +type StateDBClient interface { + Get(ctx context.Context, in *Key, opts ...grpc.CallOption) (*ValueResponse, error) + Set(ctx context.Context, in *KeyValue, opts ...grpc.CallOption) (*emptypb.Empty, error) + Delete(ctx context.Context, in *Key, opts ...grpc.CallOption) (*emptypb.Empty, error) + Exist(ctx context.Context, in *Key, opts ...grpc.CallOption) (*Bool, error) + GetByBlockHash(ctx context.Context, in *KeyByHash, opts ...grpc.CallOption) (*ValueResponse, error) + GetFinalized(ctx context.Context, in *Key, opts ...grpc.CallOption) (*ValueResponse, error) + StartBlock(ctx context.Context, in *TxnHash, opts ...grpc.CallOption) (*emptypb.Empty, error) + Commit(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*TxnHashResponse, error) + Discard(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) + DiscardAll(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) + NextTxn(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type stateDBClient struct { + cc grpc.ClientConnInterface +} + +func NewStateDBClient(cc grpc.ClientConnInterface) StateDBClient { + return &stateDBClient{cc} +} + +func (c *stateDBClient) Get(ctx context.Context, in *Key, opts ...grpc.CallOption) (*ValueResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ValueResponse) + err := c.cc.Invoke(ctx, StateDB_Get_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateDBClient) Set(ctx context.Context, in *KeyValue, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, StateDB_Set_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateDBClient) Delete(ctx context.Context, in *Key, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, StateDB_Delete_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateDBClient) Exist(ctx context.Context, in *Key, opts ...grpc.CallOption) (*Bool, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Bool) + err := c.cc.Invoke(ctx, StateDB_Exist_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateDBClient) GetByBlockHash(ctx context.Context, in *KeyByHash, opts ...grpc.CallOption) (*ValueResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ValueResponse) + err := c.cc.Invoke(ctx, StateDB_GetByBlockHash_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateDBClient) GetFinalized(ctx context.Context, in *Key, opts ...grpc.CallOption) (*ValueResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ValueResponse) + err := c.cc.Invoke(ctx, StateDB_GetFinalized_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateDBClient) StartBlock(ctx context.Context, in *TxnHash, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, StateDB_StartBlock_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateDBClient) Commit(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*TxnHashResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TxnHashResponse) + err := c.cc.Invoke(ctx, StateDB_Commit_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateDBClient) Discard(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, StateDB_Discard_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateDBClient) DiscardAll(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, StateDB_DiscardAll_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateDBClient) NextTxn(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, StateDB_NextTxn_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// StateDBServer is the server API for StateDB service. +// All implementations should embed UnimplementedStateDBServer +// for forward compatibility. +type StateDBServer interface { + Get(context.Context, *Key) (*ValueResponse, error) + Set(context.Context, *KeyValue) (*emptypb.Empty, error) + Delete(context.Context, *Key) (*emptypb.Empty, error) + Exist(context.Context, *Key) (*Bool, error) + GetByBlockHash(context.Context, *KeyByHash) (*ValueResponse, error) + GetFinalized(context.Context, *Key) (*ValueResponse, error) + StartBlock(context.Context, *TxnHash) (*emptypb.Empty, error) + Commit(context.Context, *emptypb.Empty) (*TxnHashResponse, error) + Discard(context.Context, *emptypb.Empty) (*emptypb.Empty, error) + DiscardAll(context.Context, *emptypb.Empty) (*emptypb.Empty, error) + NextTxn(context.Context, *emptypb.Empty) (*emptypb.Empty, error) +} + +// UnimplementedStateDBServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedStateDBServer struct{} + +func (UnimplementedStateDBServer) Get(context.Context, *Key) (*ValueResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedStateDBServer) Set(context.Context, *KeyValue) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Set not implemented") +} +func (UnimplementedStateDBServer) Delete(context.Context, *Key) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedStateDBServer) Exist(context.Context, *Key) (*Bool, error) { + return nil, status.Errorf(codes.Unimplemented, "method Exist not implemented") +} +func (UnimplementedStateDBServer) GetByBlockHash(context.Context, *KeyByHash) (*ValueResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetByBlockHash not implemented") +} +func (UnimplementedStateDBServer) GetFinalized(context.Context, *Key) (*ValueResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetFinalized not implemented") +} +func (UnimplementedStateDBServer) StartBlock(context.Context, *TxnHash) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method StartBlock not implemented") +} +func (UnimplementedStateDBServer) Commit(context.Context, *emptypb.Empty) (*TxnHashResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Commit not implemented") +} +func (UnimplementedStateDBServer) Discard(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Discard not implemented") +} +func (UnimplementedStateDBServer) DiscardAll(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DiscardAll not implemented") +} +func (UnimplementedStateDBServer) NextTxn(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method NextTxn not implemented") +} +func (UnimplementedStateDBServer) testEmbeddedByValue() {} + +// UnsafeStateDBServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StateDBServer will +// result in compilation errors. +type UnsafeStateDBServer interface { + mustEmbedUnimplementedStateDBServer() +} + +func RegisterStateDBServer(s grpc.ServiceRegistrar, srv StateDBServer) { + // If the following call pancis, it indicates UnimplementedStateDBServer 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(&StateDB_ServiceDesc, srv) +} + +func _StateDB_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Key) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateDBServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateDB_Get_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateDBServer).Get(ctx, req.(*Key)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateDB_Set_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KeyValue) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateDBServer).Set(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateDB_Set_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateDBServer).Set(ctx, req.(*KeyValue)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateDB_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Key) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateDBServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateDB_Delete_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateDBServer).Delete(ctx, req.(*Key)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateDB_Exist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Key) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateDBServer).Exist(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateDB_Exist_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateDBServer).Exist(ctx, req.(*Key)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateDB_GetByBlockHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KeyByHash) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateDBServer).GetByBlockHash(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateDB_GetByBlockHash_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateDBServer).GetByBlockHash(ctx, req.(*KeyByHash)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateDB_GetFinalized_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Key) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateDBServer).GetFinalized(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateDB_GetFinalized_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateDBServer).GetFinalized(ctx, req.(*Key)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateDB_StartBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TxnHash) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateDBServer).StartBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateDB_StartBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateDBServer).StartBlock(ctx, req.(*TxnHash)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateDB_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateDBServer).Commit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateDB_Commit_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateDBServer).Commit(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateDB_Discard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateDBServer).Discard(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateDB_Discard_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateDBServer).Discard(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateDB_DiscardAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateDBServer).DiscardAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateDB_DiscardAll_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateDBServer).DiscardAll(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateDB_NextTxn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateDBServer).NextTxn(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateDB_NextTxn_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateDBServer).NextTxn(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +// StateDB_ServiceDesc is the grpc.ServiceDesc for StateDB service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var StateDB_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "StateDB", + HandlerType: (*StateDBServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Get", + Handler: _StateDB_Get_Handler, + }, + { + MethodName: "Set", + Handler: _StateDB_Set_Handler, + }, + { + MethodName: "Delete", + Handler: _StateDB_Delete_Handler, + }, + { + MethodName: "Exist", + Handler: _StateDB_Exist_Handler, + }, + { + MethodName: "GetByBlockHash", + Handler: _StateDB_GetByBlockHash_Handler, + }, + { + MethodName: "GetFinalized", + Handler: _StateDB_GetFinalized_Handler, + }, + { + MethodName: "StartBlock", + Handler: _StateDB_StartBlock_Handler, + }, + { + MethodName: "Commit", + Handler: _StateDB_Commit_Handler, + }, + { + MethodName: "Discard", + Handler: _StateDB_Discard_Handler, + }, + { + MethodName: "DiscardAll", + Handler: _StateDB_DiscardAll_Handler, + }, + { + MethodName: "NextTxn", + Handler: _StateDB_NextTxn_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "statedb.proto", +} diff --git a/core/types/goproto/subscription_grpc.pb.go b/core/types/goproto/subscription_grpc.pb.go new file mode 100644 index 00000000..5eaa9ec6 --- /dev/null +++ b/core/types/goproto/subscription_grpc.pb.go @@ -0,0 +1,119 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v4.25.2 +// source: subscription.proto + +package goproto + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Subscription_Emit_FullMethodName = "/Subscription/Emit" +) + +// SubscriptionClient is the client API for Subscription 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. +type SubscriptionClient interface { + Emit(ctx context.Context, in *Bytes, opts ...grpc.CallOption) (*Err, error) +} + +type subscriptionClient struct { + cc grpc.ClientConnInterface +} + +func NewSubscriptionClient(cc grpc.ClientConnInterface) SubscriptionClient { + return &subscriptionClient{cc} +} + +func (c *subscriptionClient) Emit(ctx context.Context, in *Bytes, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, Subscription_Emit_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SubscriptionServer is the server API for Subscription service. +// All implementations should embed UnimplementedSubscriptionServer +// for forward compatibility. +type SubscriptionServer interface { + Emit(context.Context, *Bytes) (*Err, error) +} + +// UnimplementedSubscriptionServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedSubscriptionServer struct{} + +func (UnimplementedSubscriptionServer) Emit(context.Context, *Bytes) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method Emit not implemented") +} +func (UnimplementedSubscriptionServer) testEmbeddedByValue() {} + +// UnsafeSubscriptionServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to SubscriptionServer will +// result in compilation errors. +type UnsafeSubscriptionServer interface { + mustEmbedUnimplementedSubscriptionServer() +} + +func RegisterSubscriptionServer(s grpc.ServiceRegistrar, srv SubscriptionServer) { + // If the following call pancis, it indicates UnimplementedSubscriptionServer 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(&Subscription_ServiceDesc, srv) +} + +func _Subscription_Emit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Bytes) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriptionServer).Emit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Subscription_Emit_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriptionServer).Emit(ctx, req.(*Bytes)) + } + return interceptor(ctx, in, info, handler) +} + +// Subscription_ServiceDesc is the grpc.ServiceDesc for Subscription service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Subscription_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "Subscription", + HandlerType: (*SubscriptionServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Emit", + Handler: _Subscription_Emit_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "subscription.proto", +} diff --git a/core/types/goproto/tripod.pb.go b/core/types/goproto/tripod.pb.go index 6620ec8b..ff6d15d4 100644 --- a/core/types/goproto/tripod.pb.go +++ b/core/types/goproto/tripod.pb.go @@ -207,8 +207,8 @@ type TripodBlockRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TripodName string `protobuf:"bytes,1,opt,name=tripod_name,json=tripodName,proto3" json:"tripod_name,omitempty"` - Block *CompactBlock `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + TripodName string `protobuf:"bytes,1,opt,name=tripod_name,json=tripodName,proto3" json:"tripod_name,omitempty"` + Block *Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` } func (x *TripodBlockRequest) Reset() { @@ -250,13 +250,68 @@ func (x *TripodBlockRequest) GetTripodName() string { return "" } -func (x *TripodBlockRequest) GetBlock() *CompactBlock { +func (x *TripodBlockRequest) GetBlock() *Block { if x != nil { return x.Block } return nil } +type TripodBlockResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Block *Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` +} + +func (x *TripodBlockResponse) Reset() { + *x = TripodBlockResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_tripod_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TripodBlockResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TripodBlockResponse) ProtoMessage() {} + +func (x *TripodBlockResponse) ProtoReflect() protoreflect.Message { + mi := &file_tripod_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TripodBlockResponse.ProtoReflect.Descriptor instead. +func (*TripodBlockResponse) Descriptor() ([]byte, []int) { + return file_tripod_proto_rawDescGZIP(), []int{4} +} + +func (x *TripodBlockResponse) GetBlock() *Block { + if x != nil { + return x.Block + } + return nil +} + +func (x *TripodBlockResponse) GetError() string { + if x != nil { + return x.Error + } + return "" +} + var File_tripod_proto protoreflect.FileDescriptor var file_tripod_proto_rawDesc = []byte{ @@ -283,31 +338,38 @@ var file_tripod_proto_rawDesc = []byte{ 0x70, 0x6f, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x72, 0x69, 0x70, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x03, 0x74, 0x78, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x54, 0x78, 0x6e, 0x52, 0x03, 0x74, 0x78, 0x6e, 0x22, 0x5a, 0x0a, 0x12, 0x54, 0x72, 0x69, 0x70, + 0x54, 0x78, 0x6e, 0x52, 0x03, 0x74, 0x78, 0x6e, 0x22, 0x53, 0x0a, 0x12, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x72, 0x69, 0x70, 0x6f, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x72, 0x69, 0x70, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x23, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, - 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x32, 0xd4, 0x01, 0x0a, 0x06, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x64, 0x12, - 0x23, 0x0a, 0x08, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x78, 0x6e, 0x12, 0x11, 0x2e, 0x54, 0x72, - 0x69, 0x70, 0x6f, 0x64, 0x54, 0x78, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x04, - 0x2e, 0x45, 0x72, 0x72, 0x12, 0x29, 0x0a, 0x0b, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x12, 0x13, 0x2e, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x64, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x05, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x12, - 0x27, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x13, 0x2e, - 0x54, 0x72, 0x69, 0x70, 0x6f, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x04, 0x2e, 0x45, 0x72, 0x72, 0x12, 0x25, 0x0a, 0x08, 0x45, 0x6e, 0x64, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x13, 0x2e, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x64, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x04, 0x2e, 0x45, 0x72, 0x72, 0x12, - 0x2a, 0x0a, 0x0d, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x1c, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, + 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x49, 0x0a, + 0x13, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x32, 0x83, 0x02, 0x0a, 0x06, 0x54, 0x72, 0x69, + 0x70, 0x6f, 0x64, 0x12, 0x23, 0x0a, 0x08, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x78, 0x6e, 0x12, + 0x11, 0x2e, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x64, 0x54, 0x78, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x04, 0x2e, 0x45, 0x72, 0x72, 0x12, 0x28, 0x0a, 0x0b, 0x56, 0x65, 0x72, 0x69, + 0x66, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x13, 0x2e, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x64, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x04, 0x2e, 0x45, + 0x72, 0x72, 0x12, 0x37, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x13, 0x2e, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x04, 0x2e, 0x45, 0x72, 0x72, 0x32, 0x3a, 0x0a, 0x04, 0x4c, - 0x61, 0x6e, 0x64, 0x12, 0x32, 0x0a, 0x0a, 0x53, 0x65, 0x74, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x64, - 0x73, 0x12, 0x0c, 0x2e, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x64, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x1a, - 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x67, 0x6f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x64, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x45, + 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x13, 0x2e, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x64, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x54, + 0x72, 0x69, 0x70, 0x6f, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0d, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x12, 0x13, 0x2e, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x64, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x54, 0x72, 0x69, 0x70, 0x6f, + 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x3a, + 0x0a, 0x04, 0x4c, 0x61, 0x6e, 0x64, 0x12, 0x32, 0x0a, 0x0a, 0x53, 0x65, 0x74, 0x54, 0x72, 0x69, + 0x70, 0x6f, 0x64, 0x73, 0x12, 0x0c, 0x2e, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x64, 0x73, 0x49, 0x6e, + 0x66, 0x6f, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, + 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -322,39 +384,40 @@ func file_tripod_proto_rawDescGZIP() []byte { return file_tripod_proto_rawDescData } -var file_tripod_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_tripod_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_tripod_proto_goTypes = []interface{}{ - (*TripodsInfo)(nil), // 0: TripodsInfo - (*TripodInfo)(nil), // 1: TripodInfo - (*TripodTxnRequest)(nil), // 2: TripodTxnRequest - (*TripodBlockRequest)(nil), // 3: TripodBlockRequest - (*SignedTxn)(nil), // 4: SignedTxn - (*CompactBlock)(nil), // 5: CompactBlock - (*Err)(nil), // 6: Err - (*Bool)(nil), // 7: Bool - (*emptypb.Empty)(nil), // 8: google.protobuf.Empty + (*TripodsInfo)(nil), // 0: TripodsInfo + (*TripodInfo)(nil), // 1: TripodInfo + (*TripodTxnRequest)(nil), // 2: TripodTxnRequest + (*TripodBlockRequest)(nil), // 3: TripodBlockRequest + (*TripodBlockResponse)(nil), // 4: TripodBlockResponse + (*SignedTxn)(nil), // 5: SignedTxn + (*Block)(nil), // 6: Block + (*Err)(nil), // 7: Err + (*emptypb.Empty)(nil), // 8: google.protobuf.Empty } var file_tripod_proto_depIdxs = []int32{ - 1, // 0: TripodsInfo.tripods:type_name -> TripodInfo - 4, // 1: TripodTxnRequest.txn:type_name -> SignedTxn - 5, // 2: TripodBlockRequest.block:type_name -> CompactBlock - 2, // 3: Tripod.CheckTxn:input_type -> TripodTxnRequest - 3, // 4: Tripod.VerifyBlock:input_type -> TripodBlockRequest - 3, // 5: Tripod.StartBlock:input_type -> TripodBlockRequest - 3, // 6: Tripod.EndBlock:input_type -> TripodBlockRequest - 3, // 7: Tripod.FinalizeBlock:input_type -> TripodBlockRequest - 0, // 8: Land.SetTripods:input_type -> TripodsInfo - 6, // 9: Tripod.CheckTxn:output_type -> Err - 7, // 10: Tripod.VerifyBlock:output_type -> Bool - 6, // 11: Tripod.StartBlock:output_type -> Err - 6, // 12: Tripod.EndBlock:output_type -> Err - 6, // 13: Tripod.FinalizeBlock:output_type -> Err - 8, // 14: Land.SetTripods:output_type -> google.protobuf.Empty - 9, // [9:15] is the sub-list for method output_type - 3, // [3:9] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 1, // 0: TripodsInfo.tripods:type_name -> TripodInfo + 5, // 1: TripodTxnRequest.txn:type_name -> SignedTxn + 6, // 2: TripodBlockRequest.block:type_name -> Block + 6, // 3: TripodBlockResponse.block:type_name -> Block + 2, // 4: Tripod.CheckTxn:input_type -> TripodTxnRequest + 3, // 5: Tripod.VerifyBlock:input_type -> TripodBlockRequest + 3, // 6: Tripod.StartBlock:input_type -> TripodBlockRequest + 3, // 7: Tripod.EndBlock:input_type -> TripodBlockRequest + 3, // 8: Tripod.FinalizeBlock:input_type -> TripodBlockRequest + 0, // 9: Land.SetTripods:input_type -> TripodsInfo + 7, // 10: Tripod.CheckTxn:output_type -> Err + 7, // 11: Tripod.VerifyBlock:output_type -> Err + 4, // 12: Tripod.StartBlock:output_type -> TripodBlockResponse + 4, // 13: Tripod.EndBlock:output_type -> TripodBlockResponse + 4, // 14: Tripod.FinalizeBlock:output_type -> TripodBlockResponse + 8, // 15: Land.SetTripods:output_type -> google.protobuf.Empty + 10, // [10:16] is the sub-list for method output_type + 4, // [4:10] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_tripod_proto_init() } @@ -414,6 +477,18 @@ func file_tripod_proto_init() { return nil } } + file_tripod_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TripodBlockResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -421,7 +496,7 @@ func file_tripod_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_tripod_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 5, NumExtensions: 0, NumServices: 2, }, diff --git a/core/types/goproto/tripod_grpc.pb.go b/core/types/goproto/tripod_grpc.pb.go new file mode 100644 index 00000000..94c3b203 --- /dev/null +++ b/core/types/goproto/tripod_grpc.pb.go @@ -0,0 +1,372 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v4.25.2 +// source: tripod.proto + +package goproto + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Tripod_CheckTxn_FullMethodName = "/Tripod/CheckTxn" + Tripod_VerifyBlock_FullMethodName = "/Tripod/VerifyBlock" + Tripod_StartBlock_FullMethodName = "/Tripod/StartBlock" + Tripod_EndBlock_FullMethodName = "/Tripod/EndBlock" + Tripod_FinalizeBlock_FullMethodName = "/Tripod/FinalizeBlock" +) + +// TripodClient is the client API for Tripod 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. +type TripodClient interface { + CheckTxn(ctx context.Context, in *TripodTxnRequest, opts ...grpc.CallOption) (*Err, error) + VerifyBlock(ctx context.Context, in *TripodBlockRequest, opts ...grpc.CallOption) (*Err, error) + StartBlock(ctx context.Context, in *TripodBlockRequest, opts ...grpc.CallOption) (*TripodBlockResponse, error) + EndBlock(ctx context.Context, in *TripodBlockRequest, opts ...grpc.CallOption) (*TripodBlockResponse, error) + FinalizeBlock(ctx context.Context, in *TripodBlockRequest, opts ...grpc.CallOption) (*TripodBlockResponse, error) +} + +type tripodClient struct { + cc grpc.ClientConnInterface +} + +func NewTripodClient(cc grpc.ClientConnInterface) TripodClient { + return &tripodClient{cc} +} + +func (c *tripodClient) CheckTxn(ctx context.Context, in *TripodTxnRequest, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, Tripod_CheckTxn_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tripodClient) VerifyBlock(ctx context.Context, in *TripodBlockRequest, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, Tripod_VerifyBlock_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tripodClient) StartBlock(ctx context.Context, in *TripodBlockRequest, opts ...grpc.CallOption) (*TripodBlockResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TripodBlockResponse) + err := c.cc.Invoke(ctx, Tripod_StartBlock_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tripodClient) EndBlock(ctx context.Context, in *TripodBlockRequest, opts ...grpc.CallOption) (*TripodBlockResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TripodBlockResponse) + err := c.cc.Invoke(ctx, Tripod_EndBlock_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tripodClient) FinalizeBlock(ctx context.Context, in *TripodBlockRequest, opts ...grpc.CallOption) (*TripodBlockResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TripodBlockResponse) + err := c.cc.Invoke(ctx, Tripod_FinalizeBlock_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TripodServer is the server API for Tripod service. +// All implementations should embed UnimplementedTripodServer +// for forward compatibility. +type TripodServer interface { + CheckTxn(context.Context, *TripodTxnRequest) (*Err, error) + VerifyBlock(context.Context, *TripodBlockRequest) (*Err, error) + StartBlock(context.Context, *TripodBlockRequest) (*TripodBlockResponse, error) + EndBlock(context.Context, *TripodBlockRequest) (*TripodBlockResponse, error) + FinalizeBlock(context.Context, *TripodBlockRequest) (*TripodBlockResponse, error) +} + +// UnimplementedTripodServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedTripodServer struct{} + +func (UnimplementedTripodServer) CheckTxn(context.Context, *TripodTxnRequest) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckTxn not implemented") +} +func (UnimplementedTripodServer) VerifyBlock(context.Context, *TripodBlockRequest) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method VerifyBlock not implemented") +} +func (UnimplementedTripodServer) StartBlock(context.Context, *TripodBlockRequest) (*TripodBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StartBlock not implemented") +} +func (UnimplementedTripodServer) EndBlock(context.Context, *TripodBlockRequest) (*TripodBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EndBlock not implemented") +} +func (UnimplementedTripodServer) FinalizeBlock(context.Context, *TripodBlockRequest) (*TripodBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FinalizeBlock not implemented") +} +func (UnimplementedTripodServer) testEmbeddedByValue() {} + +// UnsafeTripodServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TripodServer will +// result in compilation errors. +type UnsafeTripodServer interface { + mustEmbedUnimplementedTripodServer() +} + +func RegisterTripodServer(s grpc.ServiceRegistrar, srv TripodServer) { + // If the following call pancis, it indicates UnimplementedTripodServer 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(&Tripod_ServiceDesc, srv) +} + +func _Tripod_CheckTxn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TripodTxnRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TripodServer).CheckTxn(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Tripod_CheckTxn_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TripodServer).CheckTxn(ctx, req.(*TripodTxnRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Tripod_VerifyBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TripodBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TripodServer).VerifyBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Tripod_VerifyBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TripodServer).VerifyBlock(ctx, req.(*TripodBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Tripod_StartBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TripodBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TripodServer).StartBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Tripod_StartBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TripodServer).StartBlock(ctx, req.(*TripodBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Tripod_EndBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TripodBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TripodServer).EndBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Tripod_EndBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TripodServer).EndBlock(ctx, req.(*TripodBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Tripod_FinalizeBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TripodBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TripodServer).FinalizeBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Tripod_FinalizeBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TripodServer).FinalizeBlock(ctx, req.(*TripodBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Tripod_ServiceDesc is the grpc.ServiceDesc for Tripod service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Tripod_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "Tripod", + HandlerType: (*TripodServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CheckTxn", + Handler: _Tripod_CheckTxn_Handler, + }, + { + MethodName: "VerifyBlock", + Handler: _Tripod_VerifyBlock_Handler, + }, + { + MethodName: "StartBlock", + Handler: _Tripod_StartBlock_Handler, + }, + { + MethodName: "EndBlock", + Handler: _Tripod_EndBlock_Handler, + }, + { + MethodName: "FinalizeBlock", + Handler: _Tripod_FinalizeBlock_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "tripod.proto", +} + +const ( + Land_SetTripods_FullMethodName = "/Land/SetTripods" +) + +// LandClient is the client API for Land 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. +type LandClient interface { + SetTripods(ctx context.Context, in *TripodsInfo, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type landClient struct { + cc grpc.ClientConnInterface +} + +func NewLandClient(cc grpc.ClientConnInterface) LandClient { + return &landClient{cc} +} + +func (c *landClient) SetTripods(ctx context.Context, in *TripodsInfo, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, Land_SetTripods_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// LandServer is the server API for Land service. +// All implementations should embed UnimplementedLandServer +// for forward compatibility. +type LandServer interface { + SetTripods(context.Context, *TripodsInfo) (*emptypb.Empty, error) +} + +// UnimplementedLandServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedLandServer struct{} + +func (UnimplementedLandServer) SetTripods(context.Context, *TripodsInfo) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetTripods not implemented") +} +func (UnimplementedLandServer) testEmbeddedByValue() {} + +// UnsafeLandServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LandServer will +// result in compilation errors. +type UnsafeLandServer interface { + mustEmbedUnimplementedLandServer() +} + +func RegisterLandServer(s grpc.ServiceRegistrar, srv LandServer) { + // If the following call pancis, it indicates UnimplementedLandServer 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(&Land_ServiceDesc, srv) +} + +func _Land_SetTripods_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TripodsInfo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LandServer).SetTripods(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Land_SetTripods_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LandServer).SetTripods(ctx, req.(*TripodsInfo)) + } + return interceptor(ctx, in, info, handler) +} + +// Land_ServiceDesc is the grpc.ServiceDesc for Land service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Land_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "Land", + HandlerType: (*LandServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SetTripods", + Handler: _Land_SetTripods_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "tripod.proto", +} diff --git a/core/types/goproto/txdb_grpc.pb.go b/core/types/goproto/txdb_grpc.pb.go new file mode 100644 index 00000000..bc11f335 --- /dev/null +++ b/core/types/goproto/txdb_grpc.pb.go @@ -0,0 +1,385 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v4.25.2 +// source: txdb.proto + +package goproto + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + TxDB_GetTxn_FullMethodName = "/TxDB/GetTxn" + TxDB_SetTxn_FullMethodName = "/TxDB/SetTxn" + TxDB_GetTxns_FullMethodName = "/TxDB/GetTxns" + TxDB_SetTxns_FullMethodName = "/TxDB/SetTxns" + TxDB_GetEvents_FullMethodName = "/TxDB/GetEvents" + TxDB_SetEvents_FullMethodName = "/TxDB/SetEvents" + TxDB_GetErrors_FullMethodName = "/TxDB/GetErrors" + TxDB_SetError_FullMethodName = "/TxDB/SetError" +) + +// TxDBClient is the client API for TxDB 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. +type TxDBClient interface { + GetTxn(ctx context.Context, in *TxnHash, opts ...grpc.CallOption) (*TxnResponse, error) + SetTxn(ctx context.Context, in *SignedTxn, opts ...grpc.CallOption) (*Err, error) + GetTxns(ctx context.Context, in *BlockHash, opts ...grpc.CallOption) (*TxnsResponse, error) + SetTxns(ctx context.Context, in *TxnsRequest, opts ...grpc.CallOption) (*Err, error) + GetEvents(ctx context.Context, in *BlockHash, opts ...grpc.CallOption) (*EventsResponse, error) + SetEvents(ctx context.Context, in *EventsRequest, opts ...grpc.CallOption) (*Err, error) + GetErrors(ctx context.Context, in *BlockHash, opts ...grpc.CallOption) (*ErrorsResponse, error) + SetError(ctx context.Context, in *Error, opts ...grpc.CallOption) (*Err, error) +} + +type txDBClient struct { + cc grpc.ClientConnInterface +} + +func NewTxDBClient(cc grpc.ClientConnInterface) TxDBClient { + return &txDBClient{cc} +} + +func (c *txDBClient) GetTxn(ctx context.Context, in *TxnHash, opts ...grpc.CallOption) (*TxnResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TxnResponse) + err := c.cc.Invoke(ctx, TxDB_GetTxn_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *txDBClient) SetTxn(ctx context.Context, in *SignedTxn, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, TxDB_SetTxn_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *txDBClient) GetTxns(ctx context.Context, in *BlockHash, opts ...grpc.CallOption) (*TxnsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TxnsResponse) + err := c.cc.Invoke(ctx, TxDB_GetTxns_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *txDBClient) SetTxns(ctx context.Context, in *TxnsRequest, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, TxDB_SetTxns_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *txDBClient) GetEvents(ctx context.Context, in *BlockHash, opts ...grpc.CallOption) (*EventsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(EventsResponse) + err := c.cc.Invoke(ctx, TxDB_GetEvents_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *txDBClient) SetEvents(ctx context.Context, in *EventsRequest, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, TxDB_SetEvents_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *txDBClient) GetErrors(ctx context.Context, in *BlockHash, opts ...grpc.CallOption) (*ErrorsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ErrorsResponse) + err := c.cc.Invoke(ctx, TxDB_GetErrors_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *txDBClient) SetError(ctx context.Context, in *Error, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, TxDB_SetError_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TxDBServer is the server API for TxDB service. +// All implementations should embed UnimplementedTxDBServer +// for forward compatibility. +type TxDBServer interface { + GetTxn(context.Context, *TxnHash) (*TxnResponse, error) + SetTxn(context.Context, *SignedTxn) (*Err, error) + GetTxns(context.Context, *BlockHash) (*TxnsResponse, error) + SetTxns(context.Context, *TxnsRequest) (*Err, error) + GetEvents(context.Context, *BlockHash) (*EventsResponse, error) + SetEvents(context.Context, *EventsRequest) (*Err, error) + GetErrors(context.Context, *BlockHash) (*ErrorsResponse, error) + SetError(context.Context, *Error) (*Err, error) +} + +// UnimplementedTxDBServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedTxDBServer struct{} + +func (UnimplementedTxDBServer) GetTxn(context.Context, *TxnHash) (*TxnResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTxn not implemented") +} +func (UnimplementedTxDBServer) SetTxn(context.Context, *SignedTxn) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetTxn not implemented") +} +func (UnimplementedTxDBServer) GetTxns(context.Context, *BlockHash) (*TxnsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTxns not implemented") +} +func (UnimplementedTxDBServer) SetTxns(context.Context, *TxnsRequest) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetTxns not implemented") +} +func (UnimplementedTxDBServer) GetEvents(context.Context, *BlockHash) (*EventsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEvents not implemented") +} +func (UnimplementedTxDBServer) SetEvents(context.Context, *EventsRequest) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetEvents not implemented") +} +func (UnimplementedTxDBServer) GetErrors(context.Context, *BlockHash) (*ErrorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetErrors not implemented") +} +func (UnimplementedTxDBServer) SetError(context.Context, *Error) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetError not implemented") +} +func (UnimplementedTxDBServer) testEmbeddedByValue() {} + +// UnsafeTxDBServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TxDBServer will +// result in compilation errors. +type UnsafeTxDBServer interface { + mustEmbedUnimplementedTxDBServer() +} + +func RegisterTxDBServer(s grpc.ServiceRegistrar, srv TxDBServer) { + // If the following call pancis, it indicates UnimplementedTxDBServer 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(&TxDB_ServiceDesc, srv) +} + +func _TxDB_GetTxn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TxnHash) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxDBServer).GetTxn(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TxDB_GetTxn_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxDBServer).GetTxn(ctx, req.(*TxnHash)) + } + return interceptor(ctx, in, info, handler) +} + +func _TxDB_SetTxn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignedTxn) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxDBServer).SetTxn(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TxDB_SetTxn_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxDBServer).SetTxn(ctx, req.(*SignedTxn)) + } + return interceptor(ctx, in, info, handler) +} + +func _TxDB_GetTxns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockHash) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxDBServer).GetTxns(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TxDB_GetTxns_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxDBServer).GetTxns(ctx, req.(*BlockHash)) + } + return interceptor(ctx, in, info, handler) +} + +func _TxDB_SetTxns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TxnsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxDBServer).SetTxns(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TxDB_SetTxns_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxDBServer).SetTxns(ctx, req.(*TxnsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TxDB_GetEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockHash) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxDBServer).GetEvents(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TxDB_GetEvents_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxDBServer).GetEvents(ctx, req.(*BlockHash)) + } + return interceptor(ctx, in, info, handler) +} + +func _TxDB_SetEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EventsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxDBServer).SetEvents(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TxDB_SetEvents_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxDBServer).SetEvents(ctx, req.(*EventsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TxDB_GetErrors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockHash) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxDBServer).GetErrors(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TxDB_GetErrors_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxDBServer).GetErrors(ctx, req.(*BlockHash)) + } + return interceptor(ctx, in, info, handler) +} + +func _TxDB_SetError_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Error) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxDBServer).SetError(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TxDB_SetError_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxDBServer).SetError(ctx, req.(*Error)) + } + return interceptor(ctx, in, info, handler) +} + +// TxDB_ServiceDesc is the grpc.ServiceDesc for TxDB service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var TxDB_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "TxDB", + HandlerType: (*TxDBServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetTxn", + Handler: _TxDB_GetTxn_Handler, + }, + { + MethodName: "SetTxn", + Handler: _TxDB_SetTxn_Handler, + }, + { + MethodName: "GetTxns", + Handler: _TxDB_GetTxns_Handler, + }, + { + MethodName: "SetTxns", + Handler: _TxDB_SetTxns_Handler, + }, + { + MethodName: "GetEvents", + Handler: _TxDB_GetEvents_Handler, + }, + { + MethodName: "SetEvents", + Handler: _TxDB_SetEvents_Handler, + }, + { + MethodName: "GetErrors", + Handler: _TxDB_GetErrors_Handler, + }, + { + MethodName: "SetError", + Handler: _TxDB_SetError_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "txdb.proto", +} diff --git a/core/types/goproto/txpool_grpc.pb.go b/core/types/goproto/txpool_grpc.pb.go new file mode 100644 index 00000000..e1b0c90b --- /dev/null +++ b/core/types/goproto/txpool_grpc.pb.go @@ -0,0 +1,424 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v4.25.2 +// source: txpool.proto + +package goproto + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Txpool_PoolSize_FullMethodName = "/Txpool/PoolSize" + Txpool_BaseCheck_FullMethodName = "/Txpool/BaseCheck" + Txpool_TripodsCheck_FullMethodName = "/Txpool/TripodsCheck" + Txpool_NecessaryCheck_FullMethodName = "/Txpool/NecessaryCheck" + Txpool_Insert_FullMethodName = "/Txpool/Insert" + Txpool_BatchInsert_FullMethodName = "/Txpool/BatchInsert" + Txpool_RemovesTxns_FullMethodName = "/Txpool/RemovesTxns" + Txpool_Pack_FullMethodName = "/Txpool/Pack" + Txpool_Reset_FullMethodName = "/Txpool/Reset" +) + +// TxpoolClient is the client API for Txpool 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. +type TxpoolClient interface { + PoolSize(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*U64, error) + BaseCheck(ctx context.Context, in *SignedTxn, opts ...grpc.CallOption) (*Err, error) + TripodsCheck(ctx context.Context, in *SignedTxn, opts ...grpc.CallOption) (*Err, error) + NecessaryCheck(ctx context.Context, in *SignedTxn, opts ...grpc.CallOption) (*Err, error) + Insert(ctx context.Context, in *SignedTxn, opts ...grpc.CallOption) (*Err, error) + BatchInsert(ctx context.Context, in *BatchSignedTxns, opts ...grpc.CallOption) (*Err, error) + RemovesTxns(ctx context.Context, in *TxnsHashes, opts ...grpc.CallOption) (*Err, error) + Pack(ctx context.Context, in *U64, opts ...grpc.CallOption) (*TxnsResponse, error) + Reset(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Err, error) +} + +type txpoolClient struct { + cc grpc.ClientConnInterface +} + +func NewTxpoolClient(cc grpc.ClientConnInterface) TxpoolClient { + return &txpoolClient{cc} +} + +func (c *txpoolClient) PoolSize(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*U64, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(U64) + err := c.cc.Invoke(ctx, Txpool_PoolSize_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *txpoolClient) BaseCheck(ctx context.Context, in *SignedTxn, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, Txpool_BaseCheck_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *txpoolClient) TripodsCheck(ctx context.Context, in *SignedTxn, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, Txpool_TripodsCheck_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *txpoolClient) NecessaryCheck(ctx context.Context, in *SignedTxn, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, Txpool_NecessaryCheck_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *txpoolClient) Insert(ctx context.Context, in *SignedTxn, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, Txpool_Insert_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *txpoolClient) BatchInsert(ctx context.Context, in *BatchSignedTxns, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, Txpool_BatchInsert_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *txpoolClient) RemovesTxns(ctx context.Context, in *TxnsHashes, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, Txpool_RemovesTxns_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *txpoolClient) Pack(ctx context.Context, in *U64, opts ...grpc.CallOption) (*TxnsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TxnsResponse) + err := c.cc.Invoke(ctx, Txpool_Pack_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *txpoolClient) Reset(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Err, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Err) + err := c.cc.Invoke(ctx, Txpool_Reset_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TxpoolServer is the server API for Txpool service. +// All implementations should embed UnimplementedTxpoolServer +// for forward compatibility. +type TxpoolServer interface { + PoolSize(context.Context, *emptypb.Empty) (*U64, error) + BaseCheck(context.Context, *SignedTxn) (*Err, error) + TripodsCheck(context.Context, *SignedTxn) (*Err, error) + NecessaryCheck(context.Context, *SignedTxn) (*Err, error) + Insert(context.Context, *SignedTxn) (*Err, error) + BatchInsert(context.Context, *BatchSignedTxns) (*Err, error) + RemovesTxns(context.Context, *TxnsHashes) (*Err, error) + Pack(context.Context, *U64) (*TxnsResponse, error) + Reset(context.Context, *emptypb.Empty) (*Err, error) +} + +// UnimplementedTxpoolServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedTxpoolServer struct{} + +func (UnimplementedTxpoolServer) PoolSize(context.Context, *emptypb.Empty) (*U64, error) { + return nil, status.Errorf(codes.Unimplemented, "method PoolSize not implemented") +} +func (UnimplementedTxpoolServer) BaseCheck(context.Context, *SignedTxn) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method BaseCheck not implemented") +} +func (UnimplementedTxpoolServer) TripodsCheck(context.Context, *SignedTxn) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method TripodsCheck not implemented") +} +func (UnimplementedTxpoolServer) NecessaryCheck(context.Context, *SignedTxn) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method NecessaryCheck not implemented") +} +func (UnimplementedTxpoolServer) Insert(context.Context, *SignedTxn) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method Insert not implemented") +} +func (UnimplementedTxpoolServer) BatchInsert(context.Context, *BatchSignedTxns) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method BatchInsert not implemented") +} +func (UnimplementedTxpoolServer) RemovesTxns(context.Context, *TxnsHashes) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemovesTxns not implemented") +} +func (UnimplementedTxpoolServer) Pack(context.Context, *U64) (*TxnsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Pack not implemented") +} +func (UnimplementedTxpoolServer) Reset(context.Context, *emptypb.Empty) (*Err, error) { + return nil, status.Errorf(codes.Unimplemented, "method Reset not implemented") +} +func (UnimplementedTxpoolServer) testEmbeddedByValue() {} + +// UnsafeTxpoolServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TxpoolServer will +// result in compilation errors. +type UnsafeTxpoolServer interface { + mustEmbedUnimplementedTxpoolServer() +} + +func RegisterTxpoolServer(s grpc.ServiceRegistrar, srv TxpoolServer) { + // If the following call pancis, it indicates UnimplementedTxpoolServer 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(&Txpool_ServiceDesc, srv) +} + +func _Txpool_PoolSize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxpoolServer).PoolSize(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Txpool_PoolSize_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxpoolServer).PoolSize(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Txpool_BaseCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignedTxn) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxpoolServer).BaseCheck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Txpool_BaseCheck_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxpoolServer).BaseCheck(ctx, req.(*SignedTxn)) + } + return interceptor(ctx, in, info, handler) +} + +func _Txpool_TripodsCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignedTxn) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxpoolServer).TripodsCheck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Txpool_TripodsCheck_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxpoolServer).TripodsCheck(ctx, req.(*SignedTxn)) + } + return interceptor(ctx, in, info, handler) +} + +func _Txpool_NecessaryCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignedTxn) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxpoolServer).NecessaryCheck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Txpool_NecessaryCheck_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxpoolServer).NecessaryCheck(ctx, req.(*SignedTxn)) + } + return interceptor(ctx, in, info, handler) +} + +func _Txpool_Insert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignedTxn) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxpoolServer).Insert(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Txpool_Insert_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxpoolServer).Insert(ctx, req.(*SignedTxn)) + } + return interceptor(ctx, in, info, handler) +} + +func _Txpool_BatchInsert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BatchSignedTxns) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxpoolServer).BatchInsert(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Txpool_BatchInsert_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxpoolServer).BatchInsert(ctx, req.(*BatchSignedTxns)) + } + return interceptor(ctx, in, info, handler) +} + +func _Txpool_RemovesTxns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TxnsHashes) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxpoolServer).RemovesTxns(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Txpool_RemovesTxns_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxpoolServer).RemovesTxns(ctx, req.(*TxnsHashes)) + } + return interceptor(ctx, in, info, handler) +} + +func _Txpool_Pack_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(U64) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxpoolServer).Pack(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Txpool_Pack_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxpoolServer).Pack(ctx, req.(*U64)) + } + return interceptor(ctx, in, info, handler) +} + +func _Txpool_Reset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxpoolServer).Reset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Txpool_Reset_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxpoolServer).Reset(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +// Txpool_ServiceDesc is the grpc.ServiceDesc for Txpool service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Txpool_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "Txpool", + HandlerType: (*TxpoolServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "PoolSize", + Handler: _Txpool_PoolSize_Handler, + }, + { + MethodName: "BaseCheck", + Handler: _Txpool_BaseCheck_Handler, + }, + { + MethodName: "TripodsCheck", + Handler: _Txpool_TripodsCheck_Handler, + }, + { + MethodName: "NecessaryCheck", + Handler: _Txpool_NecessaryCheck_Handler, + }, + { + MethodName: "Insert", + Handler: _Txpool_Insert_Handler, + }, + { + MethodName: "BatchInsert", + Handler: _Txpool_BatchInsert_Handler, + }, + { + MethodName: "RemovesTxns", + Handler: _Txpool_RemovesTxns_Handler, + }, + { + MethodName: "Pack", + Handler: _Txpool_Pack_Handler, + }, + { + MethodName: "Reset", + Handler: _Txpool_Reset_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "txpool.proto", +} diff --git a/go.mod b/go.mod index 5777d41e..a96d48af 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 github.com/ethereum/go-ethereum v1.10.8 github.com/gin-gonic/gin v1.9.1 - github.com/golang/protobuf v1.5.3 + github.com/golang/protobuf v1.5.4 github.com/gorilla/websocket v1.5.3 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/libp2p/go-libp2p v0.35.4 @@ -25,6 +25,7 @@ require ( go.etcd.io/bbolt v1.3.6 go.uber.org/atomic v1.11.0 golang.org/x/crypto v0.25.0 + google.golang.org/grpc v1.64.0 google.golang.org/protobuf v1.34.2 gorm.io/driver/mysql v1.0.5 gorm.io/driver/postgres v1.0.8 @@ -70,7 +71,7 @@ require ( github.com/golang/snappy v0.0.4 // indirect github.com/google/gopacket v1.1.19 // indirect github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 // indirect - github.com/google/uuid v1.4.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect github.com/huin/goupnp v1.3.0 // indirect @@ -172,6 +173,7 @@ require ( golang.org/x/text v0.16.0 // indirect golang.org/x/tools v0.23.0 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + google.golang.org/genproto v0.0.0-20230227214838-9b19f0bdc514 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/blake3 v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index cfa88ce2..c2d5c3d9 100644 --- a/go.sum +++ b/go.sum @@ -276,9 +276,8 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -295,7 +294,6 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= @@ -313,8 +311,8 @@ github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5/go.mod h1:czg5+yv1E0Z github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -1169,6 +1167,8 @@ google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20230227214838-9b19f0bdc514 h1:rtNKfB++wz5mtDY2t5C8TXlU5y52ojSu7tZo0z7u8eQ= +google.golang.org/genproto v0.0.0-20230227214838-9b19f0bdc514/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -1177,14 +1177,14 @@ google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiq google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=