Documentation ¶
Index ¶
- Constants
- Variables
- func DecompressFromJar(filepath string) ([]byte, error)
- func DecompressFromJarWithTxVersion(filepath, txversion string) ([]byte, error)
- func FetchOutputTypes(rawAbi string, funcName string) ([]string, error)
- func GenSinPub(key account.Key, needHashString string) string
- func GetFileHash(file io.Reader) (string, error)
- func ReadZipFile(zipf *zip.File) ([]byte, error)
- func SignWithDID(key interface{}, needHash string, batch, isKPIAccount, isDID bool) (string, error)
- type ArchiveResult
- type Authentication
- type BalanceAndAmount
- type Block
- type BlockEventFilter
- type BlockInterval
- type BlockIntervalRaw
- type BlockRaw
- type Bookmark
- type CompileResult
- type DIDCredential
- type DIDDocument
- type DIDPublicKey
- type EventFilter
- type EventType
- type FileExtra
- type Filter
- type InspectorRule
- type IntervalTime
- type JSONError
- type JSONRequest
- type JSONResponse
- type KVExtra
- type LogsFilter
- func (lf *LogsFilter) AddAddress(addresses ...string) *LogsFilter
- func (lf *LogsFilter) GetEventType() EventType
- func (lf *LogsFilter) Serialize() interface{}
- func (lf *LogsFilter) SetFromBlock(from uint64) *LogsFilter
- func (lf *LogsFilter) SetToBlock(to uint64) *LogsFilter
- func (lf *LogsFilter) SetTopic(pos int, topics ...common.Hash) *LogsFilter
- type Manifest
- type Manifests
- type Metadata
- type MqClient
- func (mc *MqClient) DeleteExchange(id uint, exchange string) (bool, StdError)
- func (mc *MqClient) GetAllQueueNames(id uint) ([]string, StdError)
- func (mc *MqClient) GetExchangerName(id uint) (string, StdError)
- func (mc *MqClient) InformNormal(id uint, brokerURL string) (bool, StdError)
- func (mc *MqClient) Listen(queue, url string, autoAck bool, listener MqListener) StdError
- func (mc *MqClient) Register(id uint, meta *RegisterMeta) (*QueueRegister, StdError)
- func (mc *MqClient) UnRegister(id uint, meta *UnRegisterMeta) (*QueueUnRegister, StdError)
- type MqEvent
- type MqListener
- type Node
- type NodeInfo
- type NodeStateInfo
- type PageResult
- type PageTxs
- type Params
- type PrivateTransactionRawData
- type ProposalRaw
- type QueryTxRange
- type QueueRegister
- type QueueUnRegister
- type RPC
- func (rpc *RPC) AddNode(url, rpcPort, wsPort string) *RPC
- func (rpc *RPC) AddRoleForNode(address string, roles ...string) StdError
- func (rpc *RPC) Archive(filterID string, sync bool) (bool, StdError)
- func (rpc *RPC) ArchiveNoPredict(filterID string) (string, StdError)
- func (rpc *RPC) BindNodes(nodeIndexes ...int) (*RPC, error)
- func (rpc *RPC) Call(method string, param interface{}) (*TxReceipt, StdError)
- func (rpc *RPC) CallByPolling(method string, param interface{}, isPrivateTx bool) (*TxReceipt, StdError)
- func (rpc *RPC) CheckCredentialAbandoned(id string) (bool, StdError)
- func (rpc *RPC) CheckCredentialValid(id string) (bool, StdError)
- func (rpc *RPC) CheckHmValue(rawValue []uint64, encryValue []string, invalidHmValue string) (*ValidResult, StdError)
- func (rpc *RPC) CheckSnapshot(filterID string) (bool, StdError)
- func (rpc *RPC) Close()
- func (rpc *RPC) CompileContract(code string) (*CompileResult, StdError)
- func (rpc *RPC) DeleteNodeNVP(hash string) (bool, StdError)
- func (rpc *RPC) DeleteNodeVP(hash string) (bool, StdError)
- func (rpc *RPC) DeleteRoleFromNode(address string, roles ...string) StdError
- func (rpc *RPC) DeleteSnapshot(filterID string) (bool, StdError)
- func (rpc *RPC) DeployContract(transaction *Transaction) (*TxReceipt, StdError)
- func (rpc *RPC) DisconnectNodeVP(hash string) (bool, StdError)
- func (rpc *RPC) EncryptoMessage(balance, amount uint64, invalidHmValue string) (*BalanceAndAmount, StdError)
- func (rpc *RPC) FastInvokeContract(body []byte, randomURL string) (*RpcStatistic, StdError)
- func (rpc *RPC) FileDownload(tarPath, hash, owner string, nodeID int, accountJson string, password string) (string, StdError)
- func (rpc *RPC) FileDownloadByTxHash(tarPath, txHash string, nodeID int, accountJson string, password string) (string, StdError)
- func (rpc *RPC) FilePush(hash string, pushNodes []int, accountJson, password string, nodeID int) (string, StdError)
- func (rpc *RPC) FileUpdate(fileUpdateTX *Transaction) StdError
- func (rpc *RPC) FileUpload(filePath string, description string, userList []string, nodeIdList []int, ...) (string, StdError)
- func (rpc *RPC) FirstPollInterval(fpi int64) *RPC
- func (rpc *RPC) FirstPollTime(fpt int64) *RPC
- func (rpc *RPC) GetAccountStatus(address string) (string, StdError)
- func (rpc *RPC) GetAccountsByRole(role string) ([]string, StdError)
- func (rpc *RPC) GetAddressByName(name string) (string, StdError)
- func (rpc *RPC) GetAddressFromNode(role string) ([]string, StdError)
- func (rpc *RPC) GetAllCNS() (map[string]string, StdError)
- func (rpc *RPC) GetAllRoles() (map[string]int, StdError)
- func (rpc *RPC) GetAllRolesFromNode() ([]string, StdError)
- func (rpc *RPC) GetAvgGenTimeByBlockNum(from, to uint64) (int64, StdError)
- func (rpc *RPC) GetBalance(account string) (string, StdError)
- func (rpc *RPC) GetBatchBlocksByHash(blockHashes []string, isPlain bool) ([]*Block, StdError)
- func (rpc *RPC) GetBatchBlocksByNumber(blockNums []uint64, isPlain bool) ([]*Block, StdError)
- func (rpc *RPC) GetBatchReceipt(hashes []string) ([]TxReceipt, StdError)
- func (rpc *RPC) GetBatchTxByHash(hashes []string) ([]TransactionInfo, StdError)
- func (rpc *RPC) GetBlkTxCountByHash(blkHash string) (uint64, StdError)
- func (rpc *RPC) GetBlkTxCountByNumber(blkNum string) (uint64, StdError)
- func (rpc *RPC) GetBlockByHash(blockHash string, isPlain bool) (*Block, StdError)
- func (rpc *RPC) GetBlockByNumber(blockNum interface{}, isPlain bool) (*Block, StdError)
- func (rpc *RPC) GetBlocks(from, to uint64, isPlain bool) ([]*Block, StdError)
- func (rpc *RPC) GetBlocksByTime(startTime, endTime uint64) (*BlockInterval, StdError)
- func (rpc *RPC) GetBlocksWithLimit(from, to uint64, isPlain bool, metadata *Metadata) (*PageResult, StdError)
- func (rpc *RPC) GetChainHeight() (string, StdError)
- func (rpc *RPC) GetChainID() string
- func (rpc *RPC) GetCode(contractAddress string) (string, StdError)
- func (rpc *RPC) GetConfig() (string, StdError)
- func (rpc *RPC) GetContractCountByAddr(accountAddress string) (uint64, StdError)
- func (rpc *RPC) GetContractStatus(contractAddress string) (string, StdError)
- func (rpc *RPC) GetContractStatusByName(contractName string) (string, StdError)
- func (rpc *RPC) GetCreateTime(contractAddress string) (string, StdError)
- func (rpc *RPC) GetCreateTimeByName(contractName string) (string, StdError)
- func (rpc *RPC) GetCreator(contractAddress string) (string, StdError)
- func (rpc *RPC) GetCreatorByName(contractName string) (string, StdError)
- func (rpc *RPC) GetCredentialPrimaryMessage(id string) (*DIDCredential, StdError)
- func (rpc *RPC) GetDIDDocument(didAddress string) (*DIDDocument, StdError)
- func (rpc *RPC) GetDeployedList(address string) ([]string, StdError)
- func (rpc *RPC) GetDiscardTransactionsByTime(start, end uint64) ([]TransactionInfo, StdError)
- func (rpc *RPC) GetDiscardTx() ([]TransactionInfo, StdError)
- func (rpc *RPC) GetFileExtraByExtraId(extraId string) (*FileExtra, error)
- func (rpc *RPC) GetFileExtraByFilter(from, extraId string) (*FileExtra, StdError)
- func (rpc *RPC) GetFileExtraByTxHash(txHash string) (*FileExtra, StdError)
- func (rpc *RPC) GetGenesisBlock() (string, StdError)
- func (rpc *RPC) GetHosts(role string) (map[string][]byte, StdError)
- func (rpc *RPC) GetLatestBlock() (*Block, StdError)
- func (rpc *RPC) GetMqClient() *MqClient
- func (rpc *RPC) GetNameByAddress(address string) (string, StdError)
- func (rpc *RPC) GetNextPageTxs(blkNumber, txIndex, minBlkNumber, maxBlkNumber, separated, pageSize uint64, ...) ([]TransactionInfo, StdError)
- func (rpc *RPC) GetNextPageTxsByName(blkNumber, txIndex, minBlkNumber, maxBlkNumber, separated, pageSize uint64, ...) ([]TransactionInfo, StdError)
- func (rpc *RPC) GetNodeChainID() (string, StdError)
- func (rpc *RPC) GetNodeHash() (string, StdError)
- func (rpc *RPC) GetNodeHashByID(id int) (string, StdError)
- func (rpc *RPC) GetNodeStates() ([]NodeStateInfo, StdError)
- func (rpc *RPC) GetNodes() ([]NodeInfo, StdError)
- func (rpc *RPC) GetPrevPageTxs(blkNumber, txIndex, minBlkNumber, maxBlkNumber, separated, pageSize uint64, ...) ([]TransactionInfo, StdError)
- func (rpc *RPC) GetPrevPageTxsByName(blkNumber, txIndex, minBlkNumber, maxBlkNumber, separated, pageSize uint64, ...) ([]TransactionInfo, StdError)
- func (rpc *RPC) GetPrivateTransactionByHash(txHash string) (*TransactionInfo, StdError)
- func (rpc *RPC) GetProposal() (*ProposalRaw, StdError)
- func (rpc *RPC) GetRoleFromNode(address string) ([]string, StdError)
- func (rpc *RPC) GetRoles(account string) ([]string, StdError)
- func (rpc *RPC) GetRulesFromNode() ([]*InspectorRule, StdError)
- func (rpc *RPC) GetSignHash(transaction *Transaction) (string, StdError)
- func (rpc *RPC) GetTCert(index uint) (string, StdError)
- func (rpc *RPC) GetTransactionByHash(txHash string) (*TransactionInfo, StdError)
- func (rpc *RPC) GetTransactionsByBlkNum(start, end uint64) ([]TransactionInfo, StdError)
- func (rpc *RPC) GetTransactionsByBlkNumWithLimit(start, end uint64, metadata *Metadata) (*PageResult, StdError)
- func (rpc *RPC) GetTransactionsByExtraID(extraId []interface{}, txTo string, detail bool, mode int, metadata *Metadata) (*PageResult, StdError)
- func (rpc *RPC) GetTransactionsCountByMethodID(from, to uint64, address string, methodID string) (*TransactionsCountByContract, StdError)
- func (rpc *RPC) GetTransactionsCountByMethodIDAndContractName(from, to uint64, name string, methodID string) (*TransactionsCountByContract, StdError)
- func (rpc *RPC) GetTransactionsCountByTime(startTime, endTime uint64) (uint64, StdError)
- func (rpc *RPC) GetTxAvgTimeByBlockNumber(from, to uint64) (uint64, StdError)
- func (rpc *RPC) GetTxByBlkHashAndIdx(blkHash string, index uint64) (*TransactionInfo, StdError)
- func (rpc *RPC) GetTxByBlkNumAndIdx(blkNum, index uint64) (*TransactionInfo, StdError)
- func (rpc *RPC) GetTxByTime(start, end uint64) ([]TransactionInfo, StdError)
- func (rpc *RPC) GetTxByTimeAndContractAddrWithLimit(start, end uint64, metadata *Metadata, contractAddr string) (*PageTxs, StdError)
- func (rpc *RPC) GetTxByTimeAndContractNameWithLimit(start, end uint64, metadata *Metadata, contractName string) (*PageTxs, StdError)
- func (rpc *RPC) GetTxByTimeWithLimit(start, end uint64, metadata *Metadata) (*PageTxs, StdError)
- func (rpc *RPC) GetTxCount() (*TransactionsCount, StdError)
- func (rpc *RPC) GetTxCountByContractAddr(from, to uint64, address string, txExtra bool) (*TransactionsCountByContract, StdError)
- func (rpc *RPC) GetTxCountByContractName(from, to uint64, name string, txExtra bool) (*TransactionsCountByContract, StdError)
- func (rpc *RPC) GetTxReceipt(txHash string, isPrivateTx bool) (*TxReceipt, StdError)
- func (rpc *RPC) GetTxReceiptByPolling(txHash string, isPrivateTx bool) (*TxReceipt, StdError, bool)
- func (rpc *RPC) GetTxVersion() (string, StdError)
- func (rpc *RPC) GetVSet() ([]string, StdError)
- func (rpc *RPC) GetWebSocketClient() *WebSocketClient
- func (rpc *RPC) Https(tlscaPath, tlspeerCertPath, tlspeerPrivPath string) *RPC
- func (rpc *RPC) InvokeContract(transaction *Transaction) (*TxReceipt, StdError)
- func (rpc *RPC) InvokeContractReturnHash(transaction *Transaction) (string, StdError)
- func (rpc *RPC) IsRoleExist(role string) (bool, StdError)
- func (rpc *RPC) ListSnapshot() (Manifests, StdError)
- func (rpc *RPC) ListenContract(srcCode, addr string) (string, StdError)
- func (rpc *RPC) MaintainContract(transaction *Transaction) (*TxReceipt, StdError)
- func (rpc *RPC) ManageContractByVote(transaction *Transaction) (*TxReceipt, StdError)
- func (rpc *RPC) Namespace(ns string) *RPC
- func (rpc *RPC) Pending() ([]SnapshotEvent, StdError)
- func (rpc *RPC) QueryArchive(filterID string) (string, StdError)
- func (rpc *RPC) QueryArchiveExist(filterID string) (bool, StdError)
- func (rpc *RPC) QueryLatestArchive() (*ArchiveResult, StdError)
- func (rpc *RPC) QuerySnapshotExist(filterID string) (bool, StdError)
- func (rpc *RPC) QueryTPS(startTime, endTime uint64) (*TPSInfo, StdError)
- func (rpc *RPC) ReConnTime(rct int64) *RPC
- func (rpc *RPC) ReadSnapshot(filterID string) (*Manifest, StdError)
- func (rpc *RPC) ReplaceNodeCerts(hostname string) (string, StdError)
- func (rpc *RPC) ResendTimes(resTime int64) *RPC
- func (rpc *RPC) Restore(filterID string, sync bool) (bool, StdError)
- func (rpc *RPC) RestoreAll(sync bool) (bool, StdError)
- func (rpc *RPC) SecondPollInterval(spi int64) *RPC
- func (rpc *RPC) SecondPollTime(spt int64) *RPC
- func (rpc *RPC) SendDIDTransaction(transaction *Transaction, key interface{}) (*TxReceipt, StdError)
- func (rpc *RPC) SendTx(transaction *Transaction) (*TxReceipt, StdError)
- func (rpc *RPC) SendTxReturnHash(transaction *Transaction) (string, StdError)
- func (rpc *RPC) SetAccount(key account.Key)
- func (rpc *RPC) SetLocalChainID() error
- func (rpc *RPC) SetRulesInNode(rules []*InspectorRule) StdError
- func (rpc *RPC) SignAndDeployContract(transaction *Transaction, key interface{}) (*TxReceipt, StdError)
- func (rpc *RPC) SignAndInvokeContract(transaction *Transaction, key interface{}) (*TxReceipt, StdError)
- func (rpc *RPC) SignAndInvokeContractCombineReturns(transaction *Transaction, key interface{}) (*TxReceipt, *TransactionInfo, StdError)
- func (rpc *RPC) SignAndMaintainContract(transaction *Transaction, key interface{}) (*TxReceipt, StdError)
- func (rpc *RPC) SignAndManageContractByVote(transaction *Transaction, key interface{}) (*TxReceipt, StdError)
- func (rpc *RPC) SignAndSendTx(transaction *Transaction, key interface{}) (*TxReceipt, StdError)
- func (rpc *RPC) Snapshot(blockHeight interface{}) (string, StdError)
- func (rpc *RPC) String() string
- func (rpc *RPC) Tcert(cfca bool, sdkcertPath, sdkcertPrivPath, uniquePubPath, uniquePrivPath string) *RPC
- type RegisterMeta
- func (rm *RegisterMeta) AddAddress(address ...common.Address) *RegisterMeta
- func (rm *RegisterMeta) Serialize() interface{}
- func (rm *RegisterMeta) SerializeToString() string
- func (rm *RegisterMeta) SetDelay(delay bool) *RegisterMeta
- func (rm *RegisterMeta) SetFromBlock(from string) *RegisterMeta
- func (rm *RegisterMeta) SetToBlock(to string) *RegisterMeta
- func (rm *RegisterMeta) SetTopics(pos int, topics ...common.Hash) *RegisterMeta
- func (rm *RegisterMeta) Sign(key interface{})
- func (rm *RegisterMeta) Verbose(v bool) *RegisterMeta
- type RequestType
- type RetError
- type RpcStatistic
- type Snapshot
- type SnapshotEvent
- type StdError
- type Subscription
- type SubscriptionID
- type SystemStatusFilter
- func (ssf *SystemStatusFilter) AddErrorCode(errorCodes ...string) *SystemStatusFilter
- func (ssf *SystemStatusFilter) AddErrorCodeExclude(errorCodesExclude ...string) *SystemStatusFilter
- func (ssf *SystemStatusFilter) AddModules(modules ...string) *SystemStatusFilter
- func (ssf *SystemStatusFilter) AddModulesExclude(modulesExclude ...string) *SystemStatusFilter
- func (ssf *SystemStatusFilter) AddSubtypes(subtypes ...string) *SystemStatusFilter
- func (ssf *SystemStatusFilter) AddSubtypesExclude(subtypesExclude ...string) *SystemStatusFilter
- func (ssf *SystemStatusFilter) GetEventType() EventType
- func (ssf *SystemStatusFilter) Serialize() interface{}
- type TCert
- type TCertManager
- type TCertResponse
- type TPSInfo
- type Transaction
- func (t *Transaction) Deploy(payload string) *Transaction
- func (t *Transaction) DeployArgs(abiString string, args ...interface{}) *Transaction
- func (t *Transaction) DeployStringArgs(abiString string, args ...interface{}) *Transaction
- func (t *Transaction) DestroyCredential(credentialID string) *Transaction
- func (t *Transaction) DownloadCredential(credentialID string) *Transaction
- func (t *Transaction) Extra(extra string) *Transaction
- func (t *Transaction) GetExtraIdString() (string, error)
- func (t *Transaction) GetTransactionHash(gasLimit int64) string
- func (t *Transaction) Invoke(to string, payload []byte) *Transaction
- func (t *Transaction) InvokeByName(name string, payload []byte) *Transaction
- func (t *Transaction) InvokeContract(to string, rawAbi string, funcName string, args ...string) *Transaction
- func (t *Transaction) InvokeSql(to string, payload []byte) *Transaction
- func (t *Transaction) KVExtra(kvExtra *KVExtra) *Transaction
- func (t *Transaction) Maintain(op int64, to, payload string) *Transaction
- func (t *Transaction) MaintainByName(op int64, name, payload string) *Transaction
- func (t *Transaction) MaintainDID(to string, op int64) *Transaction
- func (t *Transaction) Nonce(nonce int64) *Transaction
- func (t *Transaction) OpCode(op int64) *Transaction
- func (t *Transaction) Payload(payload string) *Transaction
- func (t *Transaction) PreSign(key account.Key)
- func (t *Transaction) Register(document *DIDDocument) *Transaction
- func (t *Transaction) Serialize() interface{}
- func (t *Transaction) SerializeToString() string
- func (t *Transaction) SetCName(cName string)
- func (t *Transaction) SetExtra(extra string)
- func (t *Transaction) SetExtraIDInt64(extraId ...int64)
- func (t *Transaction) SetExtraIDString(extraId ...string)
- func (t *Transaction) SetFrom(from string)
- func (t *Transaction) SetHasExtra(hasExtra bool)
- func (t *Transaction) SetIsByName(isByName bool)
- func (t *Transaction) SetIsDeploy(isDeploy bool)
- func (t *Transaction) SetIsInvoke(isInvoke bool)
- func (t *Transaction) SetIsMaintain(isMaintain bool)
- func (t *Transaction) SetIsPrivateTxm(isPrivateTx bool)
- func (t *Transaction) SetIsValue(isValue bool)
- func (t *Transaction) SetKvExtra(kvExtra *KVExtra)
- func (t *Transaction) SetNonce(nonce int64)
- func (t *Transaction) SetOpcode(opcode int64)
- func (t *Transaction) SetOptionExtra(option string)
- func (t *Transaction) SetParticipants(participants []string)
- func (t *Transaction) SetPayload(payload string)
- func (t *Transaction) SetSignature(signature string)
- func (t *Transaction) SetSimulate(simulate bool)
- func (t *Transaction) SetTimestamp(timestamp int64)
- func (t *Transaction) SetTo(to string)
- func (t *Transaction) SetValue(value int64)
- func (t *Transaction) SetVmType(vmType string)
- func (t *Transaction) Sign(key interface{})
- func (t *Transaction) SignWithBatchFlag(key interface{})
- func (t *Transaction) SignWithClang(key interface{})
- func (t *Transaction) Signature(signature string) *Transaction
- func (t *Transaction) Simulate(simulate bool) *Transaction
- func (t *Transaction) Timestamp(timestamp int64) *Transaction
- func (t *Transaction) To(to string) *Transaction
- func (t *Transaction) Transfer(to string, value int64) *Transaction
- func (t *Transaction) UpdateAdmins(to string, admins []string) *Transaction
- func (t *Transaction) UpdatePublicKey(to string, puKey *DIDPublicKey) *Transaction
- func (t *Transaction) UploadCredential(credential *DIDCredential) *Transaction
- func (t *Transaction) VMType(vmType VMType) *Transaction
- func (t *Transaction) Value(value int64) *Transaction
- type TransactionInfo
- type TransactionPageArg
- type TransactionRaw
- type TransactionValue
- func (*TransactionValue) Descriptor() ([]byte, []int)
- func (m *TransactionValue) GetAmount() int64
- func (m *TransactionValue) GetEncryptedAmount() []byte
- func (m *TransactionValue) GetExtra() []byte
- func (m *TransactionValue) GetExtraId() []byte
- func (m *TransactionValue) GetGasLimit() int64
- func (m *TransactionValue) GetHomomorphicAmount() []byte
- func (m *TransactionValue) GetHomomorphicBalance() []byte
- func (m *TransactionValue) GetOp() TransactionValue_Opcode
- func (m *TransactionValue) GetPayload() []byte
- func (m *TransactionValue) GetPrice() int64
- func (m *TransactionValue) GetVmType() TransactionValue_VmType
- func (m *TransactionValue) Marshal() (dAtA []byte, err error)
- func (m *TransactionValue) MarshalTo(dAtA []byte) (int, error)
- func (*TransactionValue) ProtoMessage()
- func (m *TransactionValue) Reset()
- func (m *TransactionValue) Size() (n int)
- func (m *TransactionValue) String() string
- func (m *TransactionValue) Unmarshal(dAtA []byte) error
- func (m *TransactionValue) XXX_DiscardUnknown()
- func (m *TransactionValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TransactionValue) XXX_Merge(src proto.Message)
- func (m *TransactionValue) XXX_Size() int
- func (m *TransactionValue) XXX_Unmarshal(b []byte) error
- type TransactionValue_Opcode
- type TransactionValue_VmType
- type TransactionsCount
- type TransactionsCountByContract
- type TransactionsCountByContractRaw
- type TransactionsCountRaw
- type TxLog
- type TxReceipt
- type TxVersionInt
- type UnRegisterMeta
- type VMType
- type ValidResult
- type VoteInfo
- type WebSocketClient
- func (wscli *WebSocketClient) CloseConn(nodeIndex int) StdError
- func (wscli *WebSocketClient) GetAllSubscription(nodeIndex int) ([]Subscription, StdError)
- func (wscli *WebSocketClient) Subscribe(nodeIndex int, filter EventFilter, eventHandler WsEventHandler) (SubscriptionID, StdError)
- func (wscli *WebSocketClient) SubscribeForProposal(nodeIndex int, eventHandler WsEventHandler) (SubscriptionID, StdError)
- func (wscli *WebSocketClient) UnSubscribe(id SubscriptionID) StdError
- type WebSocketNotification
- type WsEventHandler
Constants ¶
const ( // FileDownload Type TypeDownload = "download" // FileUpload Type TypeUpload = "upload" // TypePush = "push" // content type stream Stream = "application/octet-stream" )
const ( // KVExtraVersionValue is private transaction extra field version KVExtraVersionValue = "1.0" // KVExtraVersionKey is private transaction extra field name KVExtraVersionKey = "__version__" // KVExtraPrivateKey is private transaction extra payload KVExtraPrivateKey = "__privateData__" // KVExtraPrivatePayloadKey is private transaction real payload KVExtraPrivatePayloadKey = "payload" // KVExtraPrivatePubSigKey is private transaction public signature KVExtraPrivatePubSigKey = "publicSignature" )
const ( // DBOPBatch event DBOPBatch MqEvent = "DBOPBatch" // TxExec event TxExec MqEvent = "TxExec" // MQTxContent event MQTxContent MqEvent = "MQTxContent" DefaultAmdpURL string = "amqp://guest:guest@localhost:5672/" )
const ( // MQBlock MQBlock MQBlock routingKey = "MQBlock" // MQLog MQLog MQLog routingKey = "MQLog" // MQException MQException MQException routingKey = "MQException" )
const ( // TRANSACTION type TRANSACTION = "tx_" // CONTRACT type CONTRACT = "contract_" // BLOCK type BLOCK = "block_" // ACCOUNT type ACCOUNT = "account_" // NODE type NODE = "node_" // CERT type CERT = "cert_" // SUB type SUB = "sub_" // ARCHIVE type ARCHIVE = "archive_" // MQ type MQ = "mq_" // RADAR type RADAR = "radar_" // CONFIG type CONFIG = "config_" // FILE type FILE = "fm_" // AUTH type AUTH = "auth_" // SIMULATE type SIMULATE = "simulate_" //DID type DID = "did_" DefaultNamespace = "global" DefaultResendTime = 10 DefaultFirstPollInterval = 100 DefaultFirstPollTime = 10 DefaultSecondPollInterval = 1000 DefaultSecondPollTime = 10 DefaultReConnectTime = 10000 DefaultTxVersion = "3.0" )
const ( EVM VMType = "EVM" JVM VMType = "JVM" HVM VMType = "HVM" BVM VMType = "BVM" TRANSFER VMType = "TRANSFER" KVSQL VMType = "KVSQL" UNIT = 32 //extraId parameter ExtraIDStringMaxLength int = 1024 ExtraIDListMaxLength int = 30 //default transaction gas limit DefaultTxGasLimit = 1000000000 // flato gas limit DefaultTxGasLimitV2 = 10000000 // TimeLength is the number length of timestamp TimeLength = 8 UPDATE = 1 DID_REGISTER = 200 DID_FREEZE = 201 DID_UNFREEZE = 202 DID_ABANDON = 203 DID_UPDATEPUBLICKEY = 204 DID_UPDATEADMINS = 205 DIDCREDENTIAL_UPLOAD = 206 DIDCREDENTIAL_DOWNLOAD = 207 DIDCREDENTIAL_ABANDON = 208 )
VMType vm type, could by evm and jvm for now
const ( SystemErrorCode = -9996 AsnycRequestErrorCode = -9997 RequestTimeoutErrorCode = -9998 GetResponseErrorCode = -9999 SuccessCode = 0 //InvalidJSONCode = -32700 //InvalidRequestCode = -32600 MethodNotExistOrInvalidCode = -32601 //InvalidMethodArgsCode = -32602 //JSONRPCInternalErrorCode = -32603 DataNotExistCode = -32001 BalanceInsufficientCode = -32002 SystemBusyCode = -32006 DuplicateTransactionsCode = -32007 ALGOTYPE_SM2 = "sm2" ALGOTYPE_EC = "ecdsa" ALGOTYPE_ED = "ed25519" NORMAL = 0 FREEZE = 1 ABANDON = 2 )
reponse codes
const ( ContractManifestPath = "META-INF/MANIFEST.MF" ContractClassSuffix = ".class" // ContractDeployMagic hvm contract deploy magic ContractDeployMagic = "fefffbcd" )
const ( // ReadBufferSize read buff size ReadBufferSize = 1024 * 256 //WriteBufferSize write buff size WriteBufferSize = 1024 * 256 )
const (
// JSONRPCVersion is rpc version
JSONRPCVersion = "2.0"
)
Variables ¶
var ( ErrInvalidLengthTransaction = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTransaction = fmt.Errorf("proto: integer overflow") )
var TransactionValue_Opcode_name = map[int32]string{
0: "NORMAL",
1: "UPDATE",
2: "FREEZE",
3: "UNFREEZE",
4: "SKIPVM",
100: "ARCHIVE",
}
var TransactionValue_Opcode_value = map[string]int32{
"NORMAL": 0,
"UPDATE": 1,
"FREEZE": 2,
"UNFREEZE": 3,
"SKIPVM": 4,
"ARCHIVE": 100,
}
var TransactionValue_VmType_name = map[int32]string{
0: "EVM",
1: "JVM",
2: "HVM",
3: "BVM",
4: "TRANSFER",
}
var TransactionValue_VmType_value = map[string]int32{
"EVM": 0,
"JVM": 1,
"HVM": 2,
"BVM": 3,
"TRANSFER": 4,
}
var (
TxVersion = DefaultTxVersion
)
Functions ¶
func DecompressFromJar ¶
DecompressFromJar encode jarcode for deploy or upgrade
func FetchOutputTypes ¶
FetchOutputTypes return output args type by function name
func GetFileHash ¶
GetFileHash evaluate the md5 of the file
func ReadZipFile ¶
ReadZipFile read a file data from a zip
Types ¶
type ArchiveResult ¶
type ArchiveResult struct { FilterID string `json:"filterId"` Status string `json:"status"` Reason string `json:"reason"` }
ArchiveResult used for return archive result, tell caller which step is processing
type Authentication ¶
type Authentication struct { Timestamp int64 `json:"timestamp"` Address common.Address `json:"address"` Signature string `json:"signature"` }
Authentication contains params for api auth
type BalanceAndAmount ¶
type Block ¶
type Block struct { Version string Number uint64 Hash string ParentHash string WriteTime uint64 AvgTime int64 TxCounts uint64 MerkleRoot string Transactions []TransactionInfo }
Block is packaged result of Block
type BlockEventFilter ¶
type BlockEventFilter struct { BlockInfo bool // contains filtered or unexported fields }
BlockEventFilter block filter
func NewBlockEventFilter ¶
func NewBlockEventFilter() *BlockEventFilter
NewBlockEventFilter return a BlockEventFilter
func (*BlockEventFilter) GetEventType ¶
func (bf *BlockEventFilter) GetEventType() EventType
GetEventType return event type
func (*BlockEventFilter) Serialize ¶
func (bf *BlockEventFilter) Serialize() interface{}
Serialize serialize
func (*BlockEventFilter) SetBlockInfo ¶
func (bf *BlockEventFilter) SetBlockInfo(b bool)
SetBlockInfo blockInfo setter
type BlockInterval ¶
BlockInterval describe the BlockInterval related information(decoded)
type BlockIntervalRaw ¶
BlockIntervalRaw describe the BlockInterval related information(not decoded yet)
func (*BlockIntervalRaw) ToBlockInterval ¶
func (b *BlockIntervalRaw) ToBlockInterval() (*BlockInterval, StdError)
ToBlockInterval decode BlockIntervalRaw to BlockInterval
type BlockRaw ¶
type BlockRaw struct { Version string `json:"version"` Number string `json:"number"` // the block number Hash string `json:"hash"` // hash of the block ParentHash string `json:"parentHash"` // hash of the parent block WriteTime uint64 `json:"writeTime"` // the unix timestamp for when the block was written AvgTime string `json:"avgTime"` // the average time it takes to execute transactions in the block (ms) TxCounts string `json:"txcounts"` // the number of transactions in the block MerkleRoot string `json:"merkleRoot"` // merkle tree root hash Transactions []TransactionRaw `json:"transactions,omitempty"` // the list of transactions in the block }
BlockRaw is packaged result of block
type CompileResult ¶
CompileResult is packaged compile contract result
type DIDCredential ¶
type DIDCredential struct { ID string `json:"id,omitempty"` Type string `json:"type,omitempty"` Issuer string `json:"issuer,omitempty"` Holder string `json:"holder,omitempty"` IssuanceDate int64 `json:"issuanceDate,omitempty"` ExpirationDate int64 `json:"expirationDate,omitempty"` SignType string `json:"signType,omitempty"` Signature string `json:"signature,omitempty"` Subject string `json:"subject,omitempty"` }
func NewDIDCredential ¶
func NewDIDCredential(ctype, issuer, holder, subject string, issuanceDate, expirationDate int64) *DIDCredential
func (*DIDCredential) Sign ¶
func (credential *DIDCredential) Sign(key interface{}) error
type DIDDocument ¶
type DIDDocument struct { DidAddress string `json:"didAddress,omitempty"` State int `json:"state,omitempty"` PublicKey *DIDPublicKey `json:"publicKey,omitempty"` Admins []string `json:"admins,omitempty"` Extra map[string]interface{} `json:"extra,omitempty"` }
func NewDIDDocument ¶
func NewDIDDocument(didAddress string, publicKey *DIDPublicKey, admins []string) *DIDDocument
type DIDPublicKey ¶
type DIDPublicKey struct { KeyType string `json:"type,omitempty"` KeyValue []byte `json:"key,omitempty"` }
func GenDIDPublicKeyFromDIDKey ¶
func GenDIDPublicKeyFromDIDKey(didKey *account.DIDKey) (*DIDPublicKey, error)
type EventFilter ¶
type EventFilter interface { Serialize() interface{} GetEventType() EventType }
EventFilter event filter
type FileExtra ¶
type FileExtra struct { Hash string `json:"hash"` FileName string `json:"file_name"` FileSize int64 `json:"file_size"` UpdateTime string `json:"update_time"` NodeList []string `json:"node_list"` UserList []string `json:"user_list,omitempty"` FileDescription string `json:"file_description"` }
FileExtra represents the arguments to upload a new file into node.
type Filter ¶
type Filter struct { TxHash string `json:"txHash,omitempty"` BlkNumber uint64 `json:"blkNumber,omitempty"` TxIndex int64 `json:"txIndex,omitempty"` TxFrom string `json:"txFrom,omitempty"` TxTo string `json:"txTo,omitempty"` Name string `json:"txName,omitempty"` ExtraId []interface{} `json:"extraId,omitempty"` }
type InspectorRule ¶
type InspectorRule struct { // AllowAnyone determines whether the resources can be accessed freely by anyone AllowAnyone bool `json:"allow_anyone" mapstructure:"allow_anyone"` // AuthorizedRoles determine who can access the resource if the resources can not be accessed freely AuthorizedRoles []string `json:"authorized_roles" mapstructure:"authorized_roles"` // ForbiddenRoles determine who can not access the resources though he has the authorized roles ForbiddenRoles []string `json:"forbidden_roles" mapstructure:"forbidden_roles"` // ID is the identity sequence number for priority ID int `json:"id" mapstructure:"id"` // Name is the identity string for reading Name string `json:"name" mapstructure:"name"` // To is the `to` address used to define resources of tx api Method []string `json:"method" mapstructure:"method"` }
InspectorRule is the rule of api filter
type IntervalTime ¶
type IntervalTime struct { StartTime int64 `json:"startTime"` Endtime int64 `json:"endTime"` Metadata *Metadata `json:"metadata"` Filter *Filter `json:"filter"` }
IntervalTime represents the parameter used by criteria query.
type JSONError ¶
type JSONError struct { Code int `json:"code"` Message string `json:"message"` Namespace string `json:"namespace"` Data interface{} `json:"data,omitempty"` }
JSONError is used to package http error info
type JSONRequest ¶
type JSONRequest struct { Method string `json:"method"` Version string `json:"jsonrpc"` ID int `json:"id,omitempty"` Namespace string `json:"namespace,omitempty"` Params []interface{} `json:"params,omitempty"` Auth *Authentication `json:"auth,omitempty"` }
JSONRequest is used to package http request
type JSONResponse ¶
type JSONResponse struct { Version string `json:"jsonrpc"` ID int `json:"id"` Result json.RawMessage `json:"result"` Namespace string `json:"namespace"` Code int `json:"code"` Message string `json:"message"` }
JSONResponse is used to package http response
type KVExtra ¶
type KVExtra struct {
// contains filtered or unexported fields
}
KVExtra is transaction extra field
type LogsFilter ¶
type LogsFilter struct { FromBlock uint64 `json:"fromBlock,omitempty"` ToBlock uint64 `json:"toBlock,omitempty"` Addresses []string `json:"addresses,omitempty"` Topics [4][]common.Hash `json:"topics,omitempty"` // contains filtered or unexported fields }
LogsFilter logs filter
func (*LogsFilter) AddAddress ¶
func (lf *LogsFilter) AddAddress(addresses ...string) *LogsFilter
AddAddress add address into filter
func (*LogsFilter) GetEventType ¶
func (lf *LogsFilter) GetEventType() EventType
GetEventType get event type
func (*LogsFilter) SetFromBlock ¶
func (lf *LogsFilter) SetFromBlock(from uint64) *LogsFilter
SetFromBlock add from block into filter
func (*LogsFilter) SetToBlock ¶
func (lf *LogsFilter) SetToBlock(to uint64) *LogsFilter
SetToBlock add to block into filter
func (*LogsFilter) SetTopic ¶
func (lf *LogsFilter) SetTopic(pos int, topics ...common.Hash) *LogsFilter
SetTopic set topic of specific position
type Manifest ¶
type Manifest struct { Height uint64 `json:"height"` Genesis uint64 `json:"genesis"` BlockHash string `json:"hash"` FilterID string `json:"filterId"` MerkleRoot string `json:"merkleRoot"` Date string `json:"date"` Namespace string `json:"namespace"` }
Manifest represents all basic information of a snapshot.
type MqClient ¶
type MqClient struct {
// contains filtered or unexported fields
}
MqClient mq client support some function
func (*MqClient) DeleteExchange ¶
DeleteExchange delete exchange
func (*MqClient) GetAllQueueNames ¶
GetAllQueueNames get all queue name
func (*MqClient) GetExchangerName ¶
GetExchangerName get mq exchange name
func (*MqClient) InformNormal ¶
InformNormal notice service the connection is normal
func (*MqClient) Listen ¶
func (mc *MqClient) Listen(queue, url string, autoAck bool, listener MqListener) StdError
Listen add listener for mq
func (*MqClient) Register ¶
func (mc *MqClient) Register(id uint, meta *RegisterMeta) (*QueueRegister, StdError)
Register register mq channel
func (*MqClient) UnRegister ¶
func (mc *MqClient) UnRegister(id uint, meta *UnRegisterMeta) (*QueueUnRegister, StdError)
UnRegister unRegister mq channel
type MqListener ¶
type MqListener interface {
HandleDelivery(data []byte)
}
MqListener handle register
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is used to contain node info
type NodeInfo ¶
type NodeInfo struct { Status uint IP string Port string ID uint Isprimary bool `json:"isPrimary"` Delay uint //表示该节点与本节点的延迟时间(单位ns),若为0,则为本节点 IsVp bool `json:"isvp"` PeerType string `json:"peerType"` Namespace string Hash string HostName string `json:"hostname"` }
NodeInfo is packaged return result of node
type NodeStateInfo ¶
type NodeStateInfo struct { Hash string `json:"hash"` Status string `json:"status"` // TIMEOUT, NORMAL, VIEWCHANGE... View uint64 `json:"view"` BlockHeight uint64 `json:"blockHeight"` // latest block height of node BlockHash string `json:"blockHash"` // latest block hash of node }
NodeStateInfo records the node status(including consensus status)
type PageResult ¶
type PageResult struct { HasMore bool `json:"hasmore"` // 是否还有符合条件的区块或交易 Data interface{} `json:"data"` // 这里其实为以前result里的内容 }
type PageTxs ¶
type PageTxs struct { HasMore bool `json:"hasmore"` // 是否还有符合条件的区块或交易 Data []TransactionRaw `json:"data"` // 这里其实为以前result里的内容 }
type Params ¶
type Params interface { // Serialize serialize to map Serialize() interface{} // SerializeToString serialize to string SerializeToString() string }
Params interface
type PrivateTransactionRawData ¶
type PrivateTransactionRawData struct { Collection []string `json:"collection"` PublicSignature string `json:"publicSignature"` Payload string `json:"payload"` }
PrivateTransactionRawData is raw private transaction extra field
type ProposalRaw ¶
type ProposalRaw struct { ID uint64 `json:"id,omitempty"` Code string `json:"code,omitempty"` Timestamp int64 `json:"timestamp,omitempty"` Timeout int64 `json:"timeout,omitempty"` Status string `json:"status,omitempty"` Assentor []*VoteInfo `json:"assentor,omitempty"` Objector []*VoteInfo `json:"objector,omitempty"` Threshold uint32 `json:"threshold,omitempty"` Score uint32 `json:"score,omitempty"` Creator string `json:"creator,omitempty"` Version string `json:"version,omitempty"` Type string `json:"type,omitempty"` Completed string `json:"completed,omitempty"` Cancel string `json:"cancel,omitempty"` }
ProposalRaw ProposalRaw
type QueryTxRange ¶
QueryTxRange packaged query transaction by block number range
func (*QueryTxRange) Serialize ¶
func (qtr *QueryTxRange) Serialize() interface{}
Serialize serialize to map
func (*QueryTxRange) SerializeToString ¶
func (qtr *QueryTxRange) SerializeToString() string
SerializeToString serialize to string
type QueueRegister ¶
QueueRegister MQ register result
type QueueUnRegister ¶
QueueUnRegister MQ unRegister result
type RPC ¶
type RPC struct {
// contains filtered or unexported fields
}
RPC represents rpc apis
func DefaultRPC ¶
DefaultRPC return a *RPC with some default configs
func NewRPC ¶
func NewRPC() *RPC
NewRPC get a RPC instance with default conf directory path "../conf"
func NewRPCWithPath ¶
NewRPCWithPath get a RPC instance with user defined root conf directory path the default conf root file structure should like this:
conf ├── certs │ ├── ecert.cert │ ├── ecert.priv │ ├── sdkcert.cert │ ├── sdkcert.priv │ ├── tls │ │ ├── tls_peer.cert │ │ ├── tls_peer.priv │ │ └── tlsca.ca │ ├── unique.priv │ └── unique.pub └── hpc.toml
func (*RPC) AddRoleForNode ¶
AddRoleForNode add roles for given address in node
func (*RPC) ArchiveNoPredict ¶
ArchiveNoPredict used for archive to specific committed block-number
func (*RPC) CallByPolling ¶
func (rpc *RPC) CallByPolling(method string, param interface{}, isPrivateTx bool) (*TxReceipt, StdError)
CallByPolling call and get tx receipt by polling
func (*RPC) CheckCredentialAbandoned ¶
func (*RPC) CheckHmValue ¶
func (rpc *RPC) CheckHmValue(rawValue []uint64, encryValue []string, invalidHmValue string) (*ValidResult, StdError)
CheckHmValue 获取收款方对所有未验证同态交易的验证结果
func (*RPC) CheckSnapshot ¶
CheckSnapshot will check that the snapshot is correct. If correct, returns true. Otherwise, returns false.
func (*RPC) CompileContract ¶
func (rpc *RPC) CompileContract(code string) (*CompileResult, StdError)
CompileContract Compile contract rpc
func (*RPC) DeleteNodeNVP ¶
DeleteNodeNVP 删除NVP节点
func (*RPC) DeleteNodeVP ¶
DeleteNodeVP 删除VP节点
func (*RPC) DeleteRoleFromNode ¶
DeleteRoleFromNode delete roles from address in node
func (*RPC) DeleteSnapshot ¶
DeleteSnapshot delete snapshot by id
func (*RPC) DeployContract ¶
func (rpc *RPC) DeployContract(transaction *Transaction) (*TxReceipt, StdError)
Deprecated DeployContract Deploy contract rpc
func (*RPC) DisconnectNodeVP ¶
DisconnectNodeVP NVP断开与VP节点的链接
func (*RPC) EncryptoMessage ¶
func (rpc *RPC) EncryptoMessage(balance, amount uint64, invalidHmValue string) (*BalanceAndAmount, StdError)
EncryptoMessage 获取同态加密之后的账户余额以及转账金额
func (*RPC) FastInvokeContract ¶
func (rpc *RPC) FastInvokeContract(body []byte, randomURL string) (*RpcStatistic, StdError)
func (*RPC) FileDownload ¶
func (rpc *RPC) FileDownload(tarPath, hash, owner string, nodeID int, accountJson string, password string) (string, StdError)
FileDownload 文件下载接口,tarPath有两种使用:1.传有效目录,会在给路径下以hash作为文件名保存文件;2.传有效文件路径,对该文件进行断点续传
func (*RPC) FileDownloadByTxHash ¶
func (rpc *RPC) FileDownloadByTxHash(tarPath, txHash string, nodeID int, accountJson string, password string) (string, StdError)
FileDownloadByTxHash 文件下载接口,通过交易哈希直接下载文件
func (*RPC) FilePush ¶
func (rpc *RPC) FilePush(hash string, pushNodes []int, accountJson, password string, nodeID int) (string, StdError)
FilePush 文件推送接口
func (*RPC) FileUpdate ¶
func (rpc *RPC) FileUpdate(fileUpdateTX *Transaction) StdError
FileUpdate 文件信息更新接口
func (*RPC) FileUpload ¶
func (rpc *RPC) FileUpload(filePath string, description string, userList []string, nodeIdList []int, pushNodes []int, accountJson string, password string) (string, StdError)
FileUpload 文件上传接口
func (*RPC) FirstPollInterval ¶
FirstPollInterval setter
func (*RPC) GetAccountStatus ¶
GetContractStatus 获取合约状态
func (*RPC) GetAccountsByRole ¶
GetAccountsByRole 根据角色获取账户
func (*RPC) GetAddressByName ¶
GetAddressByName get contract address by contract name
func (*RPC) GetAddressFromNode ¶
GetAddressFromNode get address by role in node
func (*RPC) GetAllRolesFromNode ¶
GetAllRolesFromNode get address by role in node
func (*RPC) GetAvgGenTimeByBlockNum ¶
GetAvgGenTimeByBlockNum calculates the average generation time of all blocks for the given block number.
func (*RPC) GetBalance ¶
GetBalance 获取账户余额
func (*RPC) GetBatchBlocksByHash ¶
GetBatchBlocksByHash returns a list of blocks by a list of specific block hash.
func (*RPC) GetBatchBlocksByNumber ¶
GetBatchBlocksByNumber returns a list of blocks by a list of specific block number.
func (*RPC) GetBatchReceipt ¶
GetBatchReceipt 批量获取回执
func (*RPC) GetBatchTxByHash ¶
func (rpc *RPC) GetBatchTxByHash(hashes []string) ([]TransactionInfo, StdError)
GetBatchTxByHash 批量获取交易
func (*RPC) GetBlkTxCountByHash ¶
GetBlkTxCountByHash 通过区块hash获取区块上交易数
func (*RPC) GetBlkTxCountByNumber ¶
GetBlkTxCountByNumber 通过区块number获取区块上交易数
func (*RPC) GetBlockByHash ¶
GetBlockByHash returns information about a block by hash. If the param isPlain value is true, it returns block excluding transactions. If false, it returns block including transactions.
func (*RPC) GetBlockByNumber ¶
GetBlockByNumber returns information about a block by number. If the param isPlain value is true, it returns block excluding transactions. If false, it returns block including transactions. blockNum can use `latest`, means get latest block
func (*RPC) GetBlocks ¶
Deprecated GetBlocks returns a list of blocks from start block number to end block number isPlain indicates if the result includes transaction information. if false, includes, otherwise not.
func (*RPC) GetBlocksByTime ¶
func (rpc *RPC) GetBlocksByTime(startTime, endTime uint64) (*BlockInterval, StdError)
GetBlocksByTime returns the number of blocks, starting block and ending block at specific time periods. startTime and endTime are timestamps
func (*RPC) GetBlocksWithLimit ¶
func (*RPC) GetChainHeight ¶
GetChainHeight returns the current chain height. result is hex string
func (*RPC) GetChainID ¶
func (*RPC) GetContractCountByAddr ¶
GetContractCountByAddr 获取合约数量
func (*RPC) GetContractStatus ¶
GetContractStatus 获取合约状态
func (*RPC) GetContractStatusByName ¶
GetContractStatusByName 获取合约状态
func (*RPC) GetCreateTime ¶
GetCreateTime 查询合约部署时间
func (*RPC) GetCreateTimeByName ¶
GetCreateTimeByName 查询合约部署时间
func (*RPC) GetCreator ¶
GetCreator 查询合约部署者
func (*RPC) GetCreatorByName ¶
GetCreatorByName 查询合约部署者
func (*RPC) GetCredentialPrimaryMessage ¶
func (rpc *RPC) GetCredentialPrimaryMessage(id string) (*DIDCredential, StdError)
func (*RPC) GetDIDDocument ¶
func (rpc *RPC) GetDIDDocument(didAddress string) (*DIDDocument, StdError)
func (*RPC) GetDeployedList ¶
GetDeployedList 获取已部署的合约列表
func (*RPC) GetDiscardTransactionsByTime ¶
func (rpc *RPC) GetDiscardTransactionsByTime(start, end uint64) ([]TransactionInfo, StdError)
GetDiscardTransactionsByTime 查询指定时间区间内的非法交易
func (*RPC) GetDiscardTx ¶
func (rpc *RPC) GetDiscardTx() ([]TransactionInfo, StdError)
GetDiscardTx 获取所有非法交易
func (*RPC) GetFileExtraByExtraId ¶
GetFileExtraByExtraId 通过extraId获取文件信息FileExtra
func (*RPC) GetFileExtraByFilter ¶
GetFileExtraByFilter 通过filter获取文件信息FileExtra
func (*RPC) GetFileExtraByTxHash ¶
GetFileExtraByTxHash 通过交易哈希获取文件信息FileExtra
func (*RPC) GetGenesisBlock ¶
GetGenesisBlock returns current genesis block number. result is hex string
func (*RPC) GetLatestBlock ¶
GetLatestBlock returns information about the latest block
func (*RPC) GetNameByAddress ¶
GetNameByAddress get contract name by contract address
func (*RPC) GetNextPageTxs ¶
func (rpc *RPC) GetNextPageTxs(blkNumber, txIndex, minBlkNumber, maxBlkNumber, separated, pageSize uint64, containCurrent bool, contractAddr string) ([]TransactionInfo, StdError)
GetNextPageTxs 获取下一页的交易
func (*RPC) GetNextPageTxsByName ¶
func (rpc *RPC) GetNextPageTxsByName(blkNumber, txIndex, minBlkNumber, maxBlkNumber, separated, pageSize uint64, containCurrent bool, contractName string) ([]TransactionInfo, StdError)
GetNextPageTxsByName 获取下一页的交易
func (*RPC) GetNodeChainID ¶
func (*RPC) GetNodeHashByID ¶
GetNodeHashByID 从指定节点获取hash
func (*RPC) GetNodeStates ¶
func (rpc *RPC) GetNodeStates() ([]NodeStateInfo, StdError)
GetNodeStates 获取节点状态信息
func (*RPC) GetPrevPageTxs ¶
func (rpc *RPC) GetPrevPageTxs(blkNumber, txIndex, minBlkNumber, maxBlkNumber, separated, pageSize uint64, containCurrent bool, contractAddr string) ([]TransactionInfo, StdError)
GetPrevPageTxs 获取上一页的交易
func (*RPC) GetPrevPageTxsByName ¶
func (rpc *RPC) GetPrevPageTxsByName(blkNumber, txIndex, minBlkNumber, maxBlkNumber, separated, pageSize uint64, containCurrent bool, contractName string) ([]TransactionInfo, StdError)
GetPrevPageTxs 获取上一页的交易
func (*RPC) GetPrivateTransactionByHash ¶
func (rpc *RPC) GetPrivateTransactionByHash(txHash string) (*TransactionInfo, StdError)
func (*RPC) GetProposal ¶
func (rpc *RPC) GetProposal() (*ProposalRaw, StdError)
func (*RPC) GetRoleFromNode ¶
GetRoleFromNode get account role in node
func (*RPC) GetRulesFromNode ¶
func (rpc *RPC) GetRulesFromNode() ([]*InspectorRule, StdError)
GetRulesFromNode get inspector rules for auth api in node
func (*RPC) GetSignHash ¶
func (rpc *RPC) GetSignHash(transaction *Transaction) (string, StdError)
GetSignHash 获取交易签名哈希
func (*RPC) GetTransactionByHash ¶
func (rpc *RPC) GetTransactionByHash(txHash string) (*TransactionInfo, StdError)
GetTransactionByHash 通过交易hash获取交易 参数txHash应该是"0x...."的形式
func (*RPC) GetTransactionsByBlkNum ¶
func (rpc *RPC) GetTransactionsByBlkNum(start, end uint64) ([]TransactionInfo, StdError)
Deprecated GetTransactionsByBlkNum 根据区块号查询范围内的交易
func (*RPC) GetTransactionsByBlkNumWithLimit ¶
func (rpc *RPC) GetTransactionsByBlkNumWithLimit(start, end uint64, metadata *Metadata) (*PageResult, StdError)
func (*RPC) GetTransactionsByExtraID ¶
func (rpc *RPC) GetTransactionsByExtraID(extraId []interface{}, txTo string, detail bool, mode int, metadata *Metadata) (*PageResult, StdError)
GetTransactionsByExtraID 根据extraID查询交易 extraId 为必选字段,其他字段可选
func (*RPC) GetTransactionsCountByMethodID ¶
func (rpc *RPC) GetTransactionsCountByMethodID(from, to uint64, address string, methodID string) (*TransactionsCountByContract, StdError)
GetTransactionsCountByMethodID 查询区块区间交易数量(by method ID)
func (*RPC) GetTransactionsCountByMethodIDAndContractName ¶
func (rpc *RPC) GetTransactionsCountByMethodIDAndContractName(from, to uint64, name string, methodID string) (*TransactionsCountByContract, StdError)
GetTransactionsCountByMethodIDAndContractName 查询区块区间交易数量(by method ID and contract name)
func (*RPC) GetTransactionsCountByTime ¶
GetTransactionsCountByTime 查询指定时间区间内的交易数量
func (*RPC) GetTxAvgTimeByBlockNumber ¶
GetTxAvgTimeByBlockNumber 通过区块号区间获取交易平均处理时间
func (*RPC) GetTxByBlkHashAndIdx ¶
func (rpc *RPC) GetTxByBlkHashAndIdx(blkHash string, index uint64) (*TransactionInfo, StdError)
GetTxByBlkHashAndIdx 通过区块hash和交易序号返回交易信息
func (*RPC) GetTxByBlkNumAndIdx ¶
func (rpc *RPC) GetTxByBlkNumAndIdx(blkNum, index uint64) (*TransactionInfo, StdError)
GetTxByBlkNumAndIdx 通过区块号和交易序号查询交易
func (*RPC) GetTxByTime ¶
func (rpc *RPC) GetTxByTime(start, end uint64) ([]TransactionInfo, StdError)
Deprecated GetTxByTime 根据范围时间戳查询交易信息
func (*RPC) GetTxByTimeAndContractAddrWithLimit ¶
func (rpc *RPC) GetTxByTimeAndContractAddrWithLimit(start, end uint64, metadata *Metadata, contractAddr string) (*PageTxs, StdError)
GetTxByTimeAndContractAddrWithLimit get txs by time and contract address with limit
func (*RPC) GetTxByTimeAndContractNameWithLimit ¶
func (rpc *RPC) GetTxByTimeAndContractNameWithLimit(start, end uint64, metadata *Metadata, contractName string) (*PageTxs, StdError)
GetTxByTimeAndContractNameWithLimit get txs by time and contract name with limit
func (*RPC) GetTxByTimeWithLimit ¶
func (*RPC) GetTxCount ¶
func (rpc *RPC) GetTxCount() (*TransactionsCount, StdError)
GetTxCount 获取链上所有交易数量
func (*RPC) GetTxCountByContractAddr ¶
func (rpc *RPC) GetTxCountByContractAddr(from, to uint64, address string, txExtra bool) (*TransactionsCountByContract, StdError)
GetTxCountByContractAddr 查询区块间指定合约的交易量 txExtra过滤是否带有额外字段
func (*RPC) GetTxCountByContractName ¶
func (rpc *RPC) GetTxCountByContractName(from, to uint64, name string, txExtra bool) (*TransactionsCountByContract, StdError)
GetTxCountByContractName 查询区块间指定合约的交易量 txExtra过滤是否带有额外字段
func (*RPC) GetTxReceipt ¶
GetTxReceipt 通过交易hash获取交易回执 参数txHash应该是"0x...."的形式
func (*RPC) GetTxReceiptByPolling ¶
GetTxReceiptByPolling get tx receipt by polling
func (*RPC) GetTxVersion ¶
func (*RPC) GetWebSocketClient ¶
func (rpc *RPC) GetWebSocketClient() *WebSocketClient
GetWebSocketClient 获取WebSocket客户端
func (*RPC) InvokeContract ¶
func (rpc *RPC) InvokeContract(transaction *Transaction) (*TxReceipt, StdError)
Deprecated InvokeContract invoke contract rpc
func (*RPC) InvokeContractReturnHash ¶
func (rpc *RPC) InvokeContractReturnHash(transaction *Transaction) (string, StdError)
InvokeContractReturnHash for pressure test Deprecated:
func (*RPC) ListSnapshot ¶
ListSnapshot returns all the existed snapshot information.
func (*RPC) ListenContract ¶
func (*RPC) MaintainContract ¶
func (rpc *RPC) MaintainContract(transaction *Transaction) (*TxReceipt, StdError)
Deprecated MaintainContract 管理合约 opcode 1.升级合约 2.冻结 3.解冻
func (*RPC) ManageContractByVote ¶
func (rpc *RPC) ManageContractByVote(transaction *Transaction) (*TxReceipt, StdError)
Deprecated ManageContractByVote manage contract by vote rpc
func (*RPC) Pending ¶
func (rpc *RPC) Pending() ([]SnapshotEvent, StdError)
Pending returns all pending snapshot requests in ascend sort.
func (*RPC) QueryArchive ¶
QueryArchive query archive status with the give snapshot.
func (*RPC) QueryArchiveExist ¶
QueryArchiveExist checks if the given snapshot has been archived.
func (*RPC) QueryLatestArchive ¶
func (rpc *RPC) QueryLatestArchive() (*ArchiveResult, StdError)
QueryLatestArchive query latest archive job status.
func (*RPC) QuerySnapshotExist ¶
QuerySnapshotExist checks if the given snapshot existed, so you can confirm that the last step Archive.Snapshot is successful.
func (*RPC) QueryTPS ¶
QueryTPS queries the block generation speed and tps within a given time range.
func (*RPC) ReadSnapshot ¶
ReadSnapshot returns the snapshot information for the given snapshot ID.
func (*RPC) Restore ¶
Restore restores datas that have been archived for given snapshot. If successful, returns true.
func (*RPC) RestoreAll ¶
RestoreAll restores all datas that have been archived. If successful, returns true.
func (*RPC) SecondPollInterval ¶
SecondPollInterval setter
func (*RPC) SendDIDTransaction ¶
func (rpc *RPC) SendDIDTransaction(transaction *Transaction, key interface{}) (*TxReceipt, StdError)
func (*RPC) SendTx ¶
func (rpc *RPC) SendTx(transaction *Transaction) (*TxReceipt, StdError)
Deprecated SendTx 同步发送交易
func (*RPC) SendTxReturnHash ¶
func (rpc *RPC) SendTxReturnHash(transaction *Transaction) (string, StdError)
SendTxReturnHash for pressure test Deprecated:
func (*RPC) SetAccount ¶
SetAccount set account key for sign request
func (*RPC) SetLocalChainID ¶
func (*RPC) SetRulesInNode ¶
func (rpc *RPC) SetRulesInNode(rules []*InspectorRule) StdError
SetRulesInNode set inspector rules for auth api in node
func (*RPC) SignAndDeployContract ¶
func (rpc *RPC) SignAndDeployContract(transaction *Transaction, key interface{}) (*TxReceipt, StdError)
SignAndDeployContract Deploy contract rpc
func (*RPC) SignAndInvokeContract ¶
func (rpc *RPC) SignAndInvokeContract(transaction *Transaction, key interface{}) (*TxReceipt, StdError)
SignAndInvokeContract invoke contract rpc
func (*RPC) SignAndInvokeContractCombineReturns ¶
func (rpc *RPC) SignAndInvokeContractCombineReturns(transaction *Transaction, key interface{}) (*TxReceipt, *TransactionInfo, StdError)
SignAndInvokeContractCombineReturns invoke contract rpc, return *TxReceipt and *TransactionInfo
func (*RPC) SignAndMaintainContract ¶
func (rpc *RPC) SignAndMaintainContract(transaction *Transaction, key interface{}) (*TxReceipt, StdError)
SignAndMaintainContract 管理合约 opcode 1.升级合约 2.冻结 3.解冻
func (*RPC) SignAndManageContractByVote ¶
func (rpc *RPC) SignAndManageContractByVote(transaction *Transaction, key interface{}) (*TxReceipt, StdError)
ManageContractByVote manage contract by vote rpc
func (*RPC) SignAndSendTx ¶
func (rpc *RPC) SignAndSendTx(transaction *Transaction, key interface{}) (*TxReceipt, StdError)
SignAndSendTx 同步发送交易并签名
type RegisterMeta ¶
type RegisterMeta struct { //queue related RoutingKeys []routingKey `json:"routingKeys,omitempty"` QueueName string `json:"queueName,omitempty"` //self info From string `json:"from,omitempty"` Signature string `json:"signature,omitempty"` // block accounts IsVerbose bool `json:"isVerbose"` // vm log criteria FromBlock string `json:"fromBlock,omitempty"` ToBlock string `json:"toBlock,omitempty"` Addresses []common.Address `json:"addresses,omitempty"` Topics [][]common.Hash `json:"topics,omitempty"` Delay bool `json:"delay"` }
RegisterMeta mq register
func NewRegisterMeta ¶
func NewRegisterMeta(from, queueName string, keys ...routingKey) *RegisterMeta
NewRegisterMeta create a new instance of RegisterMeta
func (*RegisterMeta) AddAddress ¶
func (rm *RegisterMeta) AddAddress(address ...common.Address) *RegisterMeta
AddAddress add address
func (*RegisterMeta) Serialize ¶
func (rm *RegisterMeta) Serialize() interface{}
Serialize Serialize
func (*RegisterMeta) SerializeToString ¶
func (rm *RegisterMeta) SerializeToString() string
SerializeToString SerializeToString
func (*RegisterMeta) SetDelay ¶
func (rm *RegisterMeta) SetDelay(delay bool) *RegisterMeta
SetDelay set delay
func (*RegisterMeta) SetFromBlock ¶
func (rm *RegisterMeta) SetFromBlock(from string) *RegisterMeta
SetFromBlock set from block
func (*RegisterMeta) SetToBlock ¶
func (rm *RegisterMeta) SetToBlock(to string) *RegisterMeta
SetToBlock set to block
func (*RegisterMeta) SetTopics ¶
func (rm *RegisterMeta) SetTopics(pos int, topics ...common.Hash) *RegisterMeta
SetTopics set topic
func (*RegisterMeta) Verbose ¶
func (rm *RegisterMeta) Verbose(v bool) *RegisterMeta
Verbose node info is verbose
type RequestType ¶
type RequestType string
const ( GENERAL RequestType = "GENERAL" UPLOAD RequestType = "UPLOAD" DOWNLOAD RequestType = "DOWNLOAD" )
type RetError ¶
type RetError struct {
// contains filtered or unexported fields
}
RetError is packaged ret code and message
type RpcStatistic ¶
type Snapshot ¶
type Snapshot struct { Height uint64 Hash string FilterID string MerkleRoot string Date string Namespace string }
Snapshot is packaged result of snapshot
type SnapshotEvent ¶
type SnapshotEvent struct { FilterID string `json:"filterId"` BlockNumber uint64 `json:"blockNumber"` }
SnapshotEvent SnapshotEvent
type StdError ¶
StdError is a interface of code and error info
func NewGetResponseError ¶
NewGetResponseError is used to construct StdError
func NewHttpResponseError ¶
NewHttpResponseError is used to construct StdError by HTTP error
func NewRequestTimeoutError ¶
NewRequestTimeoutError is used to construct StdError
func NewServerError ¶
NewServerError is used to construct RetError
func NewSystemError ¶
NewSystemError is used to construct StdError
type Subscription ¶
type Subscription struct { Event EventType `json:"event"` SubscriptionID SubscriptionID `json:"subId"` }
Subscription -
type SystemStatusFilter ¶
type SystemStatusFilter struct { Modules []string `json:"modules,omitempty"` ModulesExclude []string `json:"modules_exclude,omitempty"` Subtypes []string `json:"subtypes,omitempty"` SubtypesExclude []string `json:"subtypes_exclude,omitempty"` ErrorCodes []string `json:"error_codes,omitempty"` ErrorCodesExclude []string `json:"error_codes_exclude,omitempty"` // contains filtered or unexported fields }
SystemStatusFilter system status filter
func NewSystemStatusFilter ¶
func NewSystemStatusFilter() *SystemStatusFilter
NewSystemStatusFilter init SystemStatusFilter
func (*SystemStatusFilter) AddErrorCode ¶
func (ssf *SystemStatusFilter) AddErrorCode(errorCodes ...string) *SystemStatusFilter
AddErrorCode add error code into filter
func (*SystemStatusFilter) AddErrorCodeExclude ¶
func (ssf *SystemStatusFilter) AddErrorCodeExclude(errorCodesExclude ...string) *SystemStatusFilter
AddErrorCodeExclude add error code exclude into filter
func (*SystemStatusFilter) AddModules ¶
func (ssf *SystemStatusFilter) AddModules(modules ...string) *SystemStatusFilter
AddModules add modules into filter
func (*SystemStatusFilter) AddModulesExclude ¶
func (ssf *SystemStatusFilter) AddModulesExclude(modulesExclude ...string) *SystemStatusFilter
AddModulesExclude add modules exclude into filter
func (*SystemStatusFilter) AddSubtypes ¶
func (ssf *SystemStatusFilter) AddSubtypes(subtypes ...string) *SystemStatusFilter
AddSubtypes add subtype into filter
func (*SystemStatusFilter) AddSubtypesExclude ¶
func (ssf *SystemStatusFilter) AddSubtypesExclude(subtypesExclude ...string) *SystemStatusFilter
AddSubtypesExclude add subtypesExclude into filter
func (*SystemStatusFilter) GetEventType ¶
func (ssf *SystemStatusFilter) GetEventType() EventType
GetEventType get event type
func (*SystemStatusFilter) Serialize ¶
func (ssf *SystemStatusFilter) Serialize() interface{}
Serialize serialize
type TCertManager ¶
type TCertManager struct {
// contains filtered or unexported fields
}
TCertManager manager tcert
func NewTCertManager ¶
func NewTCertManager(vip *viper.Viper, confRootPath string) *TCertManager
NewTCertManager create a new TCert manager
type TPSInfo ¶
type TPSInfo struct { StartTime string EndTime string TotalBlockNum uint64 BlocksPerSec float64 Tps float64 }
TPSInfo describe the TPS related information
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction transaction entity
func NewPrivateTransaction ¶
func NewPrivateTransaction(from string, participants []string) *Transaction
NewPrivateTransaction return a empty private transaction
func NewTransaction ¶
func NewTransaction(from string) *Transaction
NewTransaction return a empty transaction
func (*Transaction) Deploy ¶
func (t *Transaction) Deploy(payload string) *Transaction
Deploy add transaction isDeploy
func (*Transaction) DeployArgs ¶
func (t *Transaction) DeployArgs(abiString string, args ...interface{}) *Transaction
DeployArgs add transaction deploy args
func (*Transaction) DeployStringArgs ¶
func (t *Transaction) DeployStringArgs(abiString string, args ...interface{}) *Transaction
DeployArgs add transaction deploy string args (args should be string or []interface{})
func (*Transaction) DestroyCredential ¶
func (t *Transaction) DestroyCredential(credentialID string) *Transaction
func (*Transaction) DownloadCredential ¶
func (t *Transaction) DownloadCredential(credentialID string) *Transaction
func (*Transaction) Extra ¶
func (t *Transaction) Extra(extra string) *Transaction
Extra add extra into transaction
func (*Transaction) GetExtraIdString ¶
func (t *Transaction) GetExtraIdString() (string, error)
GetExtraIdString get extraId string
func (*Transaction) GetTransactionHash ¶
func (t *Transaction) GetTransactionHash(gasLimit int64) string
func (*Transaction) Invoke ¶
func (t *Transaction) Invoke(to string, payload []byte) *Transaction
Invoke add transaction isInvoke
func (*Transaction) InvokeByName ¶
func (t *Transaction) InvokeByName(name string, payload []byte) *Transaction
Invoke add transaction isInvoke
func (*Transaction) InvokeContract ¶
func (t *Transaction) InvokeContract(to string, rawAbi string, funcName string, args ...string) *Transaction
Deprecated InvokeContract invoke evm contract by raw ABI, function name and arguments in string format use abi.Encode instead
func (*Transaction) InvokeSql ¶
func (t *Transaction) InvokeSql(to string, payload []byte) *Transaction
func (*Transaction) KVExtra ¶
func (t *Transaction) KVExtra(kvExtra *KVExtra) *Transaction
func (*Transaction) Maintain ¶
func (t *Transaction) Maintain(op int64, to, payload string) *Transaction
Maintain maintain contract transaction
func (*Transaction) MaintainByName ¶
func (t *Transaction) MaintainByName(op int64, name, payload string) *Transaction
MaintainByName maintain contract transaction by contract name
func (*Transaction) MaintainDID ¶
func (t *Transaction) MaintainDID(to string, op int64) *Transaction
func (*Transaction) Nonce ¶
func (t *Transaction) Nonce(nonce int64) *Transaction
Nonce add transaction nonce
func (*Transaction) OpCode ¶
func (t *Transaction) OpCode(op int64) *Transaction
OpCode add transaction opCode
func (*Transaction) Payload ¶
func (t *Transaction) Payload(payload string) *Transaction
Payload add transaction payload
func (*Transaction) PreSign ¶
func (t *Transaction) PreSign(key account.Key)
PreSign is used to constructor extra field in private transaction
func (*Transaction) Register ¶
func (t *Transaction) Register(document *DIDDocument) *Transaction
func (*Transaction) Serialize ¶
func (t *Transaction) Serialize() interface{}
Serialize serialize the tx instance to a map
func (*Transaction) SerializeToString ¶
func (t *Transaction) SerializeToString() string
SerializeToString serialize the tx instance to json string
func (*Transaction) SetCName ¶
func (t *Transaction) SetCName(cName string)
func (*Transaction) SetExtra ¶
func (t *Transaction) SetExtra(extra string)
func (*Transaction) SetExtraIDInt64 ¶
func (t *Transaction) SetExtraIDInt64(extraId ...int64)
SetExtraIDInt64 set transaction int64 extraId
func (*Transaction) SetExtraIDString ¶
func (t *Transaction) SetExtraIDString(extraId ...string)
SetExtraIDString set transaction string extraId
func (*Transaction) SetFrom ¶
func (t *Transaction) SetFrom(from string)
func (*Transaction) SetHasExtra ¶
func (t *Transaction) SetHasExtra(hasExtra bool)
func (*Transaction) SetIsByName ¶
func (t *Transaction) SetIsByName(isByName bool)
func (*Transaction) SetIsDeploy ¶
func (t *Transaction) SetIsDeploy(isDeploy bool)
func (*Transaction) SetIsInvoke ¶
func (t *Transaction) SetIsInvoke(isInvoke bool)
func (*Transaction) SetIsMaintain ¶
func (t *Transaction) SetIsMaintain(isMaintain bool)
func (*Transaction) SetIsPrivateTxm ¶
func (t *Transaction) SetIsPrivateTxm(isPrivateTx bool)
func (*Transaction) SetIsValue ¶
func (t *Transaction) SetIsValue(isValue bool)
func (*Transaction) SetKvExtra ¶
func (t *Transaction) SetKvExtra(kvExtra *KVExtra)
func (*Transaction) SetNonce ¶
func (t *Transaction) SetNonce(nonce int64)
func (*Transaction) SetOpcode ¶
func (t *Transaction) SetOpcode(opcode int64)
func (*Transaction) SetOptionExtra ¶
func (t *Transaction) SetOptionExtra(option string)
SetExtraIDString set transaction string extraId
func (*Transaction) SetParticipants ¶
func (t *Transaction) SetParticipants(participants []string)
func (*Transaction) SetPayload ¶
func (t *Transaction) SetPayload(payload string)
func (*Transaction) SetSignature ¶
func (t *Transaction) SetSignature(signature string)
func (*Transaction) SetSimulate ¶
func (t *Transaction) SetSimulate(simulate bool)
func (*Transaction) SetTimestamp ¶
func (t *Transaction) SetTimestamp(timestamp int64)
func (*Transaction) SetTo ¶
func (t *Transaction) SetTo(to string)
func (*Transaction) SetValue ¶
func (t *Transaction) SetValue(value int64)
func (*Transaction) SetVmType ¶
func (t *Transaction) SetVmType(vmType string)
func (*Transaction) Sign ¶
func (t *Transaction) Sign(key interface{})
Sign support ecdsa\SM2\Ed25519 signature
func (*Transaction) SignWithBatchFlag ¶
func (t *Transaction) SignWithBatchFlag(key interface{})
SignWIthBatch support ecdsa\SM2\Ed25519 signature Only affect sm2 signature, other types (ED25519/ECDSA) are the same as Sign Only flato 1.0.2 +
func (*Transaction) SignWithClang ¶
func (t *Transaction) SignWithClang(key interface{})
func (*Transaction) Signature ¶
func (t *Transaction) Signature(signature string) *Transaction
Signature add transaction signature
func (*Transaction) Simulate ¶
func (t *Transaction) Simulate(simulate bool) *Transaction
Simulate add transaction simulate
func (*Transaction) Timestamp ¶
func (t *Transaction) Timestamp(timestamp int64) *Transaction
Timestamp add transaction timestamp
func (*Transaction) Transfer ¶
func (t *Transaction) Transfer(to string, value int64) *Transaction
Transfer transfer balance to account
func (*Transaction) UpdateAdmins ¶
func (t *Transaction) UpdateAdmins(to string, admins []string) *Transaction
func (*Transaction) UpdatePublicKey ¶
func (t *Transaction) UpdatePublicKey(to string, puKey *DIDPublicKey) *Transaction
func (*Transaction) UploadCredential ¶
func (t *Transaction) UploadCredential(credential *DIDCredential) *Transaction
func (*Transaction) VMType ¶
func (t *Transaction) VMType(vmType VMType) *Transaction
VMType add transaction vmType
func (*Transaction) Value ¶
func (t *Transaction) Value(value int64) *Transaction
Value add transaction value
type TransactionInfo ¶
type TransactionInfo struct { Version string Hash string BlockNumber uint64 BlockHash string TxIndex uint64 From string To string CName string Amount uint64 Timestamp uint64 Nonce uint64 ExecuteTime int64 Payload string Extra string Invalid bool InvalidMsg string BlockTimestamp int64 BlockWriteTime int64 }
TransactionInfo is packaged result of TransactionInfo
type TransactionPageArg ¶
type TransactionPageArg struct { BlkNumber string `json:"blkNumber,omitempty"` MaxBlkNumber string `json:"maxBlkNumber,omitempty"` MinBlkNumber string `json:"minBlkNumber,omitempty"` TxIndex uint64 `json:"txIndex,omitempty"` Separated uint64 `json:"separated,omitempty"` PageSize uint64 `json:"pageSize,omitempty"` ContainCurrent bool `json:"containCurrent,omitempty"` Address string `json:"address,omitempty"` CName string `json:"cName,omitempty"` }
TransactionPageArg is packaged result of transaction page
type TransactionRaw ¶
type TransactionRaw struct { Version string `json:"version"` // hyperchain version when the transaction is executed Hash string `json:"hash"` // transaction hash BlockNumber string `json:"blockNumber,omitempty"` // block number where this transaction was in BlockHash string `json:"blockHash,omitempty"` // hash of the block where this transaction was in TxIndex string `json:"txIndex,omitempty"` // transaction index in the block From string `json:"from"` // the address of sender To string `json:"to"` // the address of receiver CName string `json:"CName,omitempty"` // contract name Amount string `json:"amount,omitempty"` // transfer amount Timestamp int64 `json:"timestamp"` // the unix timestamp for when the transaction was generated Nonce int64 `json:"nonce"` Extra string `json:"extra"` ExtraID []interface{} `json:"extraId,omitempty"` ExecuteTime string `json:"executeTime,omitempty"` // the time it takes to execute the transaction Payload string `json:"payload,omitempty"` Invalid bool `json:"invalid,omitempty"` // indicate whether it is invalid or not InvalidMsg string `json:"invalidMsg,omitempty"` // if Invalid is true, printing invalid message Signature string `json:"signature,omitempty"` BlockTimestamp int64 `json:"blockTimestamp,omitempty"` // the unix timestamp for when the transaction was batched BlockWriteTime int64 `json:"blockWriteTime,omitempty"` // the unix timestamp for when the transaction was written }
TransactionRaw is packaged result of TransactionRaw
func (*TransactionRaw) ToTransaction ¶
func (t *TransactionRaw) ToTransaction() (*TransactionInfo, StdError)
ToTransaction is used to transform PlainBlockRaw to PlainBlock
type TransactionValue ¶
type TransactionValue struct { Price int64 `protobuf:"varint,1,opt,name=price,proto3" json:"price,omitempty"` GasLimit int64 `protobuf:"varint,2,opt,name=gasLimit,proto3" json:"gasLimit,omitempty"` Amount int64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` EncryptedAmount []byte `protobuf:"bytes,5,opt,name=encryptedAmount,proto3" json:"encryptedAmount,omitempty"` HomomorphicAmount []byte `protobuf:"bytes,6,opt,name=homomorphicAmount,proto3" json:"homomorphicAmount,omitempty"` HomomorphicBalance []byte `protobuf:"bytes,7,opt,name=homomorphicBalance,proto3" json:"homomorphicBalance,omitempty"` Op TransactionValue_Opcode `protobuf:"varint,8,opt,name=op,proto3,enum=rpc.TransactionValue_Opcode" json:"op,omitempty"` Extra []byte `protobuf:"bytes,9,opt,name=extra,proto3" json:"extra,omitempty"` ExtraId []byte `protobuf:"bytes,10,opt,name=extraId,proto3" json:"extraId,omitempty"` VmType TransactionValue_VmType `protobuf:"varint,11,opt,name=vmType,proto3,enum=rpc.TransactionValue_VmType" json:"vmType,omitempty"` }
func (*TransactionValue) Descriptor ¶
func (*TransactionValue) Descriptor() ([]byte, []int)
func (*TransactionValue) GetAmount ¶
func (m *TransactionValue) GetAmount() int64
func (*TransactionValue) GetEncryptedAmount ¶
func (m *TransactionValue) GetEncryptedAmount() []byte
func (*TransactionValue) GetExtra ¶
func (m *TransactionValue) GetExtra() []byte
func (*TransactionValue) GetExtraId ¶
func (m *TransactionValue) GetExtraId() []byte
func (*TransactionValue) GetGasLimit ¶
func (m *TransactionValue) GetGasLimit() int64
func (*TransactionValue) GetHomomorphicAmount ¶
func (m *TransactionValue) GetHomomorphicAmount() []byte
func (*TransactionValue) GetHomomorphicBalance ¶
func (m *TransactionValue) GetHomomorphicBalance() []byte
func (*TransactionValue) GetOp ¶
func (m *TransactionValue) GetOp() TransactionValue_Opcode
func (*TransactionValue) GetPayload ¶
func (m *TransactionValue) GetPayload() []byte
func (*TransactionValue) GetPrice ¶
func (m *TransactionValue) GetPrice() int64
func (*TransactionValue) GetVmType ¶
func (m *TransactionValue) GetVmType() TransactionValue_VmType
func (*TransactionValue) Marshal ¶
func (m *TransactionValue) Marshal() (dAtA []byte, err error)
func (*TransactionValue) ProtoMessage ¶
func (*TransactionValue) ProtoMessage()
func (*TransactionValue) Reset ¶
func (m *TransactionValue) Reset()
func (*TransactionValue) Size ¶
func (m *TransactionValue) Size() (n int)
func (*TransactionValue) String ¶
func (m *TransactionValue) String() string
func (*TransactionValue) Unmarshal ¶
func (m *TransactionValue) Unmarshal(dAtA []byte) error
func (*TransactionValue) XXX_DiscardUnknown ¶
func (m *TransactionValue) XXX_DiscardUnknown()
func (*TransactionValue) XXX_Marshal ¶
func (m *TransactionValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TransactionValue) XXX_Merge ¶
func (m *TransactionValue) XXX_Merge(src proto.Message)
func (*TransactionValue) XXX_Size ¶
func (m *TransactionValue) XXX_Size() int
func (*TransactionValue) XXX_Unmarshal ¶
func (m *TransactionValue) XXX_Unmarshal(b []byte) error
type TransactionValue_Opcode ¶
type TransactionValue_Opcode int32
const ( TransactionValue_NORMAL TransactionValue_Opcode = 0 TransactionValue_UPDATE TransactionValue_Opcode = 1 TransactionValue_FREEZE TransactionValue_Opcode = 2 TransactionValue_UNFREEZE TransactionValue_Opcode = 3 TransactionValue_SKIPVM TransactionValue_Opcode = 4 TransactionValue_ARCHIVE TransactionValue_Opcode = 100 )
func (TransactionValue_Opcode) EnumDescriptor ¶
func (TransactionValue_Opcode) EnumDescriptor() ([]byte, []int)
func (TransactionValue_Opcode) String ¶
func (x TransactionValue_Opcode) String() string
type TransactionValue_VmType ¶
type TransactionValue_VmType int32
const ( TransactionValue_EVM TransactionValue_VmType = 0 TransactionValue_JVM TransactionValue_VmType = 1 TransactionValue_HVM TransactionValue_VmType = 2 TransactionValue_BVM TransactionValue_VmType = 3 TransactionValue_TRANSFER TransactionValue_VmType = 4 TransactionValue_KVSQL TransactionValue_VmType = 5 )
func (TransactionValue_VmType) EnumDescriptor ¶
func (TransactionValue_VmType) EnumDescriptor() ([]byte, []int)
func (TransactionValue_VmType) String ¶
func (x TransactionValue_VmType) String() string
type TransactionsCount ¶
TransactionsCount is packaged result of transactionsCount
type TransactionsCountByContract ¶
TransactionsCountByContract is packaged result of transaction code
type TransactionsCountByContractRaw ¶
TransactionsCountByContractRaw is packaged result of transaction code
func (*TransactionsCountByContractRaw) ToTransactionsCountByContract ¶
func (tc *TransactionsCountByContractRaw) ToTransactionsCountByContract() (*TransactionsCountByContract, error)
ToTransactionsCountByContract transform to TransactionsCountByContract
type TransactionsCountRaw ¶
TransactionsCountRaw is packaged result of transactionCount
func (*TransactionsCountRaw) ToTransactionsCount ¶
func (tr *TransactionsCountRaw) ToTransactionsCount() (*TransactionsCount, error)
ToTransactionsCount is used to transform TransactionsCountRaw to TransactionCount
type TxLog ¶
type TxLog struct { Address string Topics []string Data string BlockNumber uint64 TxHash string TxIndex uint64 Index uint64 }
TxLog is packaged result of transaction log
type TxReceipt ¶
type TxReceipt struct { TxHash string PrivTxHash string ContractAddress string ContractName string Ret string Log []TxLog VMType string Version string Valid bool ErrorMsg string GasUsed int64 }
TxReceipt is packaged result of transaction receipt
type TxVersionInt ¶
type TxVersionInt int
const ( TxVersion10 TxVersionInt = 1 TxVersion20 TxVersionInt = 2 TxVersion21 TxVersionInt = 3 TxVersion22 TxVersionInt = 4 TxVersion23 TxVersionInt = 5 TxVersion24 TxVersionInt = 6 TxVersion25 TxVersionInt = 7 TxVersion26 TxVersionInt = 8 TxVersion27 TxVersionInt = 9 TxVersion28 TxVersionInt = 10 TxVersion29 TxVersionInt = 11 TxVersion30 TxVersionInt = 12 )
func GetTxVersionInt ¶
func GetTxVersionInt(txVersionStr string) TxVersionInt
type UnRegisterMeta ¶
UnRegisterMeta UnRegisterMeta
func NewUnRegisterMeta ¶
func NewUnRegisterMeta(from, queue, exchange string) *UnRegisterMeta
NewUnRegisterMeta create new instance
func (*UnRegisterMeta) Sign ¶
func (urm *UnRegisterMeta) Sign(key interface{})
Sign sign UnRegisterMeta
type ValidResult ¶
type WebSocketClient ¶
type WebSocketClient struct {
// contains filtered or unexported fields
}
WebSocketClient control the all APIs web socket related APIs
func (*WebSocketClient) CloseConn ¶
func (wscli *WebSocketClient) CloseConn(nodeIndex int) StdError
CloseConn is used to close the connection of a specific node note: nodeIndex start from 1
func (*WebSocketClient) GetAllSubscription ¶
func (wscli *WebSocketClient) GetAllSubscription(nodeIndex int) ([]Subscription, StdError)
GetAllSubscription get all subscriptions of a specific node note: nodeIndex start from 1
func (*WebSocketClient) Subscribe ¶
func (wscli *WebSocketClient) Subscribe(nodeIndex int, filter EventFilter, eventHandler WsEventHandler) (SubscriptionID, StdError)
Subscribe is used to subscribe event(s) of the specific node, the user-defined callback will be called when events that fulfill the filters occurred. note: nodeIndex start from 1
func (*WebSocketClient) SubscribeForProposal ¶
func (wscli *WebSocketClient) SubscribeForProposal(nodeIndex int, eventHandler WsEventHandler) (SubscriptionID, StdError)
SubscribeForProposal is used to subscribe logs about proposal of the specific node, the user-defined callback will be called when proposal status been changed. note: nodeIndex start from 1
func (*WebSocketClient) UnSubscribe ¶
func (wscli *WebSocketClient) UnSubscribe(id SubscriptionID) StdError
UnSubscribe is used to unsubscribe a event by subID and user will not be notified by the event once the method called
type WebSocketNotification ¶
type WebSocketNotification struct { Event string `json:"event"` Subscription SubscriptionID `json:"subscription"` Data json.RawMessage `json:"data"` }
WebSocketNotification represents the notification data structure
type WsEventHandler ¶
type WsEventHandler interface { // when subscribe success OnSubscribe() // when unsubscribe OnUnSubscribe() // when receive notification OnMessage([]byte) // when connection closed OnClose() }
WsEventHandler web socket event handler note: if you unsubscribe a event, the OnClose() will never be called even if the connection is closed