{"modulePath":"github.com/parallelcointeam/exploder","version":"v2.1.3+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package mempool\n\n## Functions\n\n```go\nfunc DisableLog()\n```\nDisableLog disables all library log output.  Logging output is disabled by default until UseLogger is called.\n\n```go\nfunc JSONFormatMempoolData(data *MempoolData) (*bytes.Buffer, error)\n```\nJSONFormatMempoolData concatenates block data results into a single JSON object with primary keys for the result type\n\n```go\nfunc NewMempoolDataCollector(dcrdChainSvr *rpcclient.Client, params *chaincfg.Params) *mempoolDataCollector\n```\nNewMempoolDataCollector creates a new mempoolDataCollector.\n\n```go\nfunc NewMempoolMonitor(collector *mempoolDataCollector,\n\tsavers []MempoolDataSaver, newTxChan chan *NewTx,\n\tquit chan struct{}, wg *sync.WaitGroup, newTicketLimit int32,\n\tmini time.Duration, maxi time.Duration, mpi *MempoolInfo) *mempoolMonitor\n```\nNewMempoolMonitor creates a new mempoolMonitor\n\n```go\nfunc UseLogger(logger slog.Logger)\n```\nUseLogger uses a specified Logger to output package logging info.\n\n## Types\n\n```go\ntype ByAbsoluteFee struct {\n\tTicketsDetails\n}\n```\nByAbsoluteFee models TicketDetails sorted by fee\n\n```go\nfunc (tix ByAbsoluteFee) Less(i, j int) bool\n```\nLess compares fee rates by fee\\_i \\\u003c fee\\_j\n\n```go\ntype ByFeeRate struct {\n\tTicketsDetails\n}\n```\nByFeeRate models TicketsDetails sorted by fee rates\n\n```go\nfunc (tix ByFeeRate) Less(i, j int) bool\n```\nLess compares fee rates by rate\\_i \\\u003c rate\\_j\n\n```go\ntype MempoolData struct {\n\tHeight            uint32\n\tNumTickets        uint32\n\tNumVotes          uint32\n\tNewTickets        uint32\n\tTicketfees        *dcrjson.TicketFeeInfoResult\n\tMinableFees       *MinableFeeInfo\n\tAllTicketsDetails TicketsDetails\n}\n```\nMempoolData models info about ticket purchases in mempool\n\n```go\nfunc (m *MempoolData) GetHeight() uint32\n```\nGetHeight returns the mempool height\n\n```go\nfunc (m *MempoolData) GetNumTickets() uint32\n```\nGetNumTickets returns number of tickets\n\n```go\ntype MempoolDataCache struct {\n\tsync.RWMutex\n\t// contains filtered or unexported fields\n}\n```\nMempoolDataCache models the basic data for the mempool cache\n\n```go\nfunc (c *MempoolDataCache) GetFeeInfo() (uint32, dcrjson.FeeInfoMempool)\n```\nGetFeeInfo returns the mempool height and basic fee info\n\n```go\nfunc (c *MempoolDataCache) GetFeeInfoExtra() (uint32, *apitypes.MempoolTicketFeeInfo)\n```\nGetFeeInfoExtra returns the mempool height and detailed fee info\n\n```go\nfunc (c *MempoolDataCache) GetFeeRates(N int) (uint32, int64, int, []float64)\n```\nGetFeeRates returns the mempool height, time, number of fees and an array of fee rates\n\n```go\nfunc (c *MempoolDataCache) GetFees(N int) (uint32, int, []float64)\n```\nGetFees returns the mempool height number of fees and an array of the fields\n\n```go\nfunc (c *MempoolDataCache) GetHeight() uint32\n```\nGetHeight returns the mempool height\n\n```go\nfunc (c *MempoolDataCache) GetNumTickets() (uint32, uint32)\n```\nGetNumTickets returns the mempool height and number of tickets\n\n```go\nfunc (c *MempoolDataCache) GetTicketsDetails(N int) (uint32, int64, int, TicketsDetails)\n```\nGetTicketsDetails returns the mempool height, time, number of tickets and the ticket details\n\n```go\nfunc (c *MempoolDataCache) StoreMPData(data *MempoolData, timestamp time.Time) error\n```\nStoreMPData stores info from data in the mempool cache\n\n```go\ntype MempoolDataSaver interface {\n\tStoreMPData(data *MempoolData, timestamp time.Time) error\n}\n```\nMempoolDataSaver is an interface for saving/storing MempoolData\n\n```go\ntype MempoolDataToJSONFiles struct {\n\t// contains filtered or unexported fields\n}\n```\nMempoolDataToJSONFiles implements MempoolDataSaver interface for JSON output to the file system\n\n```go\nfunc NewMempoolDataToJSONFiles(folder string, fileBase string,\n\tm ...*sync.Mutex) *MempoolDataToJSONFiles\n```\nNewMempoolDataToJSONFiles creates a new MempoolDataToJSONFiles with optional existing mutex\n\n```go\nfunc (s *MempoolDataToJSONFiles) StoreMPData(data *MempoolData) error\n```\nStoreMPData writes MempoolData to a file in JSON format The file name is nameBase+height+\".json\".\n\n```go\ntype MempoolDataToJSONStdOut struct {\n\t// contains filtered or unexported fields\n}\n```\nMempoolDataToJSONStdOut implements MempoolDataSaver interface for JSON output to stdout\n\n```go\nfunc NewMempoolDataToJSONStdOut(m ...*sync.Mutex) *MempoolDataToJSONStdOut\n```\nNewMempoolDataToJSONStdOut creates a new MempoolDataToJSONStdOut with optional existing mutex\n\n```go\nfunc (s *MempoolDataToJSONStdOut) StoreMPData(data *MempoolData) error\n```\nStoreMPData writes MempoolData to stdout in JSON format\n\n```go\ntype MempoolDataToSummaryStdOut struct {\n\t// contains filtered or unexported fields\n}\n```\nMempoolDataToSummaryStdOut implements MempoolDataSaver interface for plain text summary to stdout\n\n```go\nfunc NewMempoolDataToSummaryStdOut(feeWindowRadius int, m ...*sync.Mutex) *MempoolDataToSummaryStdOut\n```\nNewMempoolDataToSummaryStdOut creates a new MempoolDataToSummaryStdOut with optional existing mutex\n\n```go\nfunc (s *MempoolDataToSummaryStdOut) StoreMPData(data *MempoolData) error\n```\nStoreMPData writes MempoolData to stdout as plain text summary\n\n```go\ntype MempoolFeeDumper struct {\n\t// contains filtered or unexported fields\n}\n```\nMempoolFeeDumper implements MempoolDataSaver interface for a complete file dump of all ticket fees to the file system\n\n```go\nfunc NewMempoolFeeDumper(folder string, fileBase string, m ...*sync.Mutex) *MempoolFeeDumper\n```\nNewMempoolFeeDumper creates a new MempoolFeeDumper with optional existing mutex\n\n```go\nfunc (s *MempoolFeeDumper) StoreMPData(data *MempoolData, timestamp time.Time) error\n```\nStoreMPData writes all the ticket fees to a file The file name is nameBase+\".json\".\n\n```go\ntype MempoolInfo struct {\n\tCurrentHeight               uint32\n\tNumTicketPurchasesInMempool uint32\n\tNumTicketsSinceStatsReport  int32\n\tLastCollectTime             time.Time\n}\n```\nMempoolInfo models basic data about the node's mempool\n\n```go\ntype MinableFeeInfo struct {\n\t// contains filtered or unexported fields\n}\n```\nMinableFeeInfo describes the ticket fees\n\n```go\ntype NewTx struct {\n\tHash *chainhash.Hash\n\tT    time.Time\n}\n```\nNewTx models data for a new transaction\n\n```go\ntype Stakelimitfeeinfo struct {\n\tStakelimitfee float64 `json:\"stakelimitfee\"`\n}\n```\nStakelimitfeeinfo JSON output\n\n```go\ntype TicketsDetails apitypes.TicketsDetails\n```\nTicketsDetails localizes apitypes.TicketsDetails\n\n```go\nfunc (tix TicketsDetails) Len() int\n```\nLen returns the length of TicketsDetails\n\n```go\nfunc (tix TicketsDetails) Swap(i, j int)\n```\nSwap swaps TicketsDetails elements at i and j\n\n","path":"github.com/parallelcointeam/exploder/mempool","name":"mempool","synopsis":"","isRedistributable":true}
