Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterNodeServer(s grpc.ServiceRegistrar, srv NodeServer)
- type AccountChange
- type AccountHeight
- type AccountWithCode
- type BlockInfo
- type BlockMessage
- type CashedCheckExistence
- type ChainInfo
- type DataNodeInfo
- type NodeClient
- type NodeInfo
- type NodeServer
- type RPCServer
- func (s *RPCServer) CallTransaction(ctx context.Context, tx *RpcTx) (*RpcResponse, error)
- func (s *RPCServer) Closer() error
- func (s *RPCServer) GetAccount(ctx context.Context, addr *RpcAddress) (*RpcResponse, error)
- func (s *RPCServer) GetAccountWithChainHeight(ctx context.Context, addr *RpcAddress) (*RpcResponse, error)
- func (s *RPCServer) GetBlock(ctx context.Context, req *RpcBlockHeight) (*RpcRespondStream, error)
- func (s *RPCServer) GetBlockHeader(ctx context.Context, req *RpcBlockHeight) (*RpcResponse, error)
- func (s *RPCServer) GetBlockHeaders(ctx context.Context, req *RpcBlockHeight) (*RpcResponse, error)
- func (s *RPCServer) GetBlockTxs(ctx context.Context, req *RpcBlockTxsReq) (*RpcResponse, error)
- func (s *RPCServer) GetCCCRelativeTx(ctx context.Context, req *RpcCashCheck) (*RpcResponse, error)
- func (s *RPCServer) GetChainInfo(ctx context.Context, req *RpcChainInfoReq) (*RpcResponse, error)
- func (s *RPCServer) GetCommittee(ctx context.Context, req *RpcChainEpoch) (*RpcResponse, error)
- func (s *RPCServer) GetRRCurrent(ctx context.Context, req *RpcChainRequest) (*RpcResponse, error)
- func (s *RPCServer) GetRRProofs(ctx context.Context, req *RpcRRProofReq) (*RpcResponse, error)
- func (s *RPCServer) GetStats(ctx context.Context, req *RpcStatsReq) (*RpcResponse, error)
- func (s *RPCServer) GetTransactionByHash(ctx context.Context, txs *RpcTXHash) (*RpcResponse, error)
- func (s *RPCServer) GetTransactions(ctx context.Context, txs *RpcTxList) (*RpcResponse, error)
- func (s *RPCServer) Initializer() error
- func (s *RPCServer) MakeCCCExistenceProof(ctx context.Context, req *RpcCashCheck) (*RpcResponse, error)
- func (s *RPCServer) MakeVccProof(ctx context.Context, req *RpcCashCheck) (*RpcResponse, error)
- func (s *RPCServer) Ping(ctx context.Context, req *RpcRequest) (*RpcResponse, error)
- func (s *RPCServer) SendBlock(ctx context.Context, req *RpcMsgReq) (*RpcResponse, error)
- func (s *RPCServer) SendTx(ctx context.Context, tx *RpcTx) (*RpcResponse, error)
- func (s *RPCServer) Starter() error
- func (s *RPCServer) String() string
- func (s *RPCServer) TryCrypto(ctx context.Context, req *RpcMsgReq) (*RpcResponse, error)
- type RpcAddress
- func (*RpcAddress) Descriptor() ([]byte, []int)deprecated
- func (x *RpcAddress) GetAddress() []byte
- func (x *RpcAddress) GetChainid() uint32
- func (m *RpcAddress) MarshalJSON() ([]byte, error)
- func (m *RpcAddress) PrintString() string
- func (*RpcAddress) ProtoMessage()
- func (x *RpcAddress) ProtoReflect() protoreflect.Message
- func (x *RpcAddress) Reset()
- func (x *RpcAddress) String() string
- type RpcBlockHeight
- func (*RpcBlockHeight) Descriptor() ([]byte, []int)deprecated
- func (x *RpcBlockHeight) GetChainid() uint32
- func (x *RpcBlockHeight) GetHeight() uint64
- func (*RpcBlockHeight) ProtoMessage()
- func (x *RpcBlockHeight) ProtoReflect() protoreflect.Message
- func (x *RpcBlockHeight) Reset()
- func (x *RpcBlockHeight) String() string
- type RpcBlockTxsReq
- func (*RpcBlockTxsReq) Descriptor() ([]byte, []int)deprecated
- func (x *RpcBlockTxsReq) GetChainid() uint32
- func (x *RpcBlockTxsReq) GetHeight() uint64
- func (x *RpcBlockTxsReq) GetPage() int32
- func (x *RpcBlockTxsReq) GetSize() int32
- func (*RpcBlockTxsReq) ProtoMessage()
- func (x *RpcBlockTxsReq) ProtoReflect() protoreflect.Message
- func (x *RpcBlockTxsReq) Reset()
- func (x *RpcBlockTxsReq) String() string
- type RpcCashCheck
- func (*RpcCashCheck) Descriptor() ([]byte, []int)deprecated
- func (m *RpcCashCheck) FromCashCheck(vcc *models.CashCheck) error
- func (x *RpcCashCheck) GetAmount() string
- func (x *RpcCashCheck) GetChainid() uint32
- func (x *RpcCashCheck) GetCurrencyId() int32
- func (x *RpcCashCheck) GetExpireHeight() uint64
- func (x *RpcCashCheck) GetFrom() *RpcAddress
- func (x *RpcCashCheck) GetIsShard() bool
- func (x *RpcCashCheck) GetNonce() uint64
- func (x *RpcCashCheck) GetParentChain() uint32
- func (x *RpcCashCheck) GetTo() *RpcAddress
- func (x *RpcCashCheck) GetUselocal() bool
- func (*RpcCashCheck) ProtoMessage()
- func (x *RpcCashCheck) ProtoReflect() protoreflect.Message
- func (x *RpcCashCheck) Reset()
- func (x *RpcCashCheck) String() string
- func (m *RpcCashCheck) ToCashCheck() (*models.CashCheck, error)
- type RpcChainEpoch
- func (*RpcChainEpoch) Descriptor() ([]byte, []int)deprecated
- func (x *RpcChainEpoch) GetChainid() uint32
- func (x *RpcChainEpoch) GetEpoch() uint64
- func (*RpcChainEpoch) ProtoMessage()
- func (x *RpcChainEpoch) ProtoReflect() protoreflect.Message
- func (x *RpcChainEpoch) Reset()
- func (x *RpcChainEpoch) String() string
- type RpcChainInfoReq
- type RpcChainRequest
- type RpcMsgReq
- type RpcRRProofReq
- func (*RpcRRProofReq) Descriptor() ([]byte, []int)deprecated
- func (x *RpcRRProofReq) GetChainId() uint32
- func (x *RpcRRProofReq) GetNodeHash() []byte
- func (x *RpcRRProofReq) GetPub() []byte
- func (x *RpcRRProofReq) GetRootHash() []byte
- func (x *RpcRRProofReq) GetSig() []byte
- func (m *RpcRRProofReq) HashSerialize(w io.Writer) (int, error)
- func (m *RpcRRProofReq) HashValue() ([]byte, error)
- func (*RpcRRProofReq) ProtoMessage()
- func (x *RpcRRProofReq) ProtoReflect() protoreflect.Message
- func (x *RpcRRProofReq) Reset()
- func (x *RpcRRProofReq) String() string
- func (m *RpcRRProofReq) Verify() error
- type RpcRequest
- type RpcRespondStream
- func (*RpcRespondStream) Descriptor() ([]byte, []int)deprecated
- func (x *RpcRespondStream) GetCode() int32
- func (x *RpcRespondStream) GetMsg() string
- func (x *RpcRespondStream) GetStream() []byte
- func (*RpcRespondStream) ProtoMessage()
- func (x *RpcRespondStream) ProtoReflect() protoreflect.Message
- func (x *RpcRespondStream) Reset()
- func (x *RpcRespondStream) String() string
- type RpcResponse
- type RpcStatsReq
- type RpcTXHash
- type RpcTx
- func (*RpcTx) Descriptor() ([]byte, []int)deprecated
- func (x *RpcTx) GetChainid() uint32
- func (x *RpcTx) GetExtra() []byte
- func (x *RpcTx) GetFrom() *RpcAddress
- func (x *RpcTx) GetInput() []byte
- func (x *RpcTx) GetMultipubs() [][]byte
- func (x *RpcTx) GetMultisigs() [][]byte
- func (x *RpcTx) GetNonce() uint64
- func (x *RpcTx) GetPub() []byte
- func (x *RpcTx) GetSig() []byte
- func (x *RpcTx) GetTo() *RpcAddress
- func (x *RpcTx) GetUselocal() bool
- func (x *RpcTx) GetVal() string
- func (m *RpcTx) HashValue() ([]byte, error)
- func (m *RpcTx) PrintString() string
- func (*RpcTx) ProtoMessage()
- func (x *RpcTx) ProtoReflect() protoreflect.Message
- func (x *RpcTx) Reset()
- func (x *RpcTx) String() string
- func (m *RpcTx) ToTx() (*models.Transaction, error)
- type RpcTxList
- func (*RpcTxList) Descriptor() ([]byte, []int)deprecated
- func (x *RpcTxList) GetAddress() *RpcAddress
- func (x *RpcTxList) GetChainid() uint32
- func (x *RpcTxList) GetEndHeight() uint32
- func (x *RpcTxList) GetStartHeight() uint32
- func (*RpcTxList) ProtoMessage()
- func (x *RpcTxList) ProtoReflect() protoreflect.Message
- func (x *RpcTxList) Reset()
- func (x *RpcTxList) String() string
- type TransactionReceipt
- func (r *TransactionReceipt) FullReceipt(tx *models.Transaction, blockHeight common.Height, rpt *models.Receipt) *TransactionReceipt
- func (r *TransactionReceipt) PartReceipt(tx *models.Transaction, rpt *models.Receipt) *TransactionReceipt
- func (r *TransactionReceipt) Reset()
- func (r *TransactionReceipt) String() string
- func (r *TransactionReceipt) Successed() bool
- type UnimplementedNodeServer
- func (UnimplementedNodeServer) CallTransaction(context.Context, *RpcTx) (*RpcResponse, error)
- func (UnimplementedNodeServer) GetAccount(context.Context, *RpcAddress) (*RpcResponse, error)
- func (UnimplementedNodeServer) GetAccountWithChainHeight(context.Context, *RpcAddress) (*RpcResponse, error)
- func (UnimplementedNodeServer) GetBlock(context.Context, *RpcBlockHeight) (*RpcRespondStream, error)
- func (UnimplementedNodeServer) GetBlockHeader(context.Context, *RpcBlockHeight) (*RpcResponse, error)
- func (UnimplementedNodeServer) GetBlockHeaders(context.Context, *RpcBlockHeight) (*RpcResponse, error)
- func (UnimplementedNodeServer) GetBlockTxs(context.Context, *RpcBlockTxsReq) (*RpcResponse, error)
- func (UnimplementedNodeServer) GetCCCRelativeTx(context.Context, *RpcCashCheck) (*RpcResponse, error)
- func (UnimplementedNodeServer) GetChainInfo(context.Context, *RpcChainInfoReq) (*RpcResponse, error)
- func (UnimplementedNodeServer) GetCommittee(context.Context, *RpcChainEpoch) (*RpcResponse, error)
- func (UnimplementedNodeServer) GetRRCurrent(context.Context, *RpcChainRequest) (*RpcResponse, error)
- func (UnimplementedNodeServer) GetRRProofs(context.Context, *RpcRRProofReq) (*RpcResponse, error)
- func (UnimplementedNodeServer) GetStats(context.Context, *RpcStatsReq) (*RpcResponse, error)
- func (UnimplementedNodeServer) GetTransactionByHash(context.Context, *RpcTXHash) (*RpcResponse, error)
- func (UnimplementedNodeServer) GetTransactions(context.Context, *RpcTxList) (*RpcResponse, error)
- func (UnimplementedNodeServer) MakeCCCExistenceProof(context.Context, *RpcCashCheck) (*RpcResponse, error)
- func (UnimplementedNodeServer) MakeVccProof(context.Context, *RpcCashCheck) (*RpcResponse, error)
- func (UnimplementedNodeServer) Ping(context.Context, *RpcRequest) (*RpcResponse, error)
- func (UnimplementedNodeServer) SendBlock(context.Context, *RpcMsgReq) (*RpcResponse, error)
- func (UnimplementedNodeServer) SendTx(context.Context, *RpcTx) (*RpcResponse, error)
- func (UnimplementedNodeServer) TryCrypto(context.Context, *RpcMsgReq) (*RpcResponse, error)
- type UnsafeNodeServer
Constants ¶
const ( SuccessCode = 0 InvalidParamsCode = 4000 InvalidBCCode = 4001 InvalidProofCode = 4002 NilTransactionCode = 4003 NilBlockCode = 4004 InvalidFromAddressCode = 4005 InvalidSignatureCode = 4006 InvalidMultiSigsCode = 4007 ReservedFromAddrErrCode = 4008 CallProcessTxErrCode = 5000 GetChainDataErrCode = 5001 PostEventErrCode = 5002 MarshalErrCode = 5003 HashObjectErrCode = 5004 MarshalTextErrCode = 5005 ReadReceiptErrCode = 5006 VccProofErrCode = 5007 CCCExsitenceProofErrCode = 5008 GetCCCRelativeTxErrCode = 5009 GetDataFromDBErrCode = 5010 ToCashCheckErrCode = 5011 InvalidPublicKey = 5012 HeaderSummaryNotFound = 5013 GetRRProofErrCode = 5014 UnmarshalErrCode = 5015 OperationFailedCode = 5016 )
Variables ¶
var ( ErrInvalidParams = "Invalid params" ErrInvalidBlockChain = "Invalid blockchain" ErrInvalidProof = "Proof not exist in parent chain" ErrNilTransaction = "Transaction not found" ErrNilBlock = "Block not found" ErrCallProcessTx = "CallTransaction invalid transaction value" ErrGetChainData = "GetChainData Error" ErrPostEvent = "Put msg to queue error" ErrJsonMarshal = "Can't marshal struct to []byte" ErrHashObject = "HashObject error" ErrMarshalText = "MarshalText error" ErrReadReceipt = "ReadReceipt error" ErrVccProof = "Get Proof error" ErrCCCExsitenceProof = "CCCExsitenceProof error" ErrGetCCCRelativeTx = "GetCCCRelativeTx error" ErrGetDataFromDB = "Get data from db error" ErrToCashCheck = "ToCashCheck error" ErrInvalidPublicKey = "From address not match the public key" ErrHeaderNotFound = "summary not found" ErrReservedAddress = "From address reserved or not exist" ErrInvalidSignature = "invalid signature" ErrOperationFailed = "operation failed" ErrInvalidMultiSigs = "invalide multi sigs" RpcErrMsgMap = map[int32]string{ InvalidParamsCode: ErrInvalidParams, InvalidBCCode: ErrInvalidBlockChain, InvalidProofCode: ErrInvalidProof, NilTransactionCode: ErrNilTransaction, NilBlockCode: ErrNilBlock, CallProcessTxErrCode: ErrCallProcessTx, GetChainDataErrCode: ErrGetChainData, PostEventErrCode: ErrPostEvent, MarshalErrCode: ErrJsonMarshal, HashObjectErrCode: ErrHashObject, MarshalTextErrCode: ErrMarshalText, ReadReceiptErrCode: ErrReadReceipt, VccProofErrCode: ErrVccProof, CCCExsitenceProofErrCode: ErrCCCExsitenceProof, GetCCCRelativeTxErrCode: ErrGetCCCRelativeTx, GetDataFromDBErrCode: ErrGetDataFromDB, ToCashCheckErrCode: ErrToCashCheck, InvalidPublicKey: ErrInvalidPublicKey, HeaderSummaryNotFound: ErrHeaderNotFound, InvalidFromAddressCode: ErrReservedAddress, InvalidSignatureCode: ErrInvalidSignature, OperationFailedCode: ErrOperationFailed, InvalidMultiSigsCode: ErrInvalidMultiSigs, ReservedFromAddrErrCode: ErrReservedAddress, } )
var File_server_proto protoreflect.FileDescriptor
var Node_ServiceDesc = grpc.ServiceDesc{ ServiceName: "rpcserver.node", HandlerType: (*NodeServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Ping", Handler: _Node_Ping_Handler, }, { MethodName: "GetAccount", Handler: _Node_GetAccount_Handler, }, { MethodName: "GetTransactionByHash", Handler: _Node_GetTransactionByHash_Handler, }, { MethodName: "GetTransactions", Handler: _Node_GetTransactions_Handler, }, { MethodName: "SendTx", Handler: _Node_SendTx_Handler, }, { MethodName: "GetStats", Handler: _Node_GetStats_Handler, }, { MethodName: "GetBlockHeader", Handler: _Node_GetBlockHeader_Handler, }, { MethodName: "GetBlock", Handler: _Node_GetBlock_Handler, }, { MethodName: "GetBlockHeaders", Handler: _Node_GetBlockHeaders_Handler, }, { MethodName: "GetBlockTxs", Handler: _Node_GetBlockTxs_Handler, }, { MethodName: "CallTransaction", Handler: _Node_CallTransaction_Handler, }, { MethodName: "GetChainInfo", Handler: _Node_GetChainInfo_Handler, }, { MethodName: "GetCommittee", Handler: _Node_GetCommittee_Handler, }, { MethodName: "MakeVccProof", Handler: _Node_MakeVccProof_Handler, }, { MethodName: "MakeCCCExistenceProof", Handler: _Node_MakeCCCExistenceProof_Handler, }, { MethodName: "GetCCCRelativeTx", Handler: _Node_GetCCCRelativeTx_Handler, }, { MethodName: "GetAccountWithChainHeight", Handler: _Node_GetAccountWithChainHeight_Handler, }, { MethodName: "GetRRProofs", Handler: _Node_GetRRProofs_Handler, }, { MethodName: "GetRRCurrent", Handler: _Node_GetRRCurrent_Handler, }, { MethodName: "SendBlock", Handler: _Node_SendBlock_Handler, }, { MethodName: "TryCrypto", Handler: _Node_TryCrypto_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "server.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)
Functions ¶
func RegisterNodeServer ¶
func RegisterNodeServer(s grpc.ServiceRegistrar, srv NodeServer)
Types ¶
type AccountChange ¶
type AccountChange struct { ChainID common.ChainID `json:"chainid"` // Chain ID of from. When from is empty, it is the chain ID of delta. Height common.Height `json:"height"` // Block height of the chain in which the transaction is executed From *common.Address `json:"from"` // When the account change is delta, from is empty. Otherwise, it is the transfer out account address To *common.Address `json:"to"` // Transfer in account address Nonce uint64 `json:"nonce"` // Nonce when a transfer out account performs a transaction. This value is meaningless when the account changes to delta. Val *big.Int `json:"value"` // Account change amount Input hexutil.Bytes `json:"input"` // Transaction input information UseLocal bool `json:"uselocal"` // Is it a second currency transaction? False: base currency, true: second currency Extra hexutil.Bytes `json:"extra"` // It is currently used to save transaction types. If it does not exist, it is a normal transaction. Otherwise, it will correspond to special operations Version uint16 `json:"version"` // Version number used to distinguish different execution methods when the transaction execution is incompatible due to upgrade TimeStamp uint64 `json:"timestamp"` // The timestamp of the block in which it is located }
func (*AccountChange) String ¶
func (c *AccountChange) String() string
type AccountHeight ¶
type AccountHeight struct { Height common.Height `json:"height"` // Current height of chain Addr common.Address `json:"address"` // Address of account Nonce uint64 `json:"nonce"` // Nonce of account Balance *big.Int `json:"balance"` // Base currency,can't be nil LocalCurrency *big.Int `json:"localCurrency"` // Second currency(if exists),could be nil StorageRoot []byte `json:"storageRoot"` // Storage root of contract,Trie(key: Hash, value: Hash) CodeHash []byte `json:"codeHash"` // Hash of contract code LongStorageRoot []byte `json:"longStorageRoot"` // System contracts are used to hold more flexible data structures, Trie(key: Hash, value: []byte) Code []byte `json:"code"` }
type AccountWithCode ¶
type AccountWithCode struct { Addr common.Address `json:"address"` // Address of account Nonce uint64 `json:"nonce"` // Nonce of account Balance *big.Int `json:"balance"` // Base currency,can't be nil LocalCurrency *big.Int `json:"localCurrency"` // Second currency(if exists),could be nil StorageRoot []byte `json:"storageRoot"` // Storage root of contract,Trie(key: Hash, value: Hash) CodeHash []byte `json:"codeHash"` // Hash of contract code LongStorageRoot []byte `json:"longStorageRoot"` // System contracts are used to hold more flexible data structures, Trie(key: Hash, value: []byte) Code []byte `json:"code"` }
type BlockInfo ¶
type BlockInfo struct { Hash common.Hash `json:"hash"` // Big hash, that is, big hash PreviousHash common.Hash `json:"previoushash"` // Hash of last block ChainID common.ChainID `json:"chainid"` // Current chain ID Height common.Height `json:"height"` // Block height Empty bool `json:"empty"` // Whether it is an empty block, that is, whether it is a skipped block RewardAddress common.Address `json:"rewardaddress"` // The reward address bound to the packing node (it can be any value, and the basis for issuing rewards is in the reward chain pledge contract, not depending on this value) MergedDeltaRoot *common.Hash `json:"mergeroot"` // Root hash of delta merged from other partitions BalanceDeltaRoot *common.Hash `json:"deltaroot"` // The root hash of the delta tree generated by the current block transaction of the current partition needs to be sent to other partitions StateRoot common.Hash `json:"stateroot"` // Hash root of the chain account RREra *common.EraNum `json:"rrera"` // Charging cycle of current block (main chain and reward chain) RRCurrent *common.Hash `json:"rrcurrent"` // Pledge tree root hash (main chain and reward chain) when the current block is located RRNext *common.Hash `json:"rrnext"` // Pledge tree root hash (main chain and reward chain) in the next billing cycle TxCount int `json:"txcount"` // Transaction count in block TimeStamp uint64 `json:"timestamp"` // The time stamp of Proposer proposal can not be used as a basis }
type BlockMessage ¶
type BlockMessage struct { Elections []*models.ElectMessage `json:"elections"` // start election msg AccountChanges []*AccountChange `json:"accountchanges"` // transaction }
func (*BlockMessage) String ¶
func (m *BlockMessage) String() string
type CashedCheckExistence ¶
type ChainInfo ¶
type ChainInfo struct { ChainId common.ChainID `json:"chainId"` // Chain ID Mode common.ChainMode `json:"mode"` // Root?Branch?Shard? ParentId common.ChainID `json:"parent"` // Parent chain DataNodes []DataNodeInfo `json:"datanodes"` // Data node list }
information of a chain
type DataNodeInfo ¶
type NodeClient ¶
type NodeClient interface { Ping(ctx context.Context, in *RpcRequest, opts ...grpc.CallOption) (*RpcResponse, error) GetAccount(ctx context.Context, in *RpcAddress, opts ...grpc.CallOption) (*RpcResponse, error) GetTransactionByHash(ctx context.Context, in *RpcTXHash, opts ...grpc.CallOption) (*RpcResponse, error) GetTransactions(ctx context.Context, in *RpcTxList, opts ...grpc.CallOption) (*RpcResponse, error) SendTx(ctx context.Context, in *RpcTx, opts ...grpc.CallOption) (*RpcResponse, error) GetStats(ctx context.Context, in *RpcStatsReq, opts ...grpc.CallOption) (*RpcResponse, error) GetBlockHeader(ctx context.Context, in *RpcBlockHeight, opts ...grpc.CallOption) (*RpcResponse, error) GetBlock(ctx context.Context, in *RpcBlockHeight, opts ...grpc.CallOption) (*RpcRespondStream, error) GetBlockHeaders(ctx context.Context, in *RpcBlockHeight, opts ...grpc.CallOption) (*RpcResponse, error) GetBlockTxs(ctx context.Context, in *RpcBlockTxsReq, opts ...grpc.CallOption) (*RpcResponse, error) CallTransaction(ctx context.Context, in *RpcTx, opts ...grpc.CallOption) (*RpcResponse, error) GetChainInfo(ctx context.Context, in *RpcChainInfoReq, opts ...grpc.CallOption) (*RpcResponse, error) GetCommittee(ctx context.Context, in *RpcChainEpoch, opts ...grpc.CallOption) (*RpcResponse, error) MakeVccProof(ctx context.Context, in *RpcCashCheck, opts ...grpc.CallOption) (*RpcResponse, error) MakeCCCExistenceProof(ctx context.Context, in *RpcCashCheck, opts ...grpc.CallOption) (*RpcResponse, error) GetCCCRelativeTx(ctx context.Context, in *RpcCashCheck, opts ...grpc.CallOption) (*RpcResponse, error) GetAccountWithChainHeight(ctx context.Context, in *RpcAddress, opts ...grpc.CallOption) (*RpcResponse, error) GetRRProofs(ctx context.Context, in *RpcRRProofReq, opts ...grpc.CallOption) (*RpcResponse, error) GetRRCurrent(ctx context.Context, in *RpcChainRequest, opts ...grpc.CallOption) (*RpcResponse, error) SendBlock(ctx context.Context, in *RpcMsgReq, opts ...grpc.CallOption) (*RpcResponse, error) TryCrypto(ctx context.Context, in *RpcMsgReq, opts ...grpc.CallOption) (*RpcResponse, 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 NodeInfo ¶
type NodeInfo struct { NodeId common.NodeID `json:"nodeId"` Version string `json:"version"` IsDataNode bool `json:"isDataNode"` DataNodeOf common.ChainID `json:"dataNodeOf"` LastMsgTime int64 `json:"lastMsgTime"` LastEventTime int64 `json:"lastEventTime"` LastBlockTime int64 `json:"lastBlockTime"` Overflow bool `json:"overflow"` LastBlocks map[common.ChainID]common.Height `json:"lastBlocks"` OpTypes map[common.ChainID][]string `json:"opTypes"` }
type NodeServer ¶
type NodeServer interface { Ping(context.Context, *RpcRequest) (*RpcResponse, error) GetAccount(context.Context, *RpcAddress) (*RpcResponse, error) GetTransactionByHash(context.Context, *RpcTXHash) (*RpcResponse, error) GetTransactions(context.Context, *RpcTxList) (*RpcResponse, error) SendTx(context.Context, *RpcTx) (*RpcResponse, error) GetStats(context.Context, *RpcStatsReq) (*RpcResponse, error) GetBlockHeader(context.Context, *RpcBlockHeight) (*RpcResponse, error) GetBlock(context.Context, *RpcBlockHeight) (*RpcRespondStream, error) GetBlockHeaders(context.Context, *RpcBlockHeight) (*RpcResponse, error) GetBlockTxs(context.Context, *RpcBlockTxsReq) (*RpcResponse, error) CallTransaction(context.Context, *RpcTx) (*RpcResponse, error) GetChainInfo(context.Context, *RpcChainInfoReq) (*RpcResponse, error) GetCommittee(context.Context, *RpcChainEpoch) (*RpcResponse, error) MakeVccProof(context.Context, *RpcCashCheck) (*RpcResponse, error) MakeCCCExistenceProof(context.Context, *RpcCashCheck) (*RpcResponse, error) GetCCCRelativeTx(context.Context, *RpcCashCheck) (*RpcResponse, error) GetAccountWithChainHeight(context.Context, *RpcAddress) (*RpcResponse, error) GetRRProofs(context.Context, *RpcRRProofReq) (*RpcResponse, error) GetRRCurrent(context.Context, *RpcChainRequest) (*RpcResponse, error) SendBlock(context.Context, *RpcMsgReq) (*RpcResponse, error) TryCrypto(context.Context, *RpcMsgReq) (*RpcResponse, error) // contains filtered or unexported methods }
NodeServer is the server API for Node service. All implementations must embed UnimplementedNodeServer for forward compatibility
type RPCServer ¶
type RPCServer struct { common.AbstractService UnimplementedNodeServer // contains filtered or unexported fields }
func NewRPCServer ¶
func NewRPCServer(local common.Endpoint, nmanager models.NetworkManager, dmanager models.DataManager, engine models.Engine, eventer models.Eventer) (*RPCServer, error)
func (*RPCServer) CallTransaction ¶
CallTransaction return resp.data as TransactionReceipt in JSON format
func (*RPCServer) GetAccount ¶
func (s *RPCServer) GetAccount(ctx context.Context, addr *RpcAddress) (*RpcResponse, error)
GetAccount return resp.data as models.Account in JSON format
func (*RPCServer) GetAccountWithChainHeight ¶
func (s *RPCServer) GetAccountWithChainHeight(ctx context.Context, addr *RpcAddress) (*RpcResponse, error)
GetAccountWithChainHeight Get account information and current chain height
func (*RPCServer) GetBlock ¶
func (s *RPCServer) GetBlock(ctx context.Context, req *RpcBlockHeight) (*RpcRespondStream, error)
Returns the serialized bytes of block data of the specified height (not JSON)
func (*RPCServer) GetBlockHeader ¶
func (s *RPCServer) GetBlockHeader(ctx context.Context, req *RpcBlockHeight) (*RpcResponse, error)
func (*RPCServer) GetBlockHeaders ¶
func (s *RPCServer) GetBlockHeaders(ctx context.Context, req *RpcBlockHeight) (*RpcResponse, error)
Returns the sub chain block header information (block hash, Chain ID, block height) contained in the specified block
func (*RPCServer) GetBlockTxs ¶
func (s *RPCServer) GetBlockTxs(ctx context.Context, req *RpcBlockTxsReq) (*RpcResponse, error)
Returns multiple transactions in the specified location (page+size) of the specified block (chainid+height), and the return value is []*ElectMessage+[]*AccountChange
func (*RPCServer) GetCCCRelativeTx ¶
func (s *RPCServer) GetCCCRelativeTx(ctx context.Context, req *RpcCashCheck) (*RpcResponse, error)
GetCCCRelativeTx Get the hash of the transaction of the check cashed
func (*RPCServer) GetChainInfo ¶
func (s *RPCServer) GetChainInfo(ctx context.Context, req *RpcChainInfoReq) (*RpcResponse, error)
GetChainInfo Returns the chain information of the specified chain ID, which can be multiple. Return all when not specified
func (*RPCServer) GetCommittee ¶
func (s *RPCServer) GetCommittee(ctx context.Context, req *RpcChainEpoch) (*RpcResponse, error)
GetCommittee Get the nodeid list of consensus committee members of the specified epoch of the specified chain
func (*RPCServer) GetRRCurrent ¶
func (s *RPCServer) GetRRCurrent(ctx context.Context, req *RpcChainRequest) (*RpcResponse, error)
func (*RPCServer) GetRRProofs ¶
func (s *RPCServer) GetRRProofs(ctx context.Context, req *RpcRRProofReq) (*RpcResponse, error)
GetRRProofs Get the proof of node pledge at the specified era (a specified root of required reserver tree)
func (*RPCServer) GetStats ¶
func (s *RPCServer) GetStats(ctx context.Context, req *RpcStatsReq) (*RpcResponse, error)
func (*RPCServer) GetTransactionByHash ¶
GetTransactionByHash return resp.data as TransactionReceipt in JSON format
func (*RPCServer) GetTransactions ¶
GetTransactions return resp.data as []models.Transaction in JSON format
func (*RPCServer) Initializer ¶
func (*RPCServer) MakeCCCExistenceProof ¶
func (s *RPCServer) MakeCCCExistenceProof(ctx context.Context, req *RpcCashCheck) (*RpcResponse, error)
MakeCCCExistenceProof Generate the proof of non-payment to be used for revoking the check
func (*RPCServer) MakeVccProof ¶
func (s *RPCServer) MakeVccProof(ctx context.Context, req *RpcCashCheck) (*RpcResponse, error)
MakeVccProof Get the information needed for cashing the check, serialized (not JSON)
func (*RPCServer) Ping ¶
func (s *RPCServer) Ping(ctx context.Context, req *RpcRequest) (*RpcResponse, error)
func (*RPCServer) TryCrypto ¶
TryCrypto req.Type Bitwise operation:
If TCVerify exists, the input Msg must be: Signature+Hash+PublicKey, if the verification is successful, return success, otherwise the verification fails
If TCGenerateKey exists, generate a key pair and put it in the corresponding attribute of the return value
If TCHash exists, all (without pre-private key) or part (with pre-private key) in req.Msg are the data to be hashed, and put the corresponding attribute of the return value after the hash.
If TCSign exists, if there is no TCGenerateKey exists, the first N bytes of req.Msg are the private key. If there is TCHash, then the private key is followed by the data to be hashed, otherwise the hash value is calculated as required. The return value is put into the corresponding attribute.
type RpcAddress ¶
type RpcAddress struct { Chainid uint32 `protobuf:"varint,1,opt,name=chainid,proto3" json:"chainid,omitempty"` Address []byte `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // contains filtered or unexported fields }
func (*RpcAddress) Descriptor
deprecated
func (*RpcAddress) Descriptor() ([]byte, []int)
Deprecated: Use RpcAddress.ProtoReflect.Descriptor instead.
func (*RpcAddress) GetAddress ¶
func (x *RpcAddress) GetAddress() []byte
func (*RpcAddress) GetChainid ¶
func (x *RpcAddress) GetChainid() uint32
func (*RpcAddress) MarshalJSON ¶
func (m *RpcAddress) MarshalJSON() ([]byte, error)
func (*RpcAddress) PrintString ¶
func (m *RpcAddress) PrintString() string
func (*RpcAddress) ProtoMessage ¶
func (*RpcAddress) ProtoMessage()
func (*RpcAddress) ProtoReflect ¶
func (x *RpcAddress) ProtoReflect() protoreflect.Message
func (*RpcAddress) Reset ¶
func (x *RpcAddress) Reset()
func (*RpcAddress) String ¶
func (x *RpcAddress) String() string
type RpcBlockHeight ¶
type RpcBlockHeight struct { Chainid uint32 `protobuf:"varint,1,opt,name=chainid,proto3" json:"chainid,omitempty"` Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` // contains filtered or unexported fields }
func (*RpcBlockHeight) Descriptor
deprecated
func (*RpcBlockHeight) Descriptor() ([]byte, []int)
Deprecated: Use RpcBlockHeight.ProtoReflect.Descriptor instead.
func (*RpcBlockHeight) GetChainid ¶
func (x *RpcBlockHeight) GetChainid() uint32
func (*RpcBlockHeight) GetHeight ¶
func (x *RpcBlockHeight) GetHeight() uint64
func (*RpcBlockHeight) ProtoMessage ¶
func (*RpcBlockHeight) ProtoMessage()
func (*RpcBlockHeight) ProtoReflect ¶
func (x *RpcBlockHeight) ProtoReflect() protoreflect.Message
func (*RpcBlockHeight) Reset ¶
func (x *RpcBlockHeight) Reset()
func (*RpcBlockHeight) String ¶
func (x *RpcBlockHeight) String() string
type RpcBlockTxsReq ¶
type RpcBlockTxsReq struct { Chainid uint32 `protobuf:"varint,1,opt,name=chainid,proto3" json:"chainid,omitempty"` Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"` Size int32 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` // contains filtered or unexported fields }
func (*RpcBlockTxsReq) Descriptor
deprecated
func (*RpcBlockTxsReq) Descriptor() ([]byte, []int)
Deprecated: Use RpcBlockTxsReq.ProtoReflect.Descriptor instead.
func (*RpcBlockTxsReq) GetChainid ¶
func (x *RpcBlockTxsReq) GetChainid() uint32
func (*RpcBlockTxsReq) GetHeight ¶
func (x *RpcBlockTxsReq) GetHeight() uint64
func (*RpcBlockTxsReq) GetPage ¶
func (x *RpcBlockTxsReq) GetPage() int32
func (*RpcBlockTxsReq) GetSize ¶
func (x *RpcBlockTxsReq) GetSize() int32
func (*RpcBlockTxsReq) ProtoMessage ¶
func (*RpcBlockTxsReq) ProtoMessage()
func (*RpcBlockTxsReq) ProtoReflect ¶
func (x *RpcBlockTxsReq) ProtoReflect() protoreflect.Message
func (*RpcBlockTxsReq) Reset ¶
func (x *RpcBlockTxsReq) Reset()
func (*RpcBlockTxsReq) String ¶
func (x *RpcBlockTxsReq) String() string
type RpcCashCheck ¶
type RpcCashCheck struct { Chainid uint32 `protobuf:"varint,1,opt,name=chainid,proto3" json:"chainid,omitempty"` From *RpcAddress `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` To *RpcAddress `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` Nonce uint64 `protobuf:"varint,4,opt,name=nonce,proto3" json:"nonce,omitempty"` ExpireHeight uint64 `protobuf:"varint,5,opt,name=expireHeight,proto3" json:"expireHeight,omitempty"` Amount string `protobuf:"bytes,6,opt,name=amount,proto3" json:"amount,omitempty"` Uselocal bool `protobuf:"varint,7,opt,name=uselocal,proto3" json:"uselocal,omitempty"` ParentChain uint32 `protobuf:"varint,8,opt,name=parentChain,proto3" json:"parentChain,omitempty"` IsShard bool `protobuf:"varint,9,opt,name=isShard,proto3" json:"isShard,omitempty"` CurrencyId int32 `protobuf:"varint,10,opt,name=currencyId,proto3" json:"currencyId,omitempty"` // contains filtered or unexported fields }
func (*RpcCashCheck) Descriptor
deprecated
func (*RpcCashCheck) Descriptor() ([]byte, []int)
Deprecated: Use RpcCashCheck.ProtoReflect.Descriptor instead.
func (*RpcCashCheck) FromCashCheck ¶
func (m *RpcCashCheck) FromCashCheck(vcc *models.CashCheck) error
func (*RpcCashCheck) GetAmount ¶
func (x *RpcCashCheck) GetAmount() string
func (*RpcCashCheck) GetChainid ¶
func (x *RpcCashCheck) GetChainid() uint32
func (*RpcCashCheck) GetCurrencyId ¶
func (x *RpcCashCheck) GetCurrencyId() int32
func (*RpcCashCheck) GetExpireHeight ¶
func (x *RpcCashCheck) GetExpireHeight() uint64
func (*RpcCashCheck) GetFrom ¶
func (x *RpcCashCheck) GetFrom() *RpcAddress
func (*RpcCashCheck) GetIsShard ¶
func (x *RpcCashCheck) GetIsShard() bool
func (*RpcCashCheck) GetNonce ¶
func (x *RpcCashCheck) GetNonce() uint64
func (*RpcCashCheck) GetParentChain ¶
func (x *RpcCashCheck) GetParentChain() uint32
func (*RpcCashCheck) GetTo ¶
func (x *RpcCashCheck) GetTo() *RpcAddress
func (*RpcCashCheck) GetUselocal ¶
func (x *RpcCashCheck) GetUselocal() bool
func (*RpcCashCheck) ProtoMessage ¶
func (*RpcCashCheck) ProtoMessage()
func (*RpcCashCheck) ProtoReflect ¶
func (x *RpcCashCheck) ProtoReflect() protoreflect.Message
func (*RpcCashCheck) Reset ¶
func (x *RpcCashCheck) Reset()
func (*RpcCashCheck) String ¶
func (x *RpcCashCheck) String() string
func (*RpcCashCheck) ToCashCheck ¶
func (m *RpcCashCheck) ToCashCheck() (*models.CashCheck, error)
type RpcChainEpoch ¶
type RpcChainEpoch struct { Chainid uint32 `protobuf:"varint,1,opt,name=chainid,proto3" json:"chainid,omitempty"` Epoch uint64 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"` // contains filtered or unexported fields }
func (*RpcChainEpoch) Descriptor
deprecated
func (*RpcChainEpoch) Descriptor() ([]byte, []int)
Deprecated: Use RpcChainEpoch.ProtoReflect.Descriptor instead.
func (*RpcChainEpoch) GetChainid ¶
func (x *RpcChainEpoch) GetChainid() uint32
func (*RpcChainEpoch) GetEpoch ¶
func (x *RpcChainEpoch) GetEpoch() uint64
func (*RpcChainEpoch) ProtoMessage ¶
func (*RpcChainEpoch) ProtoMessage()
func (*RpcChainEpoch) ProtoReflect ¶
func (x *RpcChainEpoch) ProtoReflect() protoreflect.Message
func (*RpcChainEpoch) Reset ¶
func (x *RpcChainEpoch) Reset()
func (*RpcChainEpoch) String ¶
func (x *RpcChainEpoch) String() string
type RpcChainInfoReq ¶
type RpcChainInfoReq struct { Chainid []uint32 `protobuf:"varint,1,rep,packed,name=chainid,proto3" json:"chainid,omitempty"` // contains filtered or unexported fields }
func (*RpcChainInfoReq) Descriptor
deprecated
func (*RpcChainInfoReq) Descriptor() ([]byte, []int)
Deprecated: Use RpcChainInfoReq.ProtoReflect.Descriptor instead.
func (*RpcChainInfoReq) GetChainid ¶
func (x *RpcChainInfoReq) GetChainid() []uint32
func (*RpcChainInfoReq) ProtoMessage ¶
func (*RpcChainInfoReq) ProtoMessage()
func (*RpcChainInfoReq) ProtoReflect ¶
func (x *RpcChainInfoReq) ProtoReflect() protoreflect.Message
func (*RpcChainInfoReq) Reset ¶
func (x *RpcChainInfoReq) Reset()
func (*RpcChainInfoReq) String ¶
func (x *RpcChainInfoReq) String() string
type RpcChainRequest ¶
type RpcChainRequest struct { Chainid uint32 `protobuf:"varint,1,opt,name=chainid,proto3" json:"chainid,omitempty"` // contains filtered or unexported fields }
func (*RpcChainRequest) Descriptor
deprecated
func (*RpcChainRequest) Descriptor() ([]byte, []int)
Deprecated: Use RpcChainRequest.ProtoReflect.Descriptor instead.
func (*RpcChainRequest) GetChainid ¶
func (x *RpcChainRequest) GetChainid() uint32
func (*RpcChainRequest) ProtoMessage ¶
func (*RpcChainRequest) ProtoMessage()
func (*RpcChainRequest) ProtoReflect ¶
func (x *RpcChainRequest) ProtoReflect() protoreflect.Message
func (*RpcChainRequest) Reset ¶
func (x *RpcChainRequest) Reset()
func (*RpcChainRequest) String ¶
func (x *RpcChainRequest) String() string
type RpcMsgReq ¶
type RpcMsgReq struct { Type uint32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` Msg []byte `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` // contains filtered or unexported fields }
func (*RpcMsgReq) Descriptor
deprecated
func (*RpcMsgReq) ProtoMessage ¶
func (*RpcMsgReq) ProtoMessage()
func (*RpcMsgReq) ProtoReflect ¶
func (x *RpcMsgReq) ProtoReflect() protoreflect.Message
type RpcRRProofReq ¶
type RpcRRProofReq struct { ChainId uint32 `protobuf:"varint,1,opt,name=chainId,proto3" json:"chainId,omitempty"` RootHash []byte `protobuf:"bytes,3,opt,name=rootHash,proto3" json:"rootHash,omitempty"` NodeHash []byte `protobuf:"bytes,4,opt,name=nodeHash,proto3" json:"nodeHash,omitempty"` Pub []byte `protobuf:"bytes,5,opt,name=pub,proto3" json:"pub,omitempty"` Sig []byte `protobuf:"bytes,6,opt,name=sig,proto3" json:"sig,omitempty"` // contains filtered or unexported fields }
func (*RpcRRProofReq) Descriptor
deprecated
func (*RpcRRProofReq) Descriptor() ([]byte, []int)
Deprecated: Use RpcRRProofReq.ProtoReflect.Descriptor instead.
func (*RpcRRProofReq) GetChainId ¶
func (x *RpcRRProofReq) GetChainId() uint32
func (*RpcRRProofReq) GetNodeHash ¶
func (x *RpcRRProofReq) GetNodeHash() []byte
func (*RpcRRProofReq) GetPub ¶
func (x *RpcRRProofReq) GetPub() []byte
func (*RpcRRProofReq) GetRootHash ¶
func (x *RpcRRProofReq) GetRootHash() []byte
func (*RpcRRProofReq) GetSig ¶
func (x *RpcRRProofReq) GetSig() []byte
func (*RpcRRProofReq) HashSerialize ¶
func (m *RpcRRProofReq) HashSerialize(w io.Writer) (int, error)
func (*RpcRRProofReq) HashValue ¶
func (m *RpcRRProofReq) HashValue() ([]byte, error)
func (*RpcRRProofReq) ProtoMessage ¶
func (*RpcRRProofReq) ProtoMessage()
func (*RpcRRProofReq) ProtoReflect ¶
func (x *RpcRRProofReq) ProtoReflect() protoreflect.Message
func (*RpcRRProofReq) Reset ¶
func (x *RpcRRProofReq) Reset()
func (*RpcRRProofReq) String ¶
func (x *RpcRRProofReq) String() string
func (*RpcRRProofReq) Verify ¶
func (m *RpcRRProofReq) Verify() error
type RpcRequest ¶
type RpcRequest struct { Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*RpcRequest) Descriptor
deprecated
func (*RpcRequest) Descriptor() ([]byte, []int)
Deprecated: Use RpcRequest.ProtoReflect.Descriptor instead.
func (*RpcRequest) GetData ¶
func (x *RpcRequest) GetData() string
func (*RpcRequest) ProtoMessage ¶
func (*RpcRequest) ProtoMessage()
func (*RpcRequest) ProtoReflect ¶
func (x *RpcRequest) ProtoReflect() protoreflect.Message
func (*RpcRequest) Reset ¶
func (x *RpcRequest) Reset()
func (*RpcRequest) String ¶
func (x *RpcRequest) String() string
type RpcRespondStream ¶
type RpcRespondStream struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` Stream []byte `protobuf:"bytes,3,opt,name=stream,proto3" json:"stream,omitempty"` // contains filtered or unexported fields }
func (*RpcRespondStream) Descriptor
deprecated
func (*RpcRespondStream) Descriptor() ([]byte, []int)
Deprecated: Use RpcRespondStream.ProtoReflect.Descriptor instead.
func (*RpcRespondStream) GetCode ¶
func (x *RpcRespondStream) GetCode() int32
func (*RpcRespondStream) GetMsg ¶
func (x *RpcRespondStream) GetMsg() string
func (*RpcRespondStream) GetStream ¶
func (x *RpcRespondStream) GetStream() []byte
func (*RpcRespondStream) ProtoMessage ¶
func (*RpcRespondStream) ProtoMessage()
func (*RpcRespondStream) ProtoReflect ¶
func (x *RpcRespondStream) ProtoReflect() protoreflect.Message
func (*RpcRespondStream) Reset ¶
func (x *RpcRespondStream) Reset()
func (*RpcRespondStream) String ¶
func (x *RpcRespondStream) String() string
type RpcResponse ¶
type RpcResponse struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*RpcResponse) Descriptor
deprecated
func (*RpcResponse) Descriptor() ([]byte, []int)
Deprecated: Use RpcResponse.ProtoReflect.Descriptor instead.
func (*RpcResponse) GetCode ¶
func (x *RpcResponse) GetCode() int32
func (*RpcResponse) GetData ¶
func (x *RpcResponse) GetData() string
func (*RpcResponse) ProtoMessage ¶
func (*RpcResponse) ProtoMessage()
func (*RpcResponse) ProtoReflect ¶
func (x *RpcResponse) ProtoReflect() protoreflect.Message
func (*RpcResponse) Reset ¶
func (x *RpcResponse) Reset()
func (*RpcResponse) String ¶
func (x *RpcResponse) String() string
type RpcStatsReq ¶
type RpcStatsReq struct { Chainid uint32 `protobuf:"varint,1,opt,name=chainid,proto3" json:"chainid,omitempty"` // contains filtered or unexported fields }
func (*RpcStatsReq) Descriptor
deprecated
func (*RpcStatsReq) Descriptor() ([]byte, []int)
Deprecated: Use RpcStatsReq.ProtoReflect.Descriptor instead.
func (*RpcStatsReq) GetChainid ¶
func (x *RpcStatsReq) GetChainid() uint32
func (*RpcStatsReq) ProtoMessage ¶
func (*RpcStatsReq) ProtoMessage()
func (*RpcStatsReq) ProtoReflect ¶
func (x *RpcStatsReq) ProtoReflect() protoreflect.Message
func (*RpcStatsReq) Reset ¶
func (x *RpcStatsReq) Reset()
func (*RpcStatsReq) String ¶
func (x *RpcStatsReq) String() string
type RpcTXHash ¶
type RpcTXHash struct { Chainid uint32 `protobuf:"varint,1,opt,name=chainid,proto3" json:"chainid,omitempty"` Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` // contains filtered or unexported fields }
func (*RpcTXHash) Descriptor
deprecated
func (*RpcTXHash) GetChainid ¶
func (*RpcTXHash) ProtoMessage ¶
func (*RpcTXHash) ProtoMessage()
func (*RpcTXHash) ProtoReflect ¶
func (x *RpcTXHash) ProtoReflect() protoreflect.Message
type RpcTx ¶
type RpcTx struct { Chainid uint32 `protobuf:"varint,1,opt,name=chainid,proto3" json:"chainid,omitempty"` From *RpcAddress `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` To *RpcAddress `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` Nonce uint64 `protobuf:"varint,4,opt,name=nonce,proto3" json:"nonce,omitempty"` Val string `protobuf:"bytes,5,opt,name=val,proto3" json:"val,omitempty"` Input []byte `protobuf:"bytes,6,opt,name=input,proto3" json:"input,omitempty"` Pub []byte `protobuf:"bytes,7,opt,name=pub,proto3" json:"pub,omitempty"` Sig []byte `protobuf:"bytes,8,opt,name=sig,proto3" json:"sig,omitempty"` Uselocal bool `protobuf:"varint,9,opt,name=uselocal,proto3" json:"uselocal,omitempty"` Extra []byte `protobuf:"bytes,10,opt,name=extra,proto3" json:"extra,omitempty"` Multipubs [][]byte `protobuf:"bytes,11,rep,name=multipubs,proto3" json:"multipubs,omitempty"` Multisigs [][]byte `protobuf:"bytes,12,rep,name=multisigs,proto3" json:"multisigs,omitempty"` // contains filtered or unexported fields }
func (*RpcTx) Descriptor
deprecated
func (*RpcTx) GetChainid ¶
func (*RpcTx) GetFrom ¶
func (x *RpcTx) GetFrom() *RpcAddress
func (*RpcTx) GetMultipubs ¶
func (*RpcTx) GetMultisigs ¶
func (*RpcTx) GetTo ¶
func (x *RpcTx) GetTo() *RpcAddress
func (*RpcTx) GetUselocal ¶
func (*RpcTx) PrintString ¶
func (*RpcTx) ProtoMessage ¶
func (*RpcTx) ProtoMessage()
func (*RpcTx) ProtoReflect ¶
func (x *RpcTx) ProtoReflect() protoreflect.Message
type RpcTxList ¶
type RpcTxList struct { Chainid uint32 `protobuf:"varint,1,opt,name=chainid,proto3" json:"chainid,omitempty"` Address *RpcAddress `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` StartHeight uint32 `protobuf:"varint,3,opt,name=startHeight,proto3" json:"startHeight,omitempty"` // include EndHeight uint32 `protobuf:"varint,4,opt,name=endHeight,proto3" json:"endHeight,omitempty"` // exclude // contains filtered or unexported fields }
func (*RpcTxList) Descriptor
deprecated
func (*RpcTxList) GetAddress ¶
func (x *RpcTxList) GetAddress() *RpcAddress
func (*RpcTxList) GetChainid ¶
func (*RpcTxList) GetEndHeight ¶
func (*RpcTxList) GetStartHeight ¶
func (*RpcTxList) ProtoMessage ¶
func (*RpcTxList) ProtoMessage()
func (*RpcTxList) ProtoReflect ¶
func (x *RpcTxList) ProtoReflect() protoreflect.Message
type TransactionReceipt ¶
type TransactionReceipt struct { Transaction *models.Transaction `json:"tx"` // Transaction data object PostState []byte `json:"root"` // It is used to record the information of transaction execution in JSON format, such as gas, cost "gas", and world state "root" after execution. Status uint64 `json:"status"` // Transaction execution status, 0: failed, 1: successful. (refers to whether the execution is abnormal) Logs []*models.Log `json:"logs" gencodec:"required"` // The log written by the contract during execution TxHash common.Hash `json:"transactionHash" gencodec:"required"` // Transaction Hash ContractAddress common.Address `json:"contractAddress"` // If you are creating a contract, save the address of the created contract here Out hexutil.Bytes `json:"out"` // Return value of contract execution Height common.Height `json:"blockHeight"` // The block where the transaction is packaged is high and will not be returned when calling GasUsed uint64 `json:"gasUsed"` // The gas value consumed by transaction execution is not returned in call GasFee string `json:"gasFee"` // The gas cost of transaction execution is not returned in call PostRoot []byte `json:"postroot"` // World state root after transaction execution (never return, always empty) Error string `json:"errorMsg"` // Error message in case of transaction execution failure }
func (*TransactionReceipt) FullReceipt ¶
func (r *TransactionReceipt) FullReceipt(tx *models.Transaction, blockHeight common.Height, rpt *models.Receipt) *TransactionReceipt
func (*TransactionReceipt) PartReceipt ¶
func (r *TransactionReceipt) PartReceipt(tx *models.Transaction, rpt *models.Receipt) *TransactionReceipt
func (*TransactionReceipt) Reset ¶
func (r *TransactionReceipt) Reset()
func (*TransactionReceipt) String ¶
func (r *TransactionReceipt) String() string
func (*TransactionReceipt) Successed ¶
func (r *TransactionReceipt) Successed() bool
type UnimplementedNodeServer ¶
type UnimplementedNodeServer struct { }
UnimplementedNodeServer must be embedded to have forward compatible implementations.
func (UnimplementedNodeServer) CallTransaction ¶
func (UnimplementedNodeServer) CallTransaction(context.Context, *RpcTx) (*RpcResponse, error)
func (UnimplementedNodeServer) GetAccount ¶
func (UnimplementedNodeServer) GetAccount(context.Context, *RpcAddress) (*RpcResponse, error)
func (UnimplementedNodeServer) GetAccountWithChainHeight ¶
func (UnimplementedNodeServer) GetAccountWithChainHeight(context.Context, *RpcAddress) (*RpcResponse, error)
func (UnimplementedNodeServer) GetBlock ¶
func (UnimplementedNodeServer) GetBlock(context.Context, *RpcBlockHeight) (*RpcRespondStream, error)
func (UnimplementedNodeServer) GetBlockHeader ¶
func (UnimplementedNodeServer) GetBlockHeader(context.Context, *RpcBlockHeight) (*RpcResponse, error)
func (UnimplementedNodeServer) GetBlockHeaders ¶
func (UnimplementedNodeServer) GetBlockHeaders(context.Context, *RpcBlockHeight) (*RpcResponse, error)
func (UnimplementedNodeServer) GetBlockTxs ¶
func (UnimplementedNodeServer) GetBlockTxs(context.Context, *RpcBlockTxsReq) (*RpcResponse, error)
func (UnimplementedNodeServer) GetCCCRelativeTx ¶
func (UnimplementedNodeServer) GetCCCRelativeTx(context.Context, *RpcCashCheck) (*RpcResponse, error)
func (UnimplementedNodeServer) GetChainInfo ¶
func (UnimplementedNodeServer) GetChainInfo(context.Context, *RpcChainInfoReq) (*RpcResponse, error)
func (UnimplementedNodeServer) GetCommittee ¶
func (UnimplementedNodeServer) GetCommittee(context.Context, *RpcChainEpoch) (*RpcResponse, error)
func (UnimplementedNodeServer) GetRRCurrent ¶
func (UnimplementedNodeServer) GetRRCurrent(context.Context, *RpcChainRequest) (*RpcResponse, error)
func (UnimplementedNodeServer) GetRRProofs ¶
func (UnimplementedNodeServer) GetRRProofs(context.Context, *RpcRRProofReq) (*RpcResponse, error)
func (UnimplementedNodeServer) GetStats ¶
func (UnimplementedNodeServer) GetStats(context.Context, *RpcStatsReq) (*RpcResponse, error)
func (UnimplementedNodeServer) GetTransactionByHash ¶
func (UnimplementedNodeServer) GetTransactionByHash(context.Context, *RpcTXHash) (*RpcResponse, error)
func (UnimplementedNodeServer) GetTransactions ¶
func (UnimplementedNodeServer) GetTransactions(context.Context, *RpcTxList) (*RpcResponse, error)
func (UnimplementedNodeServer) MakeCCCExistenceProof ¶
func (UnimplementedNodeServer) MakeCCCExistenceProof(context.Context, *RpcCashCheck) (*RpcResponse, error)
func (UnimplementedNodeServer) MakeVccProof ¶
func (UnimplementedNodeServer) MakeVccProof(context.Context, *RpcCashCheck) (*RpcResponse, error)
func (UnimplementedNodeServer) Ping ¶
func (UnimplementedNodeServer) Ping(context.Context, *RpcRequest) (*RpcResponse, error)
func (UnimplementedNodeServer) SendBlock ¶
func (UnimplementedNodeServer) SendBlock(context.Context, *RpcMsgReq) (*RpcResponse, error)
func (UnimplementedNodeServer) SendTx ¶
func (UnimplementedNodeServer) SendTx(context.Context, *RpcTx) (*RpcResponse, error)
func (UnimplementedNodeServer) TryCrypto ¶
func (UnimplementedNodeServer) TryCrypto(context.Context, *RpcMsgReq) (*RpcResponse, error)
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.