Documentation ¶
Index ¶
- func DisableLog()
- func JSONFormatMempoolData(data *MempoolData) (*bytes.Buffer, error)
- func NewMempoolDataCollector(hcdChainSvr *hcrpcclient.Client, params *chaincfg.Params) *mempoolDataCollector
- func NewMempoolMonitor(collector *mempoolDataCollector, savers []MempoolDataSaver, ...) *mempoolMonitor
- func UseLogger(logger btclog.Logger)
- type ByAbsoluteFee
- type ByFeeRate
- type MempoolData
- type MempoolDataCache
- func (c *MempoolDataCache) GetFeeInfo() (uint32, hcjson.FeeInfoMempool)
- func (c *MempoolDataCache) GetFeeInfoExtra() (uint32, *apitypes.MempoolTicketFeeInfo)
- func (c *MempoolDataCache) GetFeeRates(N int) (uint32, int64, int, []float64)
- func (c *MempoolDataCache) GetFees(N int) (uint32, int, []float64)
- func (c *MempoolDataCache) GetHeight() uint32
- func (c *MempoolDataCache) GetNumTickets() (uint32, uint32)
- func (c *MempoolDataCache) GetTicketsDetails(N int) (uint32, int64, int, TicketsDetails)
- func (c *MempoolDataCache) StoreMPData(data *MempoolData, timestamp time.Time) error
- type MempoolDataSaver
- type MempoolDataToJSONFiles
- type MempoolDataToJSONStdOut
- type MempoolDataToSummaryStdOut
- type MempoolFeeDumper
- type MempoolInfo
- type MinableFeeInfo
- type NewTx
- type Stakelimitfeeinfo
- type TicketsDetails
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 UseLogger is called.
func JSONFormatMempoolData ¶
func JSONFormatMempoolData(data *MempoolData) (*bytes.Buffer, error)
JSONFormatMempoolData concatenates block data results into a single JSON object with primary keys for the result type
func NewMempoolDataCollector ¶
func NewMempoolDataCollector(hcdChainSvr *hcrpcclient.Client, params *chaincfg.Params) *mempoolDataCollector
NewMempoolDataCollector creates a new mempoolDataCollector.
func NewMempoolMonitor ¶
func NewMempoolMonitor(collector *mempoolDataCollector, savers []MempoolDataSaver, newTxChan chan *NewTx, quit chan struct{}, wg *sync.WaitGroup, newTicketLimit int32, mini time.Duration, maxi time.Duration, mpi *MempoolInfo) *mempoolMonitor
NewMempoolMonitor creates a new mempoolMonitor
Types ¶
type ByAbsoluteFee ¶
type ByAbsoluteFee struct {
TicketsDetails
}
ByAbsoluteFee models TicketDetails sorted by fee
func (ByAbsoluteFee) Less ¶
func (tix ByAbsoluteFee) Less(i, j int) bool
Less compares fee rates by fee_i < fee_j
type ByFeeRate ¶
type ByFeeRate struct {
TicketsDetails
}
ByFeeRate models TicketsDetails sorted by fee rates
type MempoolData ¶
type MempoolData struct { Height uint32 NumTickets uint32 NewTickets uint32 Ticketfees *hcjson.TicketFeeInfoResult MinableFees *MinableFeeInfo AllTicketsDetails TicketsDetails }
MempoolData models info about ticket purchases in mempool
func (*MempoolData) GetHeight ¶
func (m *MempoolData) GetHeight() uint32
GetHeight returns the mempool height
func (*MempoolData) GetNumTickets ¶
func (m *MempoolData) GetNumTickets() uint32
GetNumTickets returns the mempool height and number of tickets
type MempoolDataCache ¶
MempoolDataCache models the basic data for the mempool cache
func (*MempoolDataCache) GetFeeInfo ¶
func (c *MempoolDataCache) GetFeeInfo() (uint32, hcjson.FeeInfoMempool)
GetFeeInfo returns the mempool height and basic fee info
func (*MempoolDataCache) GetFeeInfoExtra ¶
func (c *MempoolDataCache) GetFeeInfoExtra() (uint32, *apitypes.MempoolTicketFeeInfo)
GetFeeInfoExtra returns the mempool height and detailed fee info
func (*MempoolDataCache) GetFeeRates ¶
GetFeeRates returns the mempool height, time, number of fees and an array of fee rates
func (*MempoolDataCache) GetFees ¶
func (c *MempoolDataCache) GetFees(N int) (uint32, int, []float64)
GetFees returns the mempool height number of fees and an array of the fields
func (*MempoolDataCache) GetHeight ¶
func (c *MempoolDataCache) GetHeight() uint32
GetHeight returns the mempool height
func (*MempoolDataCache) GetNumTickets ¶
func (c *MempoolDataCache) GetNumTickets() (uint32, uint32)
GetNumTickets returns the mempool height and number of tickets
func (*MempoolDataCache) GetTicketsDetails ¶
func (c *MempoolDataCache) GetTicketsDetails(N int) (uint32, int64, int, TicketsDetails)
GetTicketsDetails returns the mempool height, time, number of tickets and the ticket details
func (*MempoolDataCache) StoreMPData ¶
func (c *MempoolDataCache) StoreMPData(data *MempoolData, timestamp time.Time) error
StoreMPData stores info from data in the mempool cache
type MempoolDataSaver ¶
type MempoolDataSaver interface {
StoreMPData(data *MempoolData, timestamp time.Time) error
}
MempoolDataSaver is an interface for saving/storing MempoolData
type MempoolDataToJSONFiles ¶
type MempoolDataToJSONFiles struct {
// contains filtered or unexported fields
}
MempoolDataToJSONFiles implements MempoolDataSaver interface for JSON output to the file system
func NewMempoolDataToJSONFiles ¶
func NewMempoolDataToJSONFiles(folder string, fileBase string, m ...*sync.Mutex) *MempoolDataToJSONFiles
NewMempoolDataToJSONFiles creates a new MempoolDataToJSONFiles with optional existing mutex
func (*MempoolDataToJSONFiles) StoreMPData ¶
func (s *MempoolDataToJSONFiles) StoreMPData(data *MempoolData) error
StoreMPData writes MempoolData to a file in JSON format The file name is nameBase+height+".json".
type MempoolDataToJSONStdOut ¶
type MempoolDataToJSONStdOut struct {
// contains filtered or unexported fields
}
MempoolDataToJSONStdOut implements MempoolDataSaver interface for JSON output to stdout
func NewMempoolDataToJSONStdOut ¶
func NewMempoolDataToJSONStdOut(m ...*sync.Mutex) *MempoolDataToJSONStdOut
NewMempoolDataToJSONStdOut creates a new MempoolDataToJSONStdOut with optional existing mutex
func (*MempoolDataToJSONStdOut) StoreMPData ¶
func (s *MempoolDataToJSONStdOut) StoreMPData(data *MempoolData) error
StoreMPData writes MempoolData to stdout in JSON format
type MempoolDataToSummaryStdOut ¶
type MempoolDataToSummaryStdOut struct {
// contains filtered or unexported fields
}
MempoolDataToSummaryStdOut implements MempoolDataSaver interface for plain text summary to stdout
func NewMempoolDataToSummaryStdOut ¶
func NewMempoolDataToSummaryStdOut(feeWindowRadius int, m ...*sync.Mutex) *MempoolDataToSummaryStdOut
NewMempoolDataToSummaryStdOut creates a new MempoolDataToSummaryStdOut with optional existing mutex
func (*MempoolDataToSummaryStdOut) StoreMPData ¶
func (s *MempoolDataToSummaryStdOut) StoreMPData(data *MempoolData) error
StoreMPData writes MempoolData to stdout as plain text summary
type MempoolFeeDumper ¶
type MempoolFeeDumper struct {
// contains filtered or unexported fields
}
MempoolFeeDumper implements MempoolDataSaver interface for a complete file dump of all ticket fees to the file system
func NewMempoolFeeDumper ¶
func NewMempoolFeeDumper(folder string, fileBase string, m ...*sync.Mutex) *MempoolFeeDumper
NewMempoolFeeDumper creates a new MempoolFeeDumper with optional existing mutex
func (*MempoolFeeDumper) StoreMPData ¶
func (s *MempoolFeeDumper) StoreMPData(data *MempoolData, timestamp time.Time) error
StoreMPData writes all the ticket fees to a file The file name is nameBase+".json".
type MempoolInfo ¶
type MempoolInfo struct { CurrentHeight uint32 NumTicketPurchasesInMempool uint32 NumTicketsSinceStatsReport int32 LastCollectTime time.Time }
MempoolInfo models basic data about the node's mempool
type MinableFeeInfo ¶
type MinableFeeInfo struct {
// contains filtered or unexported fields
}
MinableFeeInfo describes the ticket fees
type Stakelimitfeeinfo ¶
type Stakelimitfeeinfo struct {
Stakelimitfee float64 `json:"stakelimitfee"`
}
Stakelimitfeeinfo JSON output
type TicketsDetails ¶
type TicketsDetails apitypes.TicketsDetails
TicketsDetails localizes apitypes.TicketsDetails
func (TicketsDetails) Len ¶
func (tix TicketsDetails) Len() int
Len returns the length of TicketsDetails
func (TicketsDetails) Swap ¶
func (tix TicketsDetails) Swap(i, j int)
Swap swaps TicketsDetails elements at i and j