Commit 06762028 authored by Ubuntu's avatar Ubuntu

add requet txs

parent 91a1a7d0
......@@ -34,6 +34,7 @@ message BatchRecoverRequest {
CryptType crypt_type = 3;
}
message BatchRecoverResponse {
repeated bytes pubkey = 1;
}
......
......@@ -6,6 +6,8 @@ import "google/protobuf/empty.proto";
import "ethrpc/v1/request_response.proto";
import "ethrpc/v1/account_req_res.proto";
import "base/v1/resource.proto";
service NebulaService {
// web3
......@@ -61,7 +63,7 @@ service NebulaService {
rpc GetCode(GetCodeRequest) returns (GetCodeResponse) {};
rpc Sign(SignRequest) returns (SignResponse) {};
rpc SignTransaction(SignTransactionRequest) returns (SignTransactionResponse) {};
rpc SendTransaction(SendTransactionRequest) returns (SendTransactionResponse) {};
rpc SendTransaction(base.v1.EthTransaction) returns (SendTransactionResponse) {};
rpc SendRawTransaction(SendRawTransactionRequest) returns (SendRawTransactionResponse) {};
rpc Call(CallRequest) returns (CallResponse) {};
......
This diff is collapsed.
......@@ -8,6 +8,7 @@ package ethrpcv1
import (
context "context"
v1 "github.com/CaduceusMetaverseProtocol/metaprotocol/gen/proto/go/base/v1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
......@@ -68,7 +69,7 @@ type NebulaServiceClient interface {
GetCode(ctx context.Context, in *GetCodeRequest, opts ...grpc.CallOption) (*GetCodeResponse, error)
Sign(ctx context.Context, in *SignRequest, opts ...grpc.CallOption) (*SignResponse, error)
SignTransaction(ctx context.Context, in *SignTransactionRequest, opts ...grpc.CallOption) (*SignTransactionResponse, error)
SendTransaction(ctx context.Context, in *SendTransactionRequest, opts ...grpc.CallOption) (*SendTransactionResponse, error)
SendTransaction(ctx context.Context, in *v1.EthTransaction, opts ...grpc.CallOption) (*SendTransactionResponse, error)
SendRawTransaction(ctx context.Context, in *SendRawTransactionRequest, opts ...grpc.CallOption) (*SendRawTransactionResponse, error)
Call(ctx context.Context, in *CallRequest, opts ...grpc.CallOption) (*CallResponse, error)
// filter
......@@ -422,7 +423,7 @@ func (c *nebulaServiceClient) SignTransaction(ctx context.Context, in *SignTrans
return out, nil
}
func (c *nebulaServiceClient) SendTransaction(ctx context.Context, in *SendTransactionRequest, opts ...grpc.CallOption) (*SendTransactionResponse, error) {
func (c *nebulaServiceClient) SendTransaction(ctx context.Context, in *v1.EthTransaction, opts ...grpc.CallOption) (*SendTransactionResponse, error) {
out := new(SendTransactionResponse)
err := c.cc.Invoke(ctx, "/ethrpc.v1.NebulaService/SendTransaction", in, out, opts...)
if err != nil {
......@@ -561,7 +562,7 @@ type NebulaServiceServer interface {
GetCode(context.Context, *GetCodeRequest) (*GetCodeResponse, error)
Sign(context.Context, *SignRequest) (*SignResponse, error)
SignTransaction(context.Context, *SignTransactionRequest) (*SignTransactionResponse, error)
SendTransaction(context.Context, *SendTransactionRequest) (*SendTransactionResponse, error)
SendTransaction(context.Context, *v1.EthTransaction) (*SendTransactionResponse, error)
SendRawTransaction(context.Context, *SendRawTransactionRequest) (*SendRawTransactionResponse, error)
Call(context.Context, *CallRequest) (*CallResponse, error)
// filter
......@@ -690,7 +691,7 @@ func (UnimplementedNebulaServiceServer) Sign(context.Context, *SignRequest) (*Si
func (UnimplementedNebulaServiceServer) SignTransaction(context.Context, *SignTransactionRequest) (*SignTransactionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SignTransaction not implemented")
}
func (UnimplementedNebulaServiceServer) SendTransaction(context.Context, *SendTransactionRequest) (*SendTransactionResponse, error) {
func (UnimplementedNebulaServiceServer) SendTransaction(context.Context, *v1.EthTransaction) (*SendTransactionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendTransaction not implemented")
}
func (UnimplementedNebulaServiceServer) SendRawTransaction(context.Context, *SendRawTransactionRequest) (*SendRawTransactionResponse, error) {
......@@ -1400,7 +1401,7 @@ func _NebulaService_SignTransaction_Handler(srv interface{}, ctx context.Context
}
func _NebulaService_SendTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SendTransactionRequest)
in := new(v1.EthTransaction)
if err := dec(in); err != nil {
return nil, err
}
......@@ -1412,7 +1413,7 @@ func _NebulaService_SendTransaction_Handler(srv interface{}, ctx context.Context
FullMethod: "/ethrpc.v1.NebulaService/SendTransaction",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NebulaServiceServer).SendTransaction(ctx, req.(*SendTransactionRequest))
return srv.(NebulaServiceServer).SendTransaction(ctx, req.(*v1.EthTransaction))
}
return interceptor(ctx, in, info, handler)
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -24,6 +24,8 @@ const _ = grpc.SupportPackageIsVersion7
// 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 P2PServiceClient interface {
BroadcastMsg(ctx context.Context, in *BroadCastRequest, opts ...grpc.CallOption) (*BroadCastResponse, error)
BroadcastTxsMsg(ctx context.Context, in *BroadCastTxsRequest, opts ...grpc.CallOption) (*BroadCastTxsResponse, error)
BatchTxsmsg(ctx context.Context, in *BatchTxsHashRequest, opts ...grpc.CallOption) (*BatchTxsHashResponse, error)
SendMsg(ctx context.Context, in *SendDataRequest, opts ...grpc.CallOption) (*SendDataResponse, error)
SubscribeMsg(ctx context.Context, in *SubscribeMsgRequest, opts ...grpc.CallOption) (*SubscribeMsgResponse, error)
// network info service
......@@ -48,6 +50,24 @@ func (c *p2PServiceClient) BroadcastMsg(ctx context.Context, in *BroadCastReques
return out, nil
}
func (c *p2PServiceClient) BroadcastTxsMsg(ctx context.Context, in *BroadCastTxsRequest, opts ...grpc.CallOption) (*BroadCastTxsResponse, error) {
out := new(BroadCastTxsResponse)
err := c.cc.Invoke(ctx, "/p2p.v1.P2PService/BroadcastTxsMsg", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *p2PServiceClient) BatchTxsmsg(ctx context.Context, in *BatchTxsHashRequest, opts ...grpc.CallOption) (*BatchTxsHashResponse, error) {
out := new(BatchTxsHashResponse)
err := c.cc.Invoke(ctx, "/p2p.v1.P2PService/BatchTxsmsg", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *p2PServiceClient) SendMsg(ctx context.Context, in *SendDataRequest, opts ...grpc.CallOption) (*SendDataResponse, error) {
out := new(SendDataResponse)
err := c.cc.Invoke(ctx, "/p2p.v1.P2PService/SendMsg", in, out, opts...)
......@@ -89,6 +109,8 @@ func (c *p2PServiceClient) NetVersion(ctx context.Context, in *emptypb.Empty, op
// for forward compatibility
type P2PServiceServer interface {
BroadcastMsg(context.Context, *BroadCastRequest) (*BroadCastResponse, error)
BroadcastTxsMsg(context.Context, *BroadCastTxsRequest) (*BroadCastTxsResponse, error)
BatchTxsmsg(context.Context, *BatchTxsHashRequest) (*BatchTxsHashResponse, error)
SendMsg(context.Context, *SendDataRequest) (*SendDataResponse, error)
SubscribeMsg(context.Context, *SubscribeMsgRequest) (*SubscribeMsgResponse, error)
// network info service
......@@ -104,6 +126,12 @@ type UnimplementedP2PServiceServer struct {
func (UnimplementedP2PServiceServer) BroadcastMsg(context.Context, *BroadCastRequest) (*BroadCastResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BroadcastMsg not implemented")
}
func (UnimplementedP2PServiceServer) BroadcastTxsMsg(context.Context, *BroadCastTxsRequest) (*BroadCastTxsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BroadcastTxsMsg not implemented")
}
func (UnimplementedP2PServiceServer) BatchTxsmsg(context.Context, *BatchTxsHashRequest) (*BatchTxsHashResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BatchTxsmsg not implemented")
}
func (UnimplementedP2PServiceServer) SendMsg(context.Context, *SendDataRequest) (*SendDataResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendMsg not implemented")
}
......@@ -147,6 +175,42 @@ func _P2PService_BroadcastMsg_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler)
}
func _P2PService_BroadcastTxsMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BroadCastTxsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(P2PServiceServer).BroadcastTxsMsg(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/p2p.v1.P2PService/BroadcastTxsMsg",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(P2PServiceServer).BroadcastTxsMsg(ctx, req.(*BroadCastTxsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _P2PService_BatchTxsmsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BatchTxsHashRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(P2PServiceServer).BatchTxsmsg(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/p2p.v1.P2PService/BatchTxsmsg",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(P2PServiceServer).BatchTxsmsg(ctx, req.(*BatchTxsHashRequest))
}
return interceptor(ctx, in, info, handler)
}
func _P2PService_SendMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SendDataRequest)
if err := dec(in); err != nil {
......@@ -230,6 +294,14 @@ var P2PService_ServiceDesc = grpc.ServiceDesc{
MethodName: "BroadcastMsg",
Handler: _P2PService_BroadcastMsg_Handler,
},
{
MethodName: "BroadcastTxsMsg",
Handler: _P2PService_BroadcastTxsMsg_Handler,
},
{
MethodName: "BatchTxsmsg",
Handler: _P2PService_BatchTxsmsg_Handler,
},
{
MethodName: "SendMsg",
Handler: _P2PService_SendMsg_Handler,
......
......@@ -7,7 +7,7 @@
package ringv1
import (
_ "github.com/CaduceusMetaverseProtocol/metaprotocol/gen/proto/go/base/v1"
v1 "github.com/CaduceusMetaverseProtocol/metaprotocol/gen/proto/go/base/v1"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "google.golang.org/protobuf/types/known/emptypb"
......@@ -33,39 +33,38 @@ var file_ring_v1_service_proto_rawDesc = []byte{
0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x72,
0x65, 0x71, 0x5f, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x62, 0x61,
0x73, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x32, 0xa8, 0x01, 0x0a, 0x0b, 0x52, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x12, 0x5f, 0x0a, 0x12, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x61, 0x77, 0x54,
0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x72, 0x69, 0x6e,
0x67, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e,
0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23,
0x2e, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x61, 0x77,
0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x15,
0x2e, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e,
0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42,
0xa7, 0x01, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x42,
0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a,
0x4d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x61, 0x64, 0x75,
0x63, 0x65, 0x75, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f,
0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,
0x6f, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f,
0x72, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02,
0x03, 0x52, 0x58, 0x58, 0xaa, 0x02, 0x07, 0x52, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca, 0x02,
0x07, 0x52, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x13, 0x52, 0x69, 0x6e, 0x67, 0x5c,
0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02,
0x08, 0x52, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x72, 0x6f, 0x74, 0x6f, 0x32, 0x9d, 0x01, 0x0a, 0x0b, 0x52, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x12, 0x54, 0x0a, 0x12, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x61, 0x77, 0x54,
0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x62, 0x61, 0x73,
0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x1a, 0x23, 0x2e, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65,
0x6e, 0x64, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x4e, 0x6f,
0x6e, 0x63, 0x65, 0x12, 0x15, 0x2e, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f,
0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x69, 0x6e,
0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x22, 0x00, 0x42, 0xa7, 0x01, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x69, 0x6e,
0x67, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f,
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x43, 0x61, 0x64, 0x75, 0x63, 0x65, 0x75, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x76, 0x65, 0x72,
0x73, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x69, 0x6e,
0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x58, 0x58, 0xaa, 0x02, 0x07, 0x52, 0x69, 0x6e, 0x67,
0x2e, 0x56, 0x31, 0xca, 0x02, 0x07, 0x52, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x13,
0x52, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64,
0x61, 0x74, 0x61, 0xea, 0x02, 0x08, 0x52, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var file_ring_v1_service_proto_goTypes = []interface{}{
(*SendRawTransactionRequest)(nil), // 0: ring.v1.SendRawTransactionRequest
(*v1.EthTransaction)(nil), // 0: base.v1.EthTransaction
(*NonceRequest)(nil), // 1: ring.v1.NonceRequest
(*SendRawTransactionResponse)(nil), // 2: ring.v1.SendRawTransactionResponse
(*NonceResponse)(nil), // 3: ring.v1.NonceResponse
}
var file_ring_v1_service_proto_depIdxs = []int32{
0, // 0: ring.v1.RingService.SendRawTransaction:input_type -> ring.v1.SendRawTransactionRequest
0, // 0: ring.v1.RingService.SendRawTransaction:input_type -> base.v1.EthTransaction
1, // 1: ring.v1.RingService.Nonce:input_type -> ring.v1.NonceRequest
2, // 2: ring.v1.RingService.SendRawTransaction:output_type -> ring.v1.SendRawTransactionResponse
3, // 3: ring.v1.RingService.Nonce:output_type -> ring.v1.NonceResponse
......
......@@ -8,6 +8,7 @@ package ringv1
import (
context "context"
v1 "github.com/CaduceusMetaverseProtocol/metaprotocol/gen/proto/go/base/v1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
......@@ -23,7 +24,7 @@ const _ = grpc.SupportPackageIsVersion7
// 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 RingServiceClient interface {
// account info service
SendRawTransaction(ctx context.Context, in *SendRawTransactionRequest, opts ...grpc.CallOption) (*SendRawTransactionResponse, error)
SendRawTransaction(ctx context.Context, in *v1.EthTransaction, opts ...grpc.CallOption) (*SendRawTransactionResponse, error)
Nonce(ctx context.Context, in *NonceRequest, opts ...grpc.CallOption) (*NonceResponse, error)
}
......@@ -35,7 +36,7 @@ func NewRingServiceClient(cc grpc.ClientConnInterface) RingServiceClient {
return &ringServiceClient{cc}
}
func (c *ringServiceClient) SendRawTransaction(ctx context.Context, in *SendRawTransactionRequest, opts ...grpc.CallOption) (*SendRawTransactionResponse, error) {
func (c *ringServiceClient) SendRawTransaction(ctx context.Context, in *v1.EthTransaction, opts ...grpc.CallOption) (*SendRawTransactionResponse, error) {
out := new(SendRawTransactionResponse)
err := c.cc.Invoke(ctx, "/ring.v1.RingService/SendRawTransaction", in, out, opts...)
if err != nil {
......@@ -58,7 +59,7 @@ func (c *ringServiceClient) Nonce(ctx context.Context, in *NonceRequest, opts ..
// for forward compatibility
type RingServiceServer interface {
// account info service
SendRawTransaction(context.Context, *SendRawTransactionRequest) (*SendRawTransactionResponse, error)
SendRawTransaction(context.Context, *v1.EthTransaction) (*SendRawTransactionResponse, error)
Nonce(context.Context, *NonceRequest) (*NonceResponse, error)
mustEmbedUnimplementedRingServiceServer()
}
......@@ -67,7 +68,7 @@ type RingServiceServer interface {
type UnimplementedRingServiceServer struct {
}
func (UnimplementedRingServiceServer) SendRawTransaction(context.Context, *SendRawTransactionRequest) (*SendRawTransactionResponse, error) {
func (UnimplementedRingServiceServer) SendRawTransaction(context.Context, *v1.EthTransaction) (*SendRawTransactionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendRawTransaction not implemented")
}
func (UnimplementedRingServiceServer) Nonce(context.Context, *NonceRequest) (*NonceResponse, error) {
......@@ -87,7 +88,7 @@ func RegisterRingServiceServer(s grpc.ServiceRegistrar, srv RingServiceServer) {
}
func _RingService_SendRawTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SendRawTransactionRequest)
in := new(v1.EthTransaction)
if err := dec(in); err != nil {
return nil, err
}
......@@ -99,7 +100,7 @@ func _RingService_SendRawTransaction_Handler(srv interface{}, ctx context.Contex
FullMethod: "/ring.v1.RingService/SendRawTransaction",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RingServiceServer).SendRawTransaction(ctx, req.(*SendRawTransactionRequest))
return srv.(RingServiceServer).SendRawTransaction(ctx, req.(*v1.EthTransaction))
}
return interceptor(ctx, in, info, handler)
}
......
......@@ -123,7 +123,7 @@ type CommitBatchTxRequest struct {
unknownFields protoimpl.UnknownFields
Txdata []byte `protobuf:"bytes,1,opt,name=txdata,proto3" json:"txdata,omitempty"`
Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` //为了合约计算提交了多少个交易;
}
func (x *CommitBatchTxRequest) Reset() {
......
......@@ -4,6 +4,7 @@ package p2p.v1;
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "p2p/v1/resource.proto";
import "base/v1/resource.proto";
message BroadCastRequest {
MessageHeader header = 1;
......@@ -11,9 +12,31 @@ message BroadCastRequest {
}
message BroadCastResponse {
bool success = 1;
bool status = 1;
}
message BroadCastTxsRequest {
repeated base.v1.CheckTx txs = 1;
}
message BroadCastTxsResponse {
repeated bool status = 1;
}
message BatchTxsHashRequest{
bytes hash = 1;
}
message BatchTxsHashResponse {
bytes hash = 1;
repeated base.v1.CheckTx txs = 2;
}
message SendDataRequest {
MessageHeader header = 1;
bytes data = 2;
......
......@@ -4,9 +4,14 @@ package p2p.v1;
import "p2p/v1/request_response.proto";
import "google/protobuf/empty.proto";
service P2PService {
rpc BroadcastMsg(BroadCastRequest) returns (BroadCastResponse) {}
rpc BroadcastTxsMsg(BroadCastTxsRequest) returns (BroadCastTxsResponse) {}
rpc BatchTxsmsg(BatchTxsHashRequest)returns (BatchTxsHashResponse){}
rpc SendMsg(SendDataRequest) returns (SendDataResponse) {}
rpc SubscribeMsg(SubscribeMsgRequest) returns (SubscribeMsgResponse) {}
......
......@@ -10,7 +10,7 @@ import "base/v1/resource.proto";
service RingService{
// account info service
rpc SendRawTransaction(SendRawTransactionRequest) returns (SendRawTransactionResponse) {};
rpc SendRawTransaction(base.v1.EthTransaction) returns (SendRawTransactionResponse) {};
rpc Nonce(NonceRequest) returns (NonceResponse) {};
}
\ No newline at end of file
......@@ -20,7 +20,7 @@ message LimitInfoResponse {
message CommitBatchTxRequest {
bytes txdata = 1;
int64 size =2;
int64 size =2; //为了合约计算提交了多少个交易;
}
message CommitBatchTxResponse {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment