Documentation ¶
Index ¶
- Constants
- type RpcClient
- func (client *RpcClient) GetBlockByHeight(height int64, retry bool) *types.BCHBlock
- func (client *RpcClient) GetBlockHash(height int64) (string, error)
- func (client *RpcClient) GetBlockInfo(hash string) (*types.BlockInfo, error)
- func (client *RpcClient) GetCCEpochs(start, end uint64) []*cctypes.CCEpoch
- func (client *RpcClient) GetEpochs(start, end uint64) []*stakingtypes.Epoch
- func (client *RpcClient) GetLatestHeight(retry bool) (height int64)
- func (client *RpcClient) GetTxInfo(hash string, blockhash string) (*types.TxInfo, error)
- type Watcher
- func (watcher *Watcher) CheckSanity(skipCheck bool)
- func (watcher *Watcher) ClearOldData()
- func (watcher *Watcher) GetCurrEpoch() *stakingtypes.Epoch
- func (watcher *Watcher) Run(catchupChan chan bool)
- func (watcher *Watcher) SetNumBlocksInEpoch(n int64)
- func (watcher *Watcher) SetNumBlocksToClearMemory(n int)
- func (watcher *Watcher) SetWaitingBlockDelayTime(n int)
Constants ¶
View Source
const ( ReqStrBlockCount = `{"jsonrpc": "1.0", "id":"superbch", "method": "getblockcount", "params": [] }` ReqStrBlockHash = `{"jsonrpc": "1.0", "id":"superbch", "method": "getblockhash", "params": [%d] }` //verbose = 2, show all txs rawdata ReqStrBlock = `{"jsonrpc": "1.0", "id":"superbch", "method": "getblock", "params": ["%s",2] }` ReqStrTx = `{"jsonrpc": "1.0", "id":"superbch", "method": "getrawtransaction", "params": ["%s", true, "%s"] }` ReqStrEpochs = `{"jsonrpc": "2.0", "method": "sbch_getEpochs", "params": ["%s","%s"], "id":1}` ReqStrCCEpochs = `{"jsonrpc": "2.0", "method": "sbch_getCCEpochs", "params": ["%s","%s"], "id":1}` )
View Source
const ( NumBlocksToClearMemory = 1000 WaitingBlockDelayTime = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RpcClient ¶
type RpcClient struct {
// contains filtered or unexported fields
}
func NewRpcClient ¶
func (*RpcClient) GetBlockByHeight ¶
func (*RpcClient) GetBlockHash ¶
**for tool
func (*RpcClient) GetBlockInfo ¶
func (*RpcClient) GetCCEpochs ¶
func (*RpcClient) GetEpochs ¶
func (client *RpcClient) GetEpochs(start, end uint64) []*stakingtypes.Epoch
func (*RpcClient) GetLatestHeight ¶
type Watcher ¶
type Watcher struct { EpochChan chan *stakingtypes.Epoch CCEpochChan chan *cctypes.CCEpoch // contains filtered or unexported fields }
A watcher watches the new blocks generated on bitcoin cash's mainnet, and outputs epoch information through a channel
func NewWatcher ¶
func (*Watcher) CheckSanity ¶
func (*Watcher) ClearOldData ¶
func (watcher *Watcher) ClearOldData()
func (*Watcher) GetCurrEpoch ¶
func (watcher *Watcher) GetCurrEpoch() *stakingtypes.Epoch
func (*Watcher) SetNumBlocksInEpoch ¶
func (*Watcher) SetNumBlocksToClearMemory ¶
func (*Watcher) SetWaitingBlockDelayTime ¶
Click to show internal directories.
Click to hide internal directories.