Documentation ¶
Index ¶
- Variables
- func RegisterBlockchainServer(s grpc.ServiceRegistrar, srv BlockchainServer)
- func RegisterNodeServer(s grpc.ServiceRegistrar, srv NodeServer)
- func RegisterTransactionServiceServer(s grpc.ServiceRegistrar, srv TransactionServiceServer)
- type Block
- type BlockHeader
- func (*BlockHeader) Descriptor() ([]byte, []int)deprecated
- func (x *BlockHeader) GetBlockHash() string
- func (x *BlockHeader) GetGasLimit() uint64
- func (x *BlockHeader) GetHeight() uint64
- func (x *BlockHeader) GetMerkleRoot() string
- func (x *BlockHeader) GetParams() string
- func (x *BlockHeader) GetPrevBlockHash() string
- func (x *BlockHeader) GetPublic() string
- func (x *BlockHeader) GetTimestamp() uint64
- func (*BlockHeader) ProtoMessage()
- func (x *BlockHeader) ProtoReflect() protoreflect.Message
- func (x *BlockHeader) Reset()
- func (x *BlockHeader) String() string
- type BlockNumberResp
- func (*BlockNumberResp) Descriptor() ([]byte, []int)deprecated
- func (x *BlockNumberResp) GetNumber() uint64
- func (x *BlockNumberResp) GetTimestamp() uint64
- func (*BlockNumberResp) ProtoMessage()
- func (x *BlockNumberResp) ProtoReflect() protoreflect.Message
- func (x *BlockNumberResp) Reset()
- func (x *BlockNumberResp) String() string
- type BlockchainClient
- type BlockchainServer
- type ConnectedNodeReq
- type ConnectedNodeResp
- func (*ConnectedNodeResp) Descriptor() ([]byte, []int)deprecated
- func (x *ConnectedNodeResp) GetCode() NodeStatusRespCodes
- func (x *ConnectedNodeResp) GetLocal() string
- func (x *ConnectedNodeResp) GetRemote() []string
- func (*ConnectedNodeResp) ProtoMessage()
- func (x *ConnectedNodeResp) ProtoReflect() protoreflect.Message
- func (x *ConnectedNodeResp) Reset()
- func (x *ConnectedNodeResp) String() string
- type GetBlockReq
- func (*GetBlockReq) Descriptor() ([]byte, []int)deprecated
- func (x *GetBlockReq) GetFull() bool
- func (x *GetBlockReq) GetHash() string
- func (x *GetBlockReq) GetNumber() uint64
- func (*GetBlockReq) ProtoMessage()
- func (x *GetBlockReq) ProtoReflect() protoreflect.Message
- func (x *GetBlockReq) Reset()
- func (x *GetBlockReq) String() string
- type GetBlockResp
- func (*GetBlockResp) Descriptor() ([]byte, []int)deprecated
- func (x *GetBlockResp) GetBody() *Block
- func (x *GetBlockResp) GetTimestamp() uint64
- func (*GetBlockResp) ProtoMessage()
- func (x *GetBlockResp) ProtoReflect() protoreflect.Message
- func (x *GetBlockResp) Reset()
- func (x *GetBlockResp) String() string
- type GetTransactionReq
- func (*GetTransactionReq) Descriptor() ([]byte, []int)deprecated
- func (x *GetTransactionReq) GetBlockHash() string
- func (x *GetTransactionReq) GetBlockNumber() uint64
- func (x *GetTransactionReq) GetHash() string
- func (x *GetTransactionReq) GetIndex() uint64
- func (*GetTransactionReq) ProtoMessage()
- func (x *GetTransactionReq) ProtoReflect() protoreflect.Message
- func (x *GetTransactionReq) Reset()
- func (x *GetTransactionReq) String() string
- type GetTransactionResp
- func (*GetTransactionResp) Descriptor() ([]byte, []int)deprecated
- func (x *GetTransactionResp) GetBody() *Transaction
- func (x *GetTransactionResp) GetTimestamp() uint64
- func (*GetTransactionResp) ProtoMessage()
- func (x *GetTransactionResp) ProtoReflect() protoreflect.Message
- func (x *GetTransactionResp) Reset()
- func (x *GetTransactionResp) String() string
- type NodeClient
- type NodeServer
- type NodeStatusRespCodes
- func (NodeStatusRespCodes) Descriptor() protoreflect.EnumDescriptor
- func (x NodeStatusRespCodes) Enum() *NodeStatusRespCodes
- func (NodeStatusRespCodes) EnumDescriptor() ([]byte, []int)deprecated
- func (x NodeStatusRespCodes) Number() protoreflect.EnumNumber
- func (x NodeStatusRespCodes) String() string
- func (NodeStatusRespCodes) Type() protoreflect.EnumType
- type ReadContractAddressReq
- func (*ReadContractAddressReq) Descriptor() ([]byte, []int)deprecated
- func (x *ReadContractAddressReq) GetAddress() string
- func (x *ReadContractAddressReq) GetKey() string
- func (*ReadContractAddressReq) ProtoMessage()
- func (x *ReadContractAddressReq) ProtoReflect() protoreflect.Message
- func (x *ReadContractAddressReq) Reset()
- func (x *ReadContractAddressReq) String() string
- type ReadContractAddressResp
- func (*ReadContractAddressResp) Descriptor() ([]byte, []int)deprecated
- func (x *ReadContractAddressResp) GetHex() string
- func (*ReadContractAddressResp) ProtoMessage()
- func (x *ReadContractAddressResp) ProtoReflect() protoreflect.Message
- func (x *ReadContractAddressResp) Reset()
- func (x *ReadContractAddressResp) String() string
- type SendTransactionWithDataReq
- func (*SendTransactionWithDataReq) Descriptor() ([]byte, []int)deprecated
- func (x *SendTransactionWithDataReq) GetKey() string
- func (x *SendTransactionWithDataReq) GetReceiver() string
- func (x *SendTransactionWithDataReq) GetType() string
- func (x *SendTransactionWithDataReq) GetValue() string
- func (*SendTransactionWithDataReq) ProtoMessage()
- func (x *SendTransactionWithDataReq) ProtoReflect() protoreflect.Message
- func (x *SendTransactionWithDataReq) Reset()
- func (x *SendTransactionWithDataReq) String() string
- type SendTransactionWithDataResp
- func (*SendTransactionWithDataResp) Descriptor() ([]byte, []int)deprecated
- func (x *SendTransactionWithDataResp) GetTxHash() string
- func (*SendTransactionWithDataResp) ProtoMessage()
- func (x *SendTransactionWithDataResp) ProtoReflect() protoreflect.Message
- func (x *SendTransactionWithDataResp) Reset()
- func (x *SendTransactionWithDataResp) String() string
- type SubmitTransactionReq
- func (*SubmitTransactionReq) Descriptor() ([]byte, []int)deprecated
- func (x *SubmitTransactionReq) GetSignedTransaction() string
- func (*SubmitTransactionReq) ProtoMessage()
- func (x *SubmitTransactionReq) ProtoReflect() protoreflect.Message
- func (x *SubmitTransactionReq) Reset()
- func (x *SubmitTransactionReq) String() string
- type SubmitTransactionRsp
- func (*SubmitTransactionRsp) Descriptor() ([]byte, []int)deprecated
- func (x *SubmitTransactionRsp) GetError() string
- func (x *SubmitTransactionRsp) GetStatus() SubmitTransactionStatus
- func (*SubmitTransactionRsp) ProtoMessage()
- func (x *SubmitTransactionRsp) ProtoReflect() protoreflect.Message
- func (x *SubmitTransactionRsp) Reset()
- func (x *SubmitTransactionRsp) String() string
- type SubmitTransactionStatus
- func (SubmitTransactionStatus) Descriptor() protoreflect.EnumDescriptor
- func (x SubmitTransactionStatus) Enum() *SubmitTransactionStatus
- func (SubmitTransactionStatus) EnumDescriptor() ([]byte, []int)deprecated
- func (x SubmitTransactionStatus) Number() protoreflect.EnumNumber
- func (x SubmitTransactionStatus) String() string
- func (SubmitTransactionStatus) Type() protoreflect.EnumType
- type Transaction
- func (*Transaction) Descriptor() ([]byte, []int)deprecated
- func (x *Transaction) GetAddress() string
- func (x *Transaction) GetBlockHash() string
- func (x *Transaction) GetData() string
- func (x *Transaction) GetEvent() string
- func (x *Transaction) GetExpire() uint64
- func (x *Transaction) GetGas() uint64
- func (x *Transaction) GetHash() string
- func (x *Transaction) GetHeight() uint64
- func (x *Transaction) GetIndex() uint64
- func (x *Transaction) GetNonce() uint64
- func (x *Transaction) GetOpt() string
- func (x *Transaction) GetPublic() string
- func (x *Transaction) GetReceiver() string
- func (x *Transaction) GetSignature() string
- func (x *Transaction) GetState() string
- func (x *Transaction) GetTimestamp() uint64
- func (*Transaction) ProtoMessage()
- func (x *Transaction) ProtoReflect() protoreflect.Message
- func (x *Transaction) Reset()
- func (x *Transaction) String() string
- type TransactionServiceClient
- type TransactionServiceServer
- type UnimplementedBlockchainServer
- func (UnimplementedBlockchainServer) GetBlockByHash(context.Context, *GetBlockReq) (*GetBlockResp, error)
- func (UnimplementedBlockchainServer) GetBlockByNumber(context.Context, *GetBlockReq) (*GetBlockResp, error)
- func (UnimplementedBlockchainServer) GetBlockNumber(context.Context, *emptypb.Empty) (*BlockNumberResp, error)
- func (UnimplementedBlockchainServer) GetTransactionByBlockHashAndIndex(context.Context, *GetTransactionReq) (*GetTransactionResp, error)
- func (UnimplementedBlockchainServer) GetTransactionByBlockNumberAndIndex(context.Context, *GetTransactionReq) (*GetTransactionResp, error)
- func (UnimplementedBlockchainServer) GetTransactionByHash(context.Context, *GetTransactionReq) (*GetTransactionResp, error)
- func (UnimplementedBlockchainServer) ReadContractAddress(context.Context, *ReadContractAddressReq) (*ReadContractAddressResp, error)
- func (UnimplementedBlockchainServer) SendTransactionWithData(context.Context, *SendTransactionWithDataReq) (*SendTransactionWithDataResp, error)
- type UnimplementedNodeServer
- type UnimplementedTransactionServiceServer
- type UnsafeBlockchainServer
- type UnsafeNodeServer
- type UnsafeTransactionServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( NodeStatusRespCodes_name = map[int32]string{ 0: "DEFAULT", 100: "NODE_STATUS_SUCCESS", } NodeStatusRespCodes_value = map[string]int32{ "DEFAULT": 0, "NODE_STATUS_SUCCESS": 100, } )
Enum value maps for NodeStatusRespCodes.
var ( SubmitTransactionStatus_name = map[int32]string{ 0: "Default", 100: "SUCCESS", -101: "SIGNATURE_FAILED", -102: "DECODE_FAILED", -103: "DESERIALIZE_FAILED", -104: "FORMAT_ERROR", -105: "TRANSACTION_EXISTS", } SubmitTransactionStatus_value = map[string]int32{ "Default": 0, "SUCCESS": 100, "SIGNATURE_FAILED": -101, "DECODE_FAILED": -102, "DESERIALIZE_FAILED": -103, "FORMAT_ERROR": -104, "TRANSACTION_EXISTS": -105, } )
Enum value maps for SubmitTransactionStatus.
var Blockchain_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Blockchain", HandlerType: (*BlockchainServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetBlockNumber", Handler: _Blockchain_GetBlockNumber_Handler, }, { MethodName: "GetBlockByHash", Handler: _Blockchain_GetBlockByHash_Handler, }, { MethodName: "GetBlockByNumber", Handler: _Blockchain_GetBlockByNumber_Handler, }, { MethodName: "GetTransactionByHash", Handler: _Blockchain_GetTransactionByHash_Handler, }, { MethodName: "GetTransactionByBlockHashAndIndex", Handler: _Blockchain_GetTransactionByBlockHashAndIndex_Handler, }, { MethodName: "GetTransactionByBlockNumberAndIndex", Handler: _Blockchain_GetTransactionByBlockNumberAndIndex_Handler, }, { MethodName: "ReadContractAddress", Handler: _Blockchain_ReadContractAddress_Handler, }, { MethodName: "SendTransactionWithData", Handler: _Blockchain_SendTransactionWithData_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "blockchain.proto", }
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 File_blockchain_proto protoreflect.FileDescriptor
var File_node_proto protoreflect.FileDescriptor
var File_transaction_proto protoreflect.FileDescriptor
var Node_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Node", HandlerType: (*NodeServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ConnectedNodeList", Handler: _Node_ConnectedNodeList_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "node.proto", }
Node_ServiceDesc is the grpc.ServiceDesc for Node service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var TransactionService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "TransactionService", HandlerType: (*TransactionServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SubmitTransaction", Handler: _TransactionService_SubmitTransaction_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "transaction.proto", }
TransactionService_ServiceDesc is the grpc.ServiceDesc for TransactionService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterBlockchainServer ¶
func RegisterBlockchainServer(s grpc.ServiceRegistrar, srv BlockchainServer)
func RegisterNodeServer ¶
func RegisterNodeServer(s grpc.ServiceRegistrar, srv NodeServer)
func RegisterTransactionServiceServer ¶
func RegisterTransactionServiceServer(s grpc.ServiceRegistrar, srv TransactionServiceServer)
Types ¶
type Block ¶
type Block struct { Header *BlockHeader `protobuf:"bytes,1,opt,name=header,proto3,oneof" json:"header,omitempty"` Transactions []*Transaction `protobuf:"bytes,2,rep,name=transactions,proto3" json:"transactions,omitempty"` // contains filtered or unexported fields }
func (*Block) Descriptor
deprecated
func (*Block) GetHeader ¶
func (x *Block) GetHeader() *BlockHeader
func (*Block) GetTransactions ¶
func (x *Block) GetTransactions() []*Transaction
func (*Block) ProtoMessage ¶
func (*Block) ProtoMessage()
func (*Block) ProtoReflect ¶
func (x *Block) ProtoReflect() protoreflect.Message
type BlockHeader ¶
type BlockHeader struct { Timestamp *uint64 `protobuf:"varint,1,opt,name=timestamp,proto3,oneof" json:"timestamp,omitempty"` PrevBlockHash *string `protobuf:"bytes,2,opt,name=prevBlockHash,proto3,oneof" json:"prevBlockHash,omitempty"` BlockHash *string `protobuf:"bytes,3,opt,name=blockHash,proto3,oneof" json:"blockHash,omitempty"` MerkleRoot *string `protobuf:"bytes,4,opt,name=merkleRoot,proto3,oneof" json:"merkleRoot,omitempty"` Height *uint64 `protobuf:"varint,5,opt,name=height,proto3,oneof" json:"height,omitempty"` Public *string `protobuf:"bytes,6,opt,name=public,proto3,oneof" json:"public,omitempty"` Params *string `protobuf:"bytes,7,opt,name=params,proto3,oneof" json:"params,omitempty"` GasLimit *uint64 `protobuf:"varint,8,opt,name=gasLimit,proto3,oneof" json:"gasLimit,omitempty"` // contains filtered or unexported fields }
func (*BlockHeader) Descriptor
deprecated
func (*BlockHeader) Descriptor() ([]byte, []int)
Deprecated: Use BlockHeader.ProtoReflect.Descriptor instead.
func (*BlockHeader) GetBlockHash ¶
func (x *BlockHeader) GetBlockHash() string
func (*BlockHeader) GetGasLimit ¶
func (x *BlockHeader) GetGasLimit() uint64
func (*BlockHeader) GetHeight ¶
func (x *BlockHeader) GetHeight() uint64
func (*BlockHeader) GetMerkleRoot ¶
func (x *BlockHeader) GetMerkleRoot() string
func (*BlockHeader) GetParams ¶
func (x *BlockHeader) GetParams() string
func (*BlockHeader) GetPrevBlockHash ¶
func (x *BlockHeader) GetPrevBlockHash() string
func (*BlockHeader) GetPublic ¶
func (x *BlockHeader) GetPublic() string
func (*BlockHeader) GetTimestamp ¶
func (x *BlockHeader) GetTimestamp() uint64
func (*BlockHeader) ProtoMessage ¶
func (*BlockHeader) ProtoMessage()
func (*BlockHeader) ProtoReflect ¶
func (x *BlockHeader) ProtoReflect() protoreflect.Message
func (*BlockHeader) Reset ¶
func (x *BlockHeader) Reset()
func (*BlockHeader) String ¶
func (x *BlockHeader) String() string
type BlockNumberResp ¶
type BlockNumberResp struct { Timestamp *uint64 `protobuf:"varint,1,opt,name=timestamp,proto3,oneof" json:"timestamp,omitempty"` Number *uint64 `protobuf:"varint,2,opt,name=number,proto3,oneof" json:"number,omitempty"` // contains filtered or unexported fields }
func (*BlockNumberResp) Descriptor
deprecated
func (*BlockNumberResp) Descriptor() ([]byte, []int)
Deprecated: Use BlockNumberResp.ProtoReflect.Descriptor instead.
func (*BlockNumberResp) GetNumber ¶
func (x *BlockNumberResp) GetNumber() uint64
func (*BlockNumberResp) GetTimestamp ¶
func (x *BlockNumberResp) GetTimestamp() uint64
func (*BlockNumberResp) ProtoMessage ¶
func (*BlockNumberResp) ProtoMessage()
func (*BlockNumberResp) ProtoReflect ¶
func (x *BlockNumberResp) ProtoReflect() protoreflect.Message
func (*BlockNumberResp) Reset ¶
func (x *BlockNumberResp) Reset()
func (*BlockNumberResp) String ¶
func (x *BlockNumberResp) String() string
type BlockchainClient ¶
type BlockchainClient interface { GetBlockNumber(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*BlockNumberResp, error) GetBlockByHash(ctx context.Context, in *GetBlockReq, opts ...grpc.CallOption) (*GetBlockResp, error) GetBlockByNumber(ctx context.Context, in *GetBlockReq, opts ...grpc.CallOption) (*GetBlockResp, error) GetTransactionByHash(ctx context.Context, in *GetTransactionReq, opts ...grpc.CallOption) (*GetTransactionResp, error) GetTransactionByBlockHashAndIndex(ctx context.Context, in *GetTransactionReq, opts ...grpc.CallOption) (*GetTransactionResp, error) GetTransactionByBlockNumberAndIndex(ctx context.Context, in *GetTransactionReq, opts ...grpc.CallOption) (*GetTransactionResp, error) ReadContractAddress(ctx context.Context, in *ReadContractAddressReq, opts ...grpc.CallOption) (*ReadContractAddressResp, error) SendTransactionWithData(ctx context.Context, in *SendTransactionWithDataReq, opts ...grpc.CallOption) (*SendTransactionWithDataResp, error) }
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.
func NewBlockchainClient ¶
func NewBlockchainClient(cc grpc.ClientConnInterface) BlockchainClient
type BlockchainServer ¶
type BlockchainServer interface { GetBlockNumber(context.Context, *emptypb.Empty) (*BlockNumberResp, error) GetBlockByHash(context.Context, *GetBlockReq) (*GetBlockResp, error) GetBlockByNumber(context.Context, *GetBlockReq) (*GetBlockResp, error) GetTransactionByHash(context.Context, *GetTransactionReq) (*GetTransactionResp, error) GetTransactionByBlockHashAndIndex(context.Context, *GetTransactionReq) (*GetTransactionResp, error) GetTransactionByBlockNumberAndIndex(context.Context, *GetTransactionReq) (*GetTransactionResp, error) ReadContractAddress(context.Context, *ReadContractAddressReq) (*ReadContractAddressResp, error) SendTransactionWithData(context.Context, *SendTransactionWithDataReq) (*SendTransactionWithDataResp, error) // contains filtered or unexported methods }
BlockchainServer is the server API for Blockchain service. All implementations must embed UnimplementedBlockchainServer for forward compatibility
type ConnectedNodeReq ¶
type ConnectedNodeReq struct {
// contains filtered or unexported fields
}
func (*ConnectedNodeReq) Descriptor
deprecated
func (*ConnectedNodeReq) Descriptor() ([]byte, []int)
Deprecated: Use ConnectedNodeReq.ProtoReflect.Descriptor instead.
func (*ConnectedNodeReq) ProtoMessage ¶
func (*ConnectedNodeReq) ProtoMessage()
func (*ConnectedNodeReq) ProtoReflect ¶
func (x *ConnectedNodeReq) ProtoReflect() protoreflect.Message
func (*ConnectedNodeReq) Reset ¶
func (x *ConnectedNodeReq) Reset()
func (*ConnectedNodeReq) String ¶
func (x *ConnectedNodeReq) String() string
type ConnectedNodeResp ¶
type ConnectedNodeResp struct { Code *NodeStatusRespCodes `protobuf:"varint,1,opt,name=code,proto3,enum=NodeStatusRespCodes,oneof" json:"code,omitempty"` Local *string `protobuf:"bytes,2,opt,name=local,proto3,oneof" json:"local,omitempty"` Remote []string `protobuf:"bytes,3,rep,name=remote,proto3" json:"remote,omitempty"` // contains filtered or unexported fields }
func (*ConnectedNodeResp) Descriptor
deprecated
func (*ConnectedNodeResp) Descriptor() ([]byte, []int)
Deprecated: Use ConnectedNodeResp.ProtoReflect.Descriptor instead.
func (*ConnectedNodeResp) GetCode ¶
func (x *ConnectedNodeResp) GetCode() NodeStatusRespCodes
func (*ConnectedNodeResp) GetLocal ¶
func (x *ConnectedNodeResp) GetLocal() string
func (*ConnectedNodeResp) GetRemote ¶
func (x *ConnectedNodeResp) GetRemote() []string
func (*ConnectedNodeResp) ProtoMessage ¶
func (*ConnectedNodeResp) ProtoMessage()
func (*ConnectedNodeResp) ProtoReflect ¶
func (x *ConnectedNodeResp) ProtoReflect() protoreflect.Message
func (*ConnectedNodeResp) Reset ¶
func (x *ConnectedNodeResp) Reset()
func (*ConnectedNodeResp) String ¶
func (x *ConnectedNodeResp) String() string
type GetBlockReq ¶
type GetBlockReq struct { Number *uint64 `protobuf:"varint,1,opt,name=number,proto3,oneof" json:"number,omitempty"` Hash *string `protobuf:"bytes,2,opt,name=hash,proto3,oneof" json:"hash,omitempty"` Full *bool `protobuf:"varint,3,opt,name=full,proto3,oneof" json:"full,omitempty"` // contains filtered or unexported fields }
func (*GetBlockReq) Descriptor
deprecated
func (*GetBlockReq) Descriptor() ([]byte, []int)
Deprecated: Use GetBlockReq.ProtoReflect.Descriptor instead.
func (*GetBlockReq) GetFull ¶
func (x *GetBlockReq) GetFull() bool
func (*GetBlockReq) GetHash ¶
func (x *GetBlockReq) GetHash() string
func (*GetBlockReq) GetNumber ¶
func (x *GetBlockReq) GetNumber() uint64
func (*GetBlockReq) ProtoMessage ¶
func (*GetBlockReq) ProtoMessage()
func (*GetBlockReq) ProtoReflect ¶
func (x *GetBlockReq) ProtoReflect() protoreflect.Message
func (*GetBlockReq) Reset ¶
func (x *GetBlockReq) Reset()
func (*GetBlockReq) String ¶
func (x *GetBlockReq) String() string
type GetBlockResp ¶
type GetBlockResp struct { Timestamp *uint64 `protobuf:"varint,1,opt,name=timestamp,proto3,oneof" json:"timestamp,omitempty"` Body *Block `protobuf:"bytes,2,opt,name=body,proto3,oneof" json:"body,omitempty"` // contains filtered or unexported fields }
func (*GetBlockResp) Descriptor
deprecated
func (*GetBlockResp) Descriptor() ([]byte, []int)
Deprecated: Use GetBlockResp.ProtoReflect.Descriptor instead.
func (*GetBlockResp) GetBody ¶
func (x *GetBlockResp) GetBody() *Block
func (*GetBlockResp) GetTimestamp ¶
func (x *GetBlockResp) GetTimestamp() uint64
func (*GetBlockResp) ProtoMessage ¶
func (*GetBlockResp) ProtoMessage()
func (*GetBlockResp) ProtoReflect ¶
func (x *GetBlockResp) ProtoReflect() protoreflect.Message
func (*GetBlockResp) Reset ¶
func (x *GetBlockResp) Reset()
func (*GetBlockResp) String ¶
func (x *GetBlockResp) String() string
type GetTransactionReq ¶
type GetTransactionReq struct { BlockNumber *uint64 `protobuf:"varint,1,opt,name=blockNumber,proto3,oneof" json:"blockNumber,omitempty"` BlockHash *string `protobuf:"bytes,2,opt,name=blockHash,proto3,oneof" json:"blockHash,omitempty"` Hash *string `protobuf:"bytes,3,opt,name=hash,proto3,oneof" json:"hash,omitempty"` Index *uint64 `protobuf:"varint,4,opt,name=index,proto3,oneof" json:"index,omitempty"` // contains filtered or unexported fields }
func (*GetTransactionReq) Descriptor
deprecated
func (*GetTransactionReq) Descriptor() ([]byte, []int)
Deprecated: Use GetTransactionReq.ProtoReflect.Descriptor instead.
func (*GetTransactionReq) GetBlockHash ¶
func (x *GetTransactionReq) GetBlockHash() string
func (*GetTransactionReq) GetBlockNumber ¶
func (x *GetTransactionReq) GetBlockNumber() uint64
func (*GetTransactionReq) GetHash ¶
func (x *GetTransactionReq) GetHash() string
func (*GetTransactionReq) GetIndex ¶
func (x *GetTransactionReq) GetIndex() uint64
func (*GetTransactionReq) ProtoMessage ¶
func (*GetTransactionReq) ProtoMessage()
func (*GetTransactionReq) ProtoReflect ¶
func (x *GetTransactionReq) ProtoReflect() protoreflect.Message
func (*GetTransactionReq) Reset ¶
func (x *GetTransactionReq) Reset()
func (*GetTransactionReq) String ¶
func (x *GetTransactionReq) String() string
type GetTransactionResp ¶
type GetTransactionResp struct { Timestamp *uint64 `protobuf:"varint,1,opt,name=timestamp,proto3,oneof" json:"timestamp,omitempty"` Body *Transaction `protobuf:"bytes,2,opt,name=body,proto3,oneof" json:"body,omitempty"` // contains filtered or unexported fields }
func (*GetTransactionResp) Descriptor
deprecated
func (*GetTransactionResp) Descriptor() ([]byte, []int)
Deprecated: Use GetTransactionResp.ProtoReflect.Descriptor instead.
func (*GetTransactionResp) GetBody ¶
func (x *GetTransactionResp) GetBody() *Transaction
func (*GetTransactionResp) GetTimestamp ¶
func (x *GetTransactionResp) GetTimestamp() uint64
func (*GetTransactionResp) ProtoMessage ¶
func (*GetTransactionResp) ProtoMessage()
func (*GetTransactionResp) ProtoReflect ¶
func (x *GetTransactionResp) ProtoReflect() protoreflect.Message
func (*GetTransactionResp) Reset ¶
func (x *GetTransactionResp) Reset()
func (*GetTransactionResp) String ¶
func (x *GetTransactionResp) String() string
type NodeClient ¶
type NodeClient interface {
ConnectedNodeList(ctx context.Context, in *ConnectedNodeReq, opts ...grpc.CallOption) (*ConnectedNodeResp, error)
}
NodeClient is the client API for Node 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.
func NewNodeClient ¶
func NewNodeClient(cc grpc.ClientConnInterface) NodeClient
type NodeServer ¶
type NodeServer interface { ConnectedNodeList(context.Context, *ConnectedNodeReq) (*ConnectedNodeResp, error) // contains filtered or unexported methods }
NodeServer is the server API for Node service. All implementations must embed UnimplementedNodeServer for forward compatibility
type NodeStatusRespCodes ¶
type NodeStatusRespCodes int32
const ( NodeStatusRespCodes_DEFAULT NodeStatusRespCodes = 0 NodeStatusRespCodes_NODE_STATUS_SUCCESS NodeStatusRespCodes = 100 )
func (NodeStatusRespCodes) Descriptor ¶
func (NodeStatusRespCodes) Descriptor() protoreflect.EnumDescriptor
func (NodeStatusRespCodes) Enum ¶
func (x NodeStatusRespCodes) Enum() *NodeStatusRespCodes
func (NodeStatusRespCodes) EnumDescriptor
deprecated
func (NodeStatusRespCodes) EnumDescriptor() ([]byte, []int)
Deprecated: Use NodeStatusRespCodes.Descriptor instead.
func (NodeStatusRespCodes) Number ¶
func (x NodeStatusRespCodes) Number() protoreflect.EnumNumber
func (NodeStatusRespCodes) String ¶
func (x NodeStatusRespCodes) String() string
func (NodeStatusRespCodes) Type ¶
func (NodeStatusRespCodes) Type() protoreflect.EnumType
type ReadContractAddressReq ¶
type ReadContractAddressReq struct { Address *string `protobuf:"bytes,1,opt,name=address,proto3,oneof" json:"address,omitempty"` Key *string `protobuf:"bytes,2,opt,name=key,proto3,oneof" json:"key,omitempty"` // contains filtered or unexported fields }
func (*ReadContractAddressReq) Descriptor
deprecated
func (*ReadContractAddressReq) Descriptor() ([]byte, []int)
Deprecated: Use ReadContractAddressReq.ProtoReflect.Descriptor instead.
func (*ReadContractAddressReq) GetAddress ¶
func (x *ReadContractAddressReq) GetAddress() string
func (*ReadContractAddressReq) GetKey ¶
func (x *ReadContractAddressReq) GetKey() string
func (*ReadContractAddressReq) ProtoMessage ¶
func (*ReadContractAddressReq) ProtoMessage()
func (*ReadContractAddressReq) ProtoReflect ¶
func (x *ReadContractAddressReq) ProtoReflect() protoreflect.Message
func (*ReadContractAddressReq) Reset ¶
func (x *ReadContractAddressReq) Reset()
func (*ReadContractAddressReq) String ¶
func (x *ReadContractAddressReq) String() string
type ReadContractAddressResp ¶
type ReadContractAddressResp struct { Hex *string `protobuf:"bytes,1,opt,name=hex,proto3,oneof" json:"hex,omitempty"` // contains filtered or unexported fields }
func (*ReadContractAddressResp) Descriptor
deprecated
func (*ReadContractAddressResp) Descriptor() ([]byte, []int)
Deprecated: Use ReadContractAddressResp.ProtoReflect.Descriptor instead.
func (*ReadContractAddressResp) GetHex ¶
func (x *ReadContractAddressResp) GetHex() string
func (*ReadContractAddressResp) ProtoMessage ¶
func (*ReadContractAddressResp) ProtoMessage()
func (*ReadContractAddressResp) ProtoReflect ¶
func (x *ReadContractAddressResp) ProtoReflect() protoreflect.Message
func (*ReadContractAddressResp) Reset ¶
func (x *ReadContractAddressResp) Reset()
func (*ReadContractAddressResp) String ¶
func (x *ReadContractAddressResp) String() string
type SendTransactionWithDataReq ¶
type SendTransactionWithDataReq struct { Type *string `protobuf:"bytes,1,opt,name=type,proto3,oneof" json:"type,omitempty"` Receiver *string `protobuf:"bytes,2,opt,name=receiver,proto3,oneof" json:"receiver,omitempty"` Key *string `protobuf:"bytes,3,opt,name=key,proto3,oneof" json:"key,omitempty"` Value *string `protobuf:"bytes,4,opt,name=value,proto3,oneof" json:"value,omitempty"` // contains filtered or unexported fields }
func (*SendTransactionWithDataReq) Descriptor
deprecated
func (*SendTransactionWithDataReq) Descriptor() ([]byte, []int)
Deprecated: Use SendTransactionWithDataReq.ProtoReflect.Descriptor instead.
func (*SendTransactionWithDataReq) GetKey ¶
func (x *SendTransactionWithDataReq) GetKey() string
func (*SendTransactionWithDataReq) GetReceiver ¶
func (x *SendTransactionWithDataReq) GetReceiver() string
func (*SendTransactionWithDataReq) GetType ¶
func (x *SendTransactionWithDataReq) GetType() string
func (*SendTransactionWithDataReq) GetValue ¶
func (x *SendTransactionWithDataReq) GetValue() string
func (*SendTransactionWithDataReq) ProtoMessage ¶
func (*SendTransactionWithDataReq) ProtoMessage()
func (*SendTransactionWithDataReq) ProtoReflect ¶
func (x *SendTransactionWithDataReq) ProtoReflect() protoreflect.Message
func (*SendTransactionWithDataReq) Reset ¶
func (x *SendTransactionWithDataReq) Reset()
func (*SendTransactionWithDataReq) String ¶
func (x *SendTransactionWithDataReq) String() string
type SendTransactionWithDataResp ¶
type SendTransactionWithDataResp struct { TxHash *string `protobuf:"bytes,1,opt,name=txHash,proto3,oneof" json:"txHash,omitempty"` // contains filtered or unexported fields }
func (*SendTransactionWithDataResp) Descriptor
deprecated
func (*SendTransactionWithDataResp) Descriptor() ([]byte, []int)
Deprecated: Use SendTransactionWithDataResp.ProtoReflect.Descriptor instead.
func (*SendTransactionWithDataResp) GetTxHash ¶
func (x *SendTransactionWithDataResp) GetTxHash() string
func (*SendTransactionWithDataResp) ProtoMessage ¶
func (*SendTransactionWithDataResp) ProtoMessage()
func (*SendTransactionWithDataResp) ProtoReflect ¶
func (x *SendTransactionWithDataResp) ProtoReflect() protoreflect.Message
func (*SendTransactionWithDataResp) Reset ¶
func (x *SendTransactionWithDataResp) Reset()
func (*SendTransactionWithDataResp) String ¶
func (x *SendTransactionWithDataResp) String() string
type SubmitTransactionReq ¶
type SubmitTransactionReq struct { // todo: base16 编码,传输效率? SignedTransaction *string `protobuf:"bytes,1,opt,name=signedTransaction,proto3,oneof" json:"signedTransaction,omitempty"` // contains filtered or unexported fields }
func (*SubmitTransactionReq) Descriptor
deprecated
func (*SubmitTransactionReq) Descriptor() ([]byte, []int)
Deprecated: Use SubmitTransactionReq.ProtoReflect.Descriptor instead.
func (*SubmitTransactionReq) GetSignedTransaction ¶
func (x *SubmitTransactionReq) GetSignedTransaction() string
func (*SubmitTransactionReq) ProtoMessage ¶
func (*SubmitTransactionReq) ProtoMessage()
func (*SubmitTransactionReq) ProtoReflect ¶
func (x *SubmitTransactionReq) ProtoReflect() protoreflect.Message
func (*SubmitTransactionReq) Reset ¶
func (x *SubmitTransactionReq) Reset()
func (*SubmitTransactionReq) String ¶
func (x *SubmitTransactionReq) String() string
type SubmitTransactionRsp ¶
type SubmitTransactionRsp struct { Status *SubmitTransactionStatus `protobuf:"varint,1,opt,name=status,proto3,enum=SubmitTransactionStatus,oneof" json:"status,omitempty"` Error *string `protobuf:"bytes,2,opt,name=error,proto3,oneof" json:"error,omitempty"` // contains filtered or unexported fields }
func (*SubmitTransactionRsp) Descriptor
deprecated
func (*SubmitTransactionRsp) Descriptor() ([]byte, []int)
Deprecated: Use SubmitTransactionRsp.ProtoReflect.Descriptor instead.
func (*SubmitTransactionRsp) GetError ¶
func (x *SubmitTransactionRsp) GetError() string
func (*SubmitTransactionRsp) GetStatus ¶
func (x *SubmitTransactionRsp) GetStatus() SubmitTransactionStatus
func (*SubmitTransactionRsp) ProtoMessage ¶
func (*SubmitTransactionRsp) ProtoMessage()
func (*SubmitTransactionRsp) ProtoReflect ¶
func (x *SubmitTransactionRsp) ProtoReflect() protoreflect.Message
func (*SubmitTransactionRsp) Reset ¶
func (x *SubmitTransactionRsp) Reset()
func (*SubmitTransactionRsp) String ¶
func (x *SubmitTransactionRsp) String() string
type SubmitTransactionStatus ¶
type SubmitTransactionStatus int32
const ( SubmitTransactionStatus_Default SubmitTransactionStatus = 0 SubmitTransactionStatus_SUCCESS SubmitTransactionStatus = 100 SubmitTransactionStatus_SIGNATURE_FAILED SubmitTransactionStatus = -101 // 签名校验错误 SubmitTransactionStatus_DECODE_FAILED SubmitTransactionStatus = -102 // 解码失败 SubmitTransactionStatus_DESERIALIZE_FAILED SubmitTransactionStatus = -103 // 反序列化失败 SubmitTransactionStatus_FORMAT_ERROR SubmitTransactionStatus = -104 // 交易格式错误,字段校验失败 SubmitTransactionStatus_TRANSACTION_EXISTS SubmitTransactionStatus = -105 // 交易已存在 )
func (SubmitTransactionStatus) Descriptor ¶
func (SubmitTransactionStatus) Descriptor() protoreflect.EnumDescriptor
func (SubmitTransactionStatus) Enum ¶
func (x SubmitTransactionStatus) Enum() *SubmitTransactionStatus
func (SubmitTransactionStatus) EnumDescriptor
deprecated
func (SubmitTransactionStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use SubmitTransactionStatus.Descriptor instead.
func (SubmitTransactionStatus) Number ¶
func (x SubmitTransactionStatus) Number() protoreflect.EnumNumber
func (SubmitTransactionStatus) String ¶
func (x SubmitTransactionStatus) String() string
func (SubmitTransactionStatus) Type ¶
func (SubmitTransactionStatus) Type() protoreflect.EnumType
type Transaction ¶
type Transaction struct { Hash *string `protobuf:"bytes,1,opt,name=hash,proto3,oneof" json:"hash,omitempty"` Address *string `protobuf:"bytes,2,opt,name=address,proto3,oneof" json:"address,omitempty"` Receiver *string `protobuf:"bytes,3,opt,name=receiver,proto3,oneof" json:"receiver,omitempty"` Gas *uint64 `protobuf:"varint,4,opt,name=gas,proto3,oneof" json:"gas,omitempty"` Nonce *uint64 `protobuf:"varint,5,opt,name=nonce,proto3,oneof" json:"nonce,omitempty"` Event *string `protobuf:"bytes,6,opt,name=event,proto3,oneof" json:"event,omitempty"` Opt *string `protobuf:"bytes,7,opt,name=opt,proto3,oneof" json:"opt,omitempty"` State *string `protobuf:"bytes,8,opt,name=state,proto3,oneof" json:"state,omitempty"` Data *string `protobuf:"bytes,9,opt,name=data,proto3,oneof" json:"data,omitempty"` Expire *uint64 `protobuf:"varint,10,opt,name=expire,proto3,oneof" json:"expire,omitempty"` Timestamp *uint64 `protobuf:"varint,11,opt,name=timestamp,proto3,oneof" json:"timestamp,omitempty"` Public *string `protobuf:"bytes,12,opt,name=public,proto3,oneof" json:"public,omitempty"` Signature *string `protobuf:"bytes,13,opt,name=signature,proto3,oneof" json:"signature,omitempty"` Height *uint64 `protobuf:"varint,14,opt,name=height,proto3,oneof" json:"height,omitempty"` BlockHash *string `protobuf:"bytes,15,opt,name=blockHash,proto3,oneof" json:"blockHash,omitempty"` Index *uint64 `protobuf:"varint,16,opt,name=index,proto3,oneof" json:"index,omitempty"` // contains filtered or unexported fields }
func (*Transaction) Descriptor
deprecated
func (*Transaction) Descriptor() ([]byte, []int)
Deprecated: Use Transaction.ProtoReflect.Descriptor instead.
func (*Transaction) GetAddress ¶
func (x *Transaction) GetAddress() string
func (*Transaction) GetBlockHash ¶
func (x *Transaction) GetBlockHash() string
func (*Transaction) GetData ¶
func (x *Transaction) GetData() string
func (*Transaction) GetEvent ¶
func (x *Transaction) GetEvent() string
func (*Transaction) GetExpire ¶
func (x *Transaction) GetExpire() uint64
func (*Transaction) GetGas ¶
func (x *Transaction) GetGas() uint64
func (*Transaction) GetHash ¶
func (x *Transaction) GetHash() string
func (*Transaction) GetHeight ¶
func (x *Transaction) GetHeight() uint64
func (*Transaction) GetIndex ¶
func (x *Transaction) GetIndex() uint64
func (*Transaction) GetNonce ¶
func (x *Transaction) GetNonce() uint64
func (*Transaction) GetOpt ¶
func (x *Transaction) GetOpt() string
func (*Transaction) GetPublic ¶
func (x *Transaction) GetPublic() string
func (*Transaction) GetReceiver ¶
func (x *Transaction) GetReceiver() string
func (*Transaction) GetSignature ¶
func (x *Transaction) GetSignature() string
func (*Transaction) GetState ¶
func (x *Transaction) GetState() string
func (*Transaction) GetTimestamp ¶
func (x *Transaction) GetTimestamp() uint64
func (*Transaction) ProtoMessage ¶
func (*Transaction) ProtoMessage()
func (*Transaction) ProtoReflect ¶
func (x *Transaction) ProtoReflect() protoreflect.Message
func (*Transaction) Reset ¶
func (x *Transaction) Reset()
func (*Transaction) String ¶
func (x *Transaction) String() string
type TransactionServiceClient ¶
type TransactionServiceClient interface {
SubmitTransaction(ctx context.Context, in *SubmitTransactionReq, opts ...grpc.CallOption) (*SubmitTransactionRsp, error)
}
TransactionServiceClient is the client API for TransactionService 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.
func NewTransactionServiceClient ¶
func NewTransactionServiceClient(cc grpc.ClientConnInterface) TransactionServiceClient
type TransactionServiceServer ¶
type TransactionServiceServer interface { SubmitTransaction(context.Context, *SubmitTransactionReq) (*SubmitTransactionRsp, error) // contains filtered or unexported methods }
TransactionServiceServer is the server API for TransactionService service. All implementations must embed UnimplementedTransactionServiceServer for forward compatibility
type UnimplementedBlockchainServer ¶
type UnimplementedBlockchainServer struct { }
UnimplementedBlockchainServer must be embedded to have forward compatible implementations.
func (UnimplementedBlockchainServer) GetBlockByHash ¶
func (UnimplementedBlockchainServer) GetBlockByHash(context.Context, *GetBlockReq) (*GetBlockResp, error)
func (UnimplementedBlockchainServer) GetBlockByNumber ¶
func (UnimplementedBlockchainServer) GetBlockByNumber(context.Context, *GetBlockReq) (*GetBlockResp, error)
func (UnimplementedBlockchainServer) GetBlockNumber ¶
func (UnimplementedBlockchainServer) GetBlockNumber(context.Context, *emptypb.Empty) (*BlockNumberResp, error)
func (UnimplementedBlockchainServer) GetTransactionByBlockHashAndIndex ¶
func (UnimplementedBlockchainServer) GetTransactionByBlockHashAndIndex(context.Context, *GetTransactionReq) (*GetTransactionResp, error)
func (UnimplementedBlockchainServer) GetTransactionByBlockNumberAndIndex ¶
func (UnimplementedBlockchainServer) GetTransactionByBlockNumberAndIndex(context.Context, *GetTransactionReq) (*GetTransactionResp, error)
func (UnimplementedBlockchainServer) GetTransactionByHash ¶
func (UnimplementedBlockchainServer) GetTransactionByHash(context.Context, *GetTransactionReq) (*GetTransactionResp, error)
func (UnimplementedBlockchainServer) ReadContractAddress ¶
func (UnimplementedBlockchainServer) ReadContractAddress(context.Context, *ReadContractAddressReq) (*ReadContractAddressResp, error)
func (UnimplementedBlockchainServer) SendTransactionWithData ¶
func (UnimplementedBlockchainServer) SendTransactionWithData(context.Context, *SendTransactionWithDataReq) (*SendTransactionWithDataResp, error)
type UnimplementedNodeServer ¶
type UnimplementedNodeServer struct { }
UnimplementedNodeServer must be embedded to have forward compatible implementations.
func (UnimplementedNodeServer) ConnectedNodeList ¶
func (UnimplementedNodeServer) ConnectedNodeList(context.Context, *ConnectedNodeReq) (*ConnectedNodeResp, error)
type UnimplementedTransactionServiceServer ¶
type UnimplementedTransactionServiceServer struct { }
UnimplementedTransactionServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedTransactionServiceServer) SubmitTransaction ¶
func (UnimplementedTransactionServiceServer) SubmitTransaction(context.Context, *SubmitTransactionReq) (*SubmitTransactionRsp, error)
type UnsafeBlockchainServer ¶
type UnsafeBlockchainServer interface {
// contains filtered or unexported methods
}
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 UnsafeNodeServer ¶
type UnsafeNodeServer interface {
// contains filtered or unexported methods
}
UnsafeNodeServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NodeServer will result in compilation errors.
type UnsafeTransactionServiceServer ¶
type UnsafeTransactionServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTransactionServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TransactionServiceServer will result in compilation errors.