Documentation ¶
Index ¶
- Constants
- func GetAPIs(backend sbchapi.BackendService, logger log.Logger, testKeys []string) []rpc.API
- type AccountRWOp
- type BlockHashOp
- type BytecodeRWOp
- type CCEpoch
- type CCTransferInfo
- type CallDetail
- type CallLog
- type CreationCounterRWOp
- type DebugAPI
- type EthashAPI
- type InternalTx
- type Nomination
- type OnlineInfoToMarshal
- type PosVote
- type PublicEthAPI
- type PublicNetAPI
- type PublicTxPoolAPI
- type PublicWeb3API
- type RWLists
- type SbchAPI
- type StakingEpoch
- type Stats
- type StorageRWOp
- type ValidatorOnlineInfosToMarshal
- type ValidatorWatchInfosToMarshal
- type WatchInfoToMarshal
Constants ¶
View Source
const ( // DefaultGasPrice is default gas price for evm transactions DefaultGasPrice = 20000000000 // DefaultRPCGasLimit is default gas limit for RPC call operations DefaultRPCGasLimit = 10000000 )
View Source
const (
StatusUpdateInterval = 60 // seconds
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountRWOp ¶ added in v0.4.0
type BlockHashOp ¶ added in v0.4.0
type BytecodeRWOp ¶ added in v0.4.0
type CCTransferInfo ¶ added in v0.4.0
type CallDetail ¶ added in v0.4.0
type CallDetail struct { Status int `json:"status"` GasUsed hexutil.Uint64 `json:"gasUsed"` OutData hexutil.Bytes `json:"returnData"` Logs []*CallLog `json:"logs"` CreatedContractAddress gethcmn.Address `json:"contractAddress"` InternalTxs []*InternalTx `json:"internalTransactions"` RwLists *RWLists `json:"rwLists"` }
func TxToRpcCallDetail ¶ added in v0.4.0
func TxToRpcCallDetail(tx *motypes.Transaction) *CallDetail
type CreationCounterRWOp ¶ added in v0.4.0
type DebugAPI ¶ added in v0.3.6
type DebugAPI interface { GetStats() Stats GetSeq(addr gethcmn.Address) hexutil.Uint64 NodeInfo() json.RawMessage ValidatorOnlineInfos() json.RawMessage ValidatorWatchInfos() json.RawMessage }
type InternalTx ¶ added in v0.3.6
type InternalTx struct { CallPath string `json:"callPath"` From gethcmn.Address `json:"from"` To gethcmn.Address `json:"to"` GasLimit hexutil.Uint64 `json:"gas"` Value *hexutil.Big `json:"value"` Input hexutil.Bytes `json:"input"` StatusCode hexutil.Uint64 `json:"status"` GasUsed hexutil.Uint64 `json:"gasUsed"` Output hexutil.Bytes `json:"output"` CreatedAddress *gethcmn.Address `json:"contractAddress,omitempty"` // contains filtered or unexported fields }
TODO: rename file to sbch_rpc_types.go
type Nomination ¶ added in v0.3.6
type OnlineInfoToMarshal ¶ added in v0.4.5
type PublicEthAPI ¶
type PublicEthAPI interface { Accounts() ([]common.Address, error) BlockNumber() (hexutil.Uint64, error) Call(args rpctypes.CallArgs, blockNrOrHash gethrpc.BlockNumberOrHash) (hexutil.Bytes, error) ChainId() hexutil.Uint64 Coinbase() (common.Address, error) EstimateGas(args rpctypes.CallArgs, blockNrOrHash *gethrpc.BlockNumberOrHash) (hexutil.Uint64, error) GasPrice() *hexutil.Big GetBalance(addr common.Address, blockNrOrHash gethrpc.BlockNumberOrHash) (*hexutil.Big, error) GetBlockByHash(hash common.Hash, fullTx bool) (map[string]interface{}, error) GetBlockByNumber(blockNum gethrpc.BlockNumber, fullTx bool) (map[string]interface{}, error) GetBlockTransactionCountByHash(hash common.Hash) *hexutil.Uint GetBlockTransactionCountByNumber(blockNum gethrpc.BlockNumber) *hexutil.Uint GetCode(addr common.Address, blockNrOrHash gethrpc.BlockNumberOrHash) (hexutil.Bytes, error) GetStorageAt(addr common.Address, key string, blockNrOrHash gethrpc.BlockNumberOrHash) (hexutil.Bytes, error) GetTransactionByBlockHashAndIndex(hash common.Hash, idx hexutil.Uint) (*rpctypes.Transaction, error) GetTransactionByBlockNumberAndIndex(blockNum gethrpc.BlockNumber, idx hexutil.Uint) (*rpctypes.Transaction, error) GetTransactionByHash(hash common.Hash) (*rpctypes.Transaction, error) GetTransactionCount(addr common.Address, blockNrOrHash gethrpc.BlockNumberOrHash) (*hexutil.Uint64, error) GetTransactionReceipt(hash common.Hash) (map[string]interface{}, error) GetUncleByBlockHashAndIndex(hash common.Hash, idx hexutil.Uint) map[string]interface{} GetUncleByBlockNumberAndIndex(number hexutil.Uint, idx hexutil.Uint) map[string]interface{} GetUncleCountByBlockHash(_ common.Hash) hexutil.Uint GetUncleCountByBlockNumber(_ gethrpc.BlockNumber) hexutil.Uint ProtocolVersion() hexutil.Uint SendRawTransaction(data hexutil.Bytes) (common.Hash, error) // ? SendTransaction(args rpctypes.SendTxArgs) (common.Hash, error) Syncing() (interface{}, error) }
type PublicNetAPI ¶
type PublicTxPoolAPI ¶ added in v0.1.6
type PublicWeb3API ¶
type RWLists ¶ added in v0.4.0
type RWLists struct { CreationCounterRList []CreationCounterRWOp `json:"creationCounterRList"` CreationCounterWList []CreationCounterRWOp `json:"creationCounterWList"` AccountRList []AccountRWOp `json:"accountRList"` AccountWList []AccountRWOp `json:"accountWList"` BytecodeRList []BytecodeRWOp `json:"bytecodeRList"` BytecodeWList []BytecodeRWOp `json:"bytecodeWList"` StorageRList []StorageRWOp `json:"storageRList"` StorageWList []StorageRWOp `json:"storageWList"` BlockHashList []BlockHashOp `json:"blockHashList"` }
type SbchAPI ¶
type SbchAPI interface { GetStandbyTxQueue() QueryTxBySrc(addr gethcmn.Address, startHeight, endHeight gethrpc.BlockNumber, limit hexutil.Uint64) ([]*rpctypes.Transaction, error) QueryTxByDst(addr gethcmn.Address, startHeight, endHeight gethrpc.BlockNumber, limit hexutil.Uint64) ([]*rpctypes.Transaction, error) QueryTxByAddr(addr gethcmn.Address, startHeight, endHeight gethrpc.BlockNumber, limit hexutil.Uint64) ([]*rpctypes.Transaction, error) QueryLogs(addr gethcmn.Address, topics []gethcmn.Hash, startHeight, endHeight gethrpc.BlockNumber, limit hexutil.Uint64) ([]*gethtypes.Log, error) GetTxListByHeight(height gethrpc.BlockNumber) ([]map[string]interface{}, error) GetTxListByHeightWithRange(height gethrpc.BlockNumber, start, end hexutil.Uint64) ([]map[string]interface{}, error) GetAddressCount(kind string, addr gethcmn.Address) hexutil.Uint64 GetSep20AddressCount(kind string, contract, addr gethcmn.Address) hexutil.Uint64 GetEpochs(start, end hexutil.Uint64) ([]*types.Epoch, error) GetEpochList(from string) ([]*StakingEpoch, error) GetCurrEpoch(includesPosVotes *bool) (*StakingEpoch, error) GetCCEpochs(start, end hexutil.Uint64) ([]*cctypes.CCEpoch, error) GetCCEpochs2(start, end hexutil.Uint64) ([]*CCEpoch, error) // result is more human-readable HealthCheck(latestBlockTooOldAge hexutil.Uint64) map[string]interface{} GetTransactionReceipt(hash gethcmn.Hash) (map[string]interface{}, error) GetTransactionReceiptWithSig(hash gethcmn.Hash) (map[string]interface{}, error) Call(args rpctypes.CallArgs, blockNr gethrpc.BlockNumberOrHash) (*CallDetail, error) ValidatorsInfo(blockNr gethrpc.BlockNumberOrHash) json.RawMessage GetSyncBlock(height hexutil.Uint64) (hexutil.Bytes, error) SetRpcKey(key string) error GetRpcPubkey() (string, error) }
type StakingEpoch ¶ added in v0.3.6
type Stats ¶ added in v0.3.6
type Stats struct { NumGoroutine int `json:"numGoroutine"` NumGC uint32 `json:"numGC"` MemAllocMB uint64 `json:"memAllocMB"` MemSysMB uint64 `json:"memSysMB"` OsMemTotalMB uint64 `json:"osMemTotalMB"` OsMemUsedMB uint64 `json:"osMemUsedMB"` OsMemCachedMB uint64 `json:"osMemCachedMB"` OsMemFreeMB uint64 `json:"osMemFreeMB"` OsMemActiveMB uint64 `json:"osMemActiveMB"` OsMemInactiveMB uint64 `json:"osMemInactiveMB"` OsMemSwapTotalMB uint64 `json:"osMemSwapTotalMB"` OsMemSwapUsedMB uint64 `json:"osMemSwapUsedMB"` OsMemSwapFreeMB uint64 `json:"osMemSwapFreeMB"` NumEthCall uint64 `json:"numEthCall"` }
type StorageRWOp ¶ added in v0.4.0
type ValidatorOnlineInfosToMarshal ¶ added in v0.4.5
type ValidatorOnlineInfosToMarshal struct { StartHeight int64 `json:"start_height"` EndHeight int64 `json:"end_height"` OnlineInfos []*OnlineInfoToMarshal `json:"online_infos"` ValidatorsMaybeSlashed []gethcmn.Address `json:"validators_maybe_slashed"` }
type ValidatorWatchInfosToMarshal ¶ added in v0.5.1
type ValidatorWatchInfosToMarshal struct { StartHeight int64 `json:"start_height"` EndHeight int64 `json:"end_height"` WatchInfos []*WatchInfoToMarshal `json:"online_infos"` }
type WatchInfoToMarshal ¶ added in v0.5.1
Source Files ¶
Click to show internal directories.
Click to hide internal directories.