mempool

package
v1.1.0-pre Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2017 License: ISC Imports: 17 Imported by: 0

Documentation

Index

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(dcrdChainSvr *rpcclient.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

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info.

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

func (ByFeeRate) Less

func (tix ByFeeRate) Less(i, j int) bool

Less compares fee rates by rate_i < rate_j

type MempoolData added in v0.3.2

type MempoolData struct {
	Height            uint32
	NumTickets        uint32
	NewTickets        uint32
	Ticketfees        *dcrjson.TicketFeeInfoResult
	MinableFees       *MinableFeeInfo
	AllTicketsDetails TicketsDetails
}

MempoolData models info about ticket purchases in mempool

func (*MempoolData) GetHeight added in v0.3.2

func (m *MempoolData) GetHeight() uint32

GetHeight returns the mempool height

func (*MempoolData) GetNumTickets added in v0.3.2

func (m *MempoolData) GetNumTickets() uint32

GetNumTickets returns the mempool height and number of tickets

type MempoolDataCache

type MempoolDataCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MempoolDataCache models the basic data for the mempool cache

func (*MempoolDataCache) GetFeeInfo

func (c *MempoolDataCache) GetFeeInfo() (uint32, dcrjson.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

func (c *MempoolDataCache) GetFeeRates(N int) (uint32, int64, int, []float64)

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 NewTx added in v0.7.0

type NewTx struct {
	Hash *chainhash.Hash
	T    time.Time
}

NewTx models data for a new transaction

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL