Documentation ¶
Index ¶
- func DisableLog()
- func JSONFormatBlockData(data *BlockData) (*bytes.Buffer, error)
- func NewBlockDataCollector(dcrdChainSvr *dcrrpcclient.Client, params *chaincfg.Params) *blockDataCollector
- func NewChainMonitor(collector *blockDataCollector, savers []BlockDataSaver, quit chan struct{}, ...) *chainMonitor
- func UseLogger(logger btclog.Logger)
- type BlockData
- type BlockDataSaver
- type BlockDataToJSONFiles
- type BlockDataToJSONStdOut
- type BlockDataToSummaryStdOut
- type ReorgData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.
func JSONFormatBlockData ¶
JSONFormatBlockData concatenates block data results into a single JSON object with primary keys for the result type
func NewBlockDataCollector ¶
func NewBlockDataCollector(dcrdChainSvr *dcrrpcclient.Client, params *chaincfg.Params) *blockDataCollector
NewBlockDataCollector creates a new blockDataCollector.
func NewChainMonitor ¶
func NewChainMonitor(collector *blockDataCollector, savers []BlockDataSaver, quit chan struct{}, wg *sync.WaitGroup, noPoolValue bool, addrs map[string]txhelpers.TxAction, blockChan chan *chainhash.Hash, recvTxBlockChan chan *txhelpers.BlockWatchedTx, reorgChan chan *ReorgData) *chainMonitor
NewChainMonitor creates a new chainMonitor
Types ¶
type BlockData ¶
type BlockData struct { Header dcrjson.GetBlockHeaderVerboseResult Connections int32 FeeInfo dcrjson.FeeInfoBlock CurrentStakeDiff dcrjson.GetStakeDifficultyResult EstStakeDiff dcrjson.EstimateStakeDiffResult PoolInfo apitypes.TicketPoolInfo PriceWindowNum int IdxBlockInWindow int }
BlockData contains all the data collected by a blockDataCollector and stored by a BlockDataSaver. TODO: consider if pointers are desirable here.
func (*BlockData) ToBlockSummary ¶
func (b *BlockData) ToBlockSummary() apitypes.BlockDataBasic
func (*BlockData) ToStakeInfoExtended ¶
func (b *BlockData) ToStakeInfoExtended() apitypes.StakeInfoExtended
func (*BlockData) ToStakeInfoExtendedEstimates ¶
func (b *BlockData) ToStakeInfoExtendedEstimates() apitypes.StakeInfoExtendedEstimates
type BlockDataSaver ¶
BlockDataSaver is an interface for saving/storing BlockData
type BlockDataToJSONFiles ¶
type BlockDataToJSONFiles struct {
// contains filtered or unexported fields
}
BlockDataToJSONFiles implements BlockDataSaver interface for JSON output to the file system
func NewBlockDataToJSONFiles ¶
func NewBlockDataToJSONFiles(folder string, fileBase string, m ...*sync.Mutex) *BlockDataToJSONFiles
NewBlockDataToJSONFiles creates a new BlockDataToJSONFiles with optional existing mutex
func (*BlockDataToJSONFiles) Store ¶
func (s *BlockDataToJSONFiles) Store(data *BlockData) error
Store writes BlockData to a file in JSON format The file name is nameBase+height+".json".
type BlockDataToJSONStdOut ¶
type BlockDataToJSONStdOut struct {
// contains filtered or unexported fields
}
BlockDataToJSONStdOut implements BlockDataSaver interface for JSON output to stdout
func NewBlockDataToJSONStdOut ¶
func NewBlockDataToJSONStdOut(m ...*sync.Mutex) *BlockDataToJSONStdOut
NewBlockDataToJSONStdOut creates a new BlockDataToJSONStdOut with optional existing mutex
func (*BlockDataToJSONStdOut) Store ¶
func (s *BlockDataToJSONStdOut) Store(data *BlockData) error
Store writes BlockData to stdout in JSON format
type BlockDataToSummaryStdOut ¶
type BlockDataToSummaryStdOut struct {
// contains filtered or unexported fields
}
BlockDataToSummaryStdOut implements BlockDataSaver interface for plain text summary to stdout
func NewBlockDataToSummaryStdOut ¶
func NewBlockDataToSummaryStdOut(sdiffWinSize int64, m ...*sync.Mutex) *BlockDataToSummaryStdOut
NewBlockDataToSummaryStdOut creates a new BlockDataToSummaryStdOut with optional existing mutex
func (*BlockDataToSummaryStdOut) Store ¶
func (s *BlockDataToSummaryStdOut) Store(data *BlockData) error
Store writes BlockData to stdout as plain text summary