Documentation ¶
Index ¶
- Constants
- func TimeoutHandler(h http.Handler, dt time.Duration, msg string) http.Handler
- type BackupChainArgs
- type BackupChainCorrectionArgs
- type BackupChainCorrectionResult
- type BackupChainResult
- type BackupSnapshotArgs
- type BackupSnapshotResult
- type BlockHashEenpPair
- type BlockHashGcpPair
- type BlockHashStakeRewardDistributionRuleSetPair
- type BlockHashVcpPair
- type BroadcastRawTransactionArgs
- type BroadcastRawTransactionAsyncArgs
- type BroadcastRawTransactionAsyncResult
- type BroadcastRawTransactionResult
- type CallSmartContractArgs
- type CallSmartContractResult
- type Callback
- type Client
- type DneroRPCServer
- type DneroRPCService
- func (t *DneroRPCService) BackupChain(args *BackupChainArgs, result *BackupChainResult) error
- func (t *DneroRPCService) BackupChainCorrection(args *BackupChainCorrectionArgs, result *BackupChainCorrectionResult) error
- func (t *DneroRPCService) BackupSnapshot(args *BackupSnapshotArgs, result *BackupSnapshotResult) error
- func (t *DneroRPCService) BroadcastRawEthTransaction(args *BroadcastRawTransactionArgs, result *BroadcastRawTransactionResult) (err error)
- func (t *DneroRPCService) BroadcastRawEthTransactionAsync(args *BroadcastRawTransactionAsyncArgs, ...) (err error)
- func (t *DneroRPCService) BroadcastRawTransaction(args *BroadcastRawTransactionArgs, result *BroadcastRawTransactionResult) (err error)
- func (t *DneroRPCService) BroadcastRawTransactionAsync(args *BroadcastRawTransactionAsyncArgs, ...) (err error)
- func (t *DneroRPCService) CallSmartContract(args *CallSmartContractArgs, result *CallSmartContractResult) (err error)
- func (t *DneroRPCService) GetAccount(args *GetAccountArgs, result *GetAccountResult) (err error)
- func (t *DneroRPCService) GetAllPendingEliteEdgeNodeStakeReturns(args *GetAllPendingEliteEdgeNodeStakeReturnsArgs, ...) (err error)
- func (t *DneroRPCService) GetBlock(args *GetBlockArgs, result *GetBlockResult) (err error)
- func (t *DneroRPCService) GetBlockByHeight(args *GetBlockByHeightArgs, result *GetBlockResult) (err error)
- func (t *DneroRPCService) GetBlocksByRange(args *GetBlocksByRangeArgs, result *GetBlocksResult) (err error)
- func (t *DneroRPCService) GetCode(args *GetCodeArgs, result *GetCodeResult) (err error)
- func (t *DneroRPCService) GetEenpByHeight(args *GetEenpByHeightArgs, result *GetEenpResult) (err error)
- func (t *DneroRPCService) GetEliteEdgeNodeStakeReturnsByHeight(args *GetEliteEdgeNodeStakeReturnsByHeightArgs, ...) (err error)
- func (t *DneroRPCService) GetGcpByHeight(args *GetGcpByHeightArgs, result *GetGcpResult) (err error)
- func (t *DneroRPCService) GetGuardianInfo(args *GetGuardianInfoArgs, result *GetGuardianInfoResult) (err error)
- func (t *DneroRPCService) GetPeerURLs(args *GetPeersArgs, result *GetPeerURLsResult) (err error)
- func (t *DneroRPCService) GetPeers(args *GetPeersArgs, result *GetPeersResult) (err error)
- func (t *DneroRPCService) GetPendingTransactions(args *GetPendingTransactionsArgs, result *GetPendingTransactionsResult) (err error)
- func (t *DneroRPCService) GetSplitRule(args *GetSplitRuleArgs, result *GetSplitRuleResult) (err error)
- func (t *DneroRPCService) GetStakeRewardDistributionByHeight(args *GetStakeRewardDistributionRuleSetByHeightArgs, ...) (err error)
- func (t *DneroRPCService) GetStatus(args *GetStatusArgs, result *GetStatusResult) (err error)
- func (t *DneroRPCService) GetStorageAt(args *GetStorageAtArgs, result *GetStorageAtResult) (err error)
- func (t *DneroRPCService) GetTransaction(args *GetTransactionArgs, result *GetTransactionResult) (err error)
- func (t *DneroRPCService) GetVcpByHeight(args *GetVcpByHeightArgs, result *GetVcpResult) (err error)
- func (t *DneroRPCService) GetVersion(args *GetVersionArgs, result *GetVersionResult) (err error)
- type GetAccountArgs
- type GetAccountResult
- type GetAllPendingEliteEdgeNodeStakeReturnsArgs
- type GetAllPendingEliteEdgeNodeStakeReturnsResult
- type GetBlockArgs
- type GetBlockByHeightArgs
- type GetBlockResult
- type GetBlockResultInner
- type GetBlocksByRangeArgs
- type GetBlocksResult
- type GetCodeArgs
- type GetCodeResult
- type GetEenpByHeightArgs
- type GetEenpResult
- type GetEliteEdgeNodeStakeReturnsByHeightArgs
- type GetEliteEdgeNodeStakeReturnsByHeightResult
- type GetGcpByHeightArgs
- type GetGcpResult
- type GetGuardianInfoArgs
- type GetGuardianInfoResult
- type GetPeerURLsArgs
- type GetPeerURLsResult
- type GetPeersArgs
- type GetPeersResult
- type GetPendingTransactionsArgs
- type GetPendingTransactionsResult
- type GetSplitRuleArgs
- type GetSplitRuleResult
- type GetStakeRewardDistributionRuleSetByHeightArgs
- type GetStakeRewardDistributionRuleSetResult
- type GetStatusArgs
- type GetStatusResult
- type GetStorageAtArgs
- type GetStorageAtResult
- type GetTransactionArgs
- type GetTransactionResult
- type GetVcpByHeightArgs
- type GetVcpResult
- type GetVersionArgs
- type GetVersionResult
- type HTTPClient
- type HeightStakeReturnsPair
- type RPCResponse
- type Tx
- type TxCallbackManager
- type TxStatus
- type TxType
- type TxWithEthHash
- type WSClient
Constants ¶
const ( TxStatusNotFound = "not_found" TxStatusPending = "pending" TxStatusFinalized = "finalized" TxStatusAbandoned = "abandoned" )
const ( TxTypeCoinbase = byte(iota) TxTypeSlash TxTypeSend TxTypeReserveFund TxTypeReleaseFund TxTypeServicePayment TxTypeSplitRule TxTypeSmartContract TxTypeDepositStake TxTypeWithdrawStake TxTypeDepositStakeTxV1 TxTypeStakeRewardDistributionTx )
Variables ¶
This section is empty.
Functions ¶
func TimeoutHandler ¶
TimeoutHandler returns a Handler that runs h with the given time limit.
The new Handler calls h.ServeHTTP to handle each request, but if a call runs for longer than its time limit, the handler responds with a 503 Service Unavailable error and the given message in its body. (If msg is empty, a suitable default message will be sent.) After such a timeout, writes by h to its ResponseWriter will return ErrHandlerTimeout.
TimeoutHandler supports the Pusher interface but does not support the Hijacker or Flusher interfaces.
Types ¶
type BackupChainArgs ¶
type BackupChainResult ¶
type BackupSnapshotArgs ¶
type BackupSnapshotResult ¶
type BackupSnapshotResult struct {
SnapshotFile string `json:"snapshot_file"`
}
type BlockHashEenpPair ¶
type BlockHashEenpPair struct { BlockHash common.Hash EENs []*core.EliteEdgeNode }
type BlockHashGcpPair ¶
type BlockHashGcpPair struct { BlockHash common.Hash Gcp *core.GuardianCandidatePool }
type BlockHashStakeRewardDistributionRuleSetPair ¶
type BlockHashStakeRewardDistributionRuleSetPair struct { BlockHash common.Hash StakeRewardDistributionRuleSet []*core.RewardDistribution }
type BlockHashVcpPair ¶
type BlockHashVcpPair struct { BlockHash common.Hash Vcp *core.ValidatorCandidatePool HeightList *types.HeightList }
type BroadcastRawTransactionArgs ¶
type BroadcastRawTransactionArgs struct {
TxBytes string `json:"tx_bytes"`
}
type BroadcastRawTransactionAsyncArgs ¶
type BroadcastRawTransactionAsyncArgs struct {
TxBytes string `json:"tx_bytes"`
}
type BroadcastRawTransactionAsyncResult ¶
type BroadcastRawTransactionAsyncResult struct {
TxHash string `json:"hash"`
}
type BroadcastRawTransactionResult ¶
type BroadcastRawTransactionResult struct { TxHash string `json:"hash"` Block *core.BlockHeader `json:"block",rlp:"nil"` }
type CallSmartContractArgs ¶
type CallSmartContractArgs struct {
SctxBytes string `json:"sctx_bytes"`
}
type CallSmartContractResult ¶
type DneroRPCServer ¶
type DneroRPCServer struct { *DneroRPCService // contains filtered or unexported fields }
DneroRPCServer is an instance of RPC service.
func NewDneroRPCServer ¶
func NewDneroRPCServer(mempool *mempool.Mempool, ledger *ledger.Ledger, dispatcher *dispatcher.Dispatcher, chain *blockchain.Chain, consensus *consensus.ConsensusEngine) *DneroRPCServer
NewDneroRPCServer creates a new instance of DneroRPCServer.
func (*DneroRPCServer) Start ¶
func (t *DneroRPCServer) Start(ctx context.Context)
Start creates the main goroutine.
func (*DneroRPCServer) Stop ¶
func (t *DneroRPCServer) Stop()
Stop notifies all goroutines to stop without blocking.
func (*DneroRPCServer) Wait ¶
func (t *DneroRPCServer) Wait()
Wait blocks until all goroutines stop.
type DneroRPCService ¶
type DneroRPCService struct {
// contains filtered or unexported fields
}
func (*DneroRPCService) BackupChain ¶
func (t *DneroRPCService) BackupChain(args *BackupChainArgs, result *BackupChainResult) error
func (*DneroRPCService) BackupChainCorrection ¶
func (t *DneroRPCService) BackupChainCorrection(args *BackupChainCorrectionArgs, result *BackupChainCorrectionResult) error
func (*DneroRPCService) BackupSnapshot ¶
func (t *DneroRPCService) BackupSnapshot(args *BackupSnapshotArgs, result *BackupSnapshotResult) error
func (*DneroRPCService) BroadcastRawEthTransaction ¶
func (t *DneroRPCService) BroadcastRawEthTransaction( args *BroadcastRawTransactionArgs, result *BroadcastRawTransactionResult) (err error)
func (*DneroRPCService) BroadcastRawEthTransactionAsync ¶
func (t *DneroRPCService) BroadcastRawEthTransactionAsync( args *BroadcastRawTransactionAsyncArgs, result *BroadcastRawTransactionAsyncResult) (err error)
func (*DneroRPCService) BroadcastRawTransaction ¶
func (t *DneroRPCService) BroadcastRawTransaction( args *BroadcastRawTransactionArgs, result *BroadcastRawTransactionResult) (err error)
func (*DneroRPCService) BroadcastRawTransactionAsync ¶
func (t *DneroRPCService) BroadcastRawTransactionAsync( args *BroadcastRawTransactionAsyncArgs, result *BroadcastRawTransactionAsyncResult) (err error)
func (*DneroRPCService) CallSmartContract ¶
func (t *DneroRPCService) CallSmartContract(args *CallSmartContractArgs, result *CallSmartContractResult) (err error)
CallSmartContract calls the smart contract. However, calling a smart contract does NOT modify the globally consensus state. It can be used for dry run, or for retrieving info from smart contracts without actually spending gas.
func (*DneroRPCService) GetAccount ¶
func (t *DneroRPCService) GetAccount(args *GetAccountArgs, result *GetAccountResult) (err error)
func (*DneroRPCService) GetAllPendingEliteEdgeNodeStakeReturns ¶
func (t *DneroRPCService) GetAllPendingEliteEdgeNodeStakeReturns( args *GetAllPendingEliteEdgeNodeStakeReturnsArgs, result *GetAllPendingEliteEdgeNodeStakeReturnsResult) (err error)
func (*DneroRPCService) GetBlock ¶
func (t *DneroRPCService) GetBlock(args *GetBlockArgs, result *GetBlockResult) (err error)
func (*DneroRPCService) GetBlockByHeight ¶
func (t *DneroRPCService) GetBlockByHeight(args *GetBlockByHeightArgs, result *GetBlockResult) (err error)
func (*DneroRPCService) GetBlocksByRange ¶
func (t *DneroRPCService) GetBlocksByRange(args *GetBlocksByRangeArgs, result *GetBlocksResult) (err error)
func (*DneroRPCService) GetCode ¶
func (t *DneroRPCService) GetCode(args *GetCodeArgs, result *GetCodeResult) (err error)
func (*DneroRPCService) GetEenpByHeight ¶
func (t *DneroRPCService) GetEenpByHeight(args *GetEenpByHeightArgs, result *GetEenpResult) (err error)
func (*DneroRPCService) GetEliteEdgeNodeStakeReturnsByHeight ¶
func (t *DneroRPCService) GetEliteEdgeNodeStakeReturnsByHeight( args *GetEliteEdgeNodeStakeReturnsByHeightArgs, result *GetEliteEdgeNodeStakeReturnsByHeightResult) (err error)
func (*DneroRPCService) GetGcpByHeight ¶
func (t *DneroRPCService) GetGcpByHeight(args *GetGcpByHeightArgs, result *GetGcpResult) (err error)
func (*DneroRPCService) GetGuardianInfo ¶
func (t *DneroRPCService) GetGuardianInfo(args *GetGuardianInfoArgs, result *GetGuardianInfoResult) (err error)
func (*DneroRPCService) GetPeerURLs ¶
func (t *DneroRPCService) GetPeerURLs(args *GetPeersArgs, result *GetPeerURLsResult) (err error)
func (*DneroRPCService) GetPeers ¶
func (t *DneroRPCService) GetPeers(args *GetPeersArgs, result *GetPeersResult) (err error)
func (*DneroRPCService) GetPendingTransactions ¶
func (t *DneroRPCService) GetPendingTransactions(args *GetPendingTransactionsArgs, result *GetPendingTransactionsResult) (err error)
func (*DneroRPCService) GetSplitRule ¶
func (t *DneroRPCService) GetSplitRule(args *GetSplitRuleArgs, result *GetSplitRuleResult) (err error)
func (*DneroRPCService) GetStakeRewardDistributionByHeight ¶
func (t *DneroRPCService) GetStakeRewardDistributionByHeight( args *GetStakeRewardDistributionRuleSetByHeightArgs, result *GetStakeRewardDistributionRuleSetResult) (err error)
func (*DneroRPCService) GetStatus ¶
func (t *DneroRPCService) GetStatus(args *GetStatusArgs, result *GetStatusResult) (err error)
func (*DneroRPCService) GetStorageAt ¶
func (t *DneroRPCService) GetStorageAt(args *GetStorageAtArgs, result *GetStorageAtResult) (err error)
func (*DneroRPCService) GetTransaction ¶
func (t *DneroRPCService) GetTransaction(args *GetTransactionArgs, result *GetTransactionResult) (err error)
func (*DneroRPCService) GetVcpByHeight ¶
func (t *DneroRPCService) GetVcpByHeight(args *GetVcpByHeightArgs, result *GetVcpResult) (err error)
func (*DneroRPCService) GetVersion ¶
func (t *DneroRPCService) GetVersion(args *GetVersionArgs, result *GetVersionResult) (err error)
type GetAccountArgs ¶
type GetAccountArgs struct { Name string `json:"name"` Address string `json:"address"` Height common.JSONUint64 `json:"height"` Preview bool `json:"preview"` // preview the account balance from the ScreenedView }
type GetAccountResult ¶
type GetAllPendingEliteEdgeNodeStakeReturnsArgs ¶
type GetAllPendingEliteEdgeNodeStakeReturnsArgs struct { }
type GetAllPendingEliteEdgeNodeStakeReturnsResult ¶
type GetAllPendingEliteEdgeNodeStakeReturnsResult struct {
EENHeightStakeReturnsPairs []HeightStakeReturnsPair
}
type GetBlockArgs ¶
type GetBlockByHeightArgs ¶
type GetBlockByHeightArgs struct { Height common.JSONUint64 `json:"height"` IncludeEthTxHashes bool `json:"include_eth_tx_hashes"` }
type GetBlockResult ¶
type GetBlockResult struct {
*GetBlockResultInner
}
type GetBlockResultInner ¶
type GetBlockResultInner struct { ChainID string `json:"chain_id"` Epoch common.JSONUint64 `json:"epoch"` Height common.JSONUint64 `json:"height"` Parent common.Hash `json:"parent"` TxHash common.Hash `json:"transactions_hash"` StateHash common.Hash `json:"state_hash"` Timestamp *common.JSONBig `json:"timestamp"` Proposer common.Address `json:"proposer"` HCC core.CommitCertificate `json:"hcc"` GuardianVotes *core.AggregatedVotes `json:"guardian_votes"` EliteEdgeNodeVotes *core.AggregatedEENVotes `json:"elite_edge_node_votes"` Children []common.Hash `json:"children"` Status core.BlockStatus `json:"status"` Hash common.Hash `json:"hash"` Txs []interface{} `json:"transactions"` // for backward conpatibility, see function DneroRPCService.gatherTxs() }
type GetBlocksByRangeArgs ¶
type GetBlocksByRangeArgs struct { Start common.JSONUint64 `json:"start"` End common.JSONUint64 `json:"end"` IncludeEthTxHashes bool `json:"include_eth_tx_hashes"` }
type GetBlocksResult ¶
type GetBlocksResult []*GetBlockResultInner
type GetCodeArgs ¶
type GetCodeArgs struct { Address string `json:"address"` Height common.JSONUint64 `json:"height"` }
type GetCodeResult ¶
type GetEenpByHeightArgs ¶
type GetEenpByHeightArgs struct {
Height common.JSONUint64 `json:"height"`
}
type GetEenpResult ¶
type GetEenpResult struct {
BlockHashEenpPairs []BlockHashEenpPair
}
type GetEliteEdgeNodeStakeReturnsByHeightArgs ¶
type GetEliteEdgeNodeStakeReturnsByHeightArgs struct {
Height common.JSONUint64 `json:"height"`
}
type GetEliteEdgeNodeStakeReturnsByHeightResult ¶
type GetEliteEdgeNodeStakeReturnsByHeightResult struct {
EENStakeReturns []state.StakeWithHolder
}
type GetGcpByHeightArgs ¶
type GetGcpByHeightArgs struct {
Height common.JSONUint64 `json:"height"`
}
type GetGcpResult ¶
type GetGcpResult struct {
BlockHashGcpPairs []BlockHashGcpPair
}
type GetGuardianInfoArgs ¶
type GetGuardianInfoArgs struct{}
type GetGuardianInfoResult ¶
type GetPeerURLsArgs ¶
type GetPeerURLsArgs struct {
SkipEdgeNode bool `json:"skip_edge_node"`
}
type GetPeerURLsResult ¶
type GetPeerURLsResult struct {
PeerURLs []string `json:"peer_urls"`
}
type GetPeersArgs ¶
type GetPeersArgs struct {
SkipEdgeNode bool `json:"skip_edge_node"`
}
type GetPeersResult ¶
type GetPeersResult struct {
Peers []string `json:"peers"`
}
type GetPendingTransactionsArgs ¶
type GetPendingTransactionsArgs struct { }
type GetPendingTransactionsResult ¶
type GetPendingTransactionsResult struct {
TxHashes []string `json:"tx_hashes"`
}
type GetSplitRuleArgs ¶
type GetSplitRuleArgs struct {
ResourceID string `json:"resource_id"`
}
type GetSplitRuleResult ¶
type GetStakeRewardDistributionRuleSetByHeightArgs ¶
type GetStakeRewardDistributionRuleSetByHeightArgs struct { Height common.JSONUint64 `json:"height"` Address string `json:"address"` // the address of the stake holder, i.e. the guardian or elite edge node }
type GetStakeRewardDistributionRuleSetResult ¶
type GetStakeRewardDistributionRuleSetResult struct {
BlockHashStakeRewardDistributionRuleSetPairs []BlockHashStakeRewardDistributionRuleSetPair
}
type GetStatusArgs ¶
type GetStatusArgs struct{}
type GetStatusResult ¶
type GetStatusResult struct { Address string `json:"address"` ChainID string `json:"chain_id"` PeerID string `json:"peer_id"` LatestFinalizedBlockHash common.Hash `json:"latest_finalized_block_hash"` LatestFinalizedBlockHeight common.JSONUint64 `json:"latest_finalized_block_height"` LatestFinalizedBlockTime *common.JSONBig `json:"latest_finalized_block_time"` LatestFinalizedBlockEpoch common.JSONUint64 `json:"latest_finalized_block_epoch"` CurrentEpoch common.JSONUint64 `json:"current_epoch"` CurrentHeight common.JSONUint64 `json:"current_height"` CurrentTime *common.JSONBig `json:"current_time"` Syncing bool `json:"syncing"` GenesisBlockHash common.Hash `json:"genesis_block_hash"` }
type GetStorageAtArgs ¶
type GetStorageAtArgs struct { Address string `json:"address"` StoragePosition string `json:"storage_positon"` Height common.JSONUint64 `json:"height"` }
type GetStorageAtResult ¶
type GetStorageAtResult struct {
Value string `json:"value"`
}
type GetTransactionArgs ¶
type GetTransactionArgs struct {
Hash string `json:"hash"`
}
type GetTransactionResult ¶
type GetTransactionResult struct { BlockHash common.Hash `json:"block_hash"` BlockHeight common.JSONUint64 `json:"block_height"` Status TxStatus `json:"status"` TxHash common.Hash `json:"hash"` Type byte `json:"type"` Tx types.Tx `json:"transaction"` Receipt *blockchain.TxReceiptEntry `json:"receipt"` }
type GetVcpByHeightArgs ¶
type GetVcpByHeightArgs struct {
Height common.JSONUint64 `json:"height"`
}
type GetVcpResult ¶
type GetVcpResult struct {
BlockHashVcpPairs []BlockHashVcpPair
}
type GetVersionArgs ¶
type GetVersionArgs struct { }
type GetVersionResult ¶
type HTTPClient ¶
func (HTTPClient) Call ¶
func (c HTTPClient) Call(name string, args []interface{}, result interface{}) error
type HeightStakeReturnsPair ¶
type HeightStakeReturnsPair struct { HeightKey string EENStakeReturns []state.StakeWithHolder }
type RPCResponse ¶
type RPCResponse struct {
// contains filtered or unexported fields
}
func (*RPCResponse) GetObject ¶
func (r *RPCResponse) GetObject(toType interface{}) error
type Tx ¶
type Tx struct { types.Tx `json:"raw"` Type byte `json:"type"` Hash common.Hash `json:"hash"` Receipt *blockchain.TxReceiptEntry `json:"receipt"` }
type TxCallbackManager ¶
type TxCallbackManager struct {
// contains filtered or unexported fields
}
func NewTxCallbackManager ¶
func NewTxCallbackManager() *TxCallbackManager
func (*TxCallbackManager) AddCallback ¶
func (m *TxCallbackManager) AddCallback(txHash common.Hash, cb func(*core.Block))
func (*TxCallbackManager) RemoveCallback ¶
func (m *TxCallbackManager) RemoveCallback(txHash common.Hash) (cb *Callback, exists bool)
func (*TxCallbackManager) Trim ¶
func (m *TxCallbackManager) Trim()
type TxWithEthHash ¶
type TxWithEthHash struct { types.Tx `json:"raw"` Type byte `json:"type"` Hash common.Hash `json:"hash"` EthTxHash common.Hash `json:"eth_tx_hash"` Receipt *blockchain.TxReceiptEntry `json:"receipt"` }