mempool

package
v0.0.0-...-05b8940 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: ISC Imports: 19 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 UseLogger

func UseLogger(logger slog.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type Block

type Block struct {
	BlockReceiveTime  time.Time
	BlockInternalTime time.Time
	BlockHeight       uint32
	BlockHash         string
}

type BlockDto

type BlockDto struct {
	BlockReceiveTime  string    `json:"block_receive_time"`
	BlockInternalTime string    `json:"block_internal_time"`
	Delay             string    `json:"delay"`
	BlockHeight       uint32    `json:"block_height"`
	BlockHash         string    `json:"block_hash"`
	Votes             []VoteDto `json:"votes"`
}

type BlockReceiveTime

type BlockReceiveTime struct {
	BlockHeight int64 `json:"block_height"`
	ReceiveTime time.Time
}

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

func NewCollector

func NewCollector(interval float64, activeChain *chaincfg.Params, dataStore DataStore) *Collector

func (*Collector) DcrdHandlers

func (c *Collector) DcrdHandlers(ctx context.Context) *rpcclient.NotificationHandlers

func (*Collector) RegisterSyncer

func (c *Collector) RegisterSyncer(syncCoordinator *datasync.SyncCoordinator)

func (*Collector) SetClient

func (c *Collector) SetClient(client *rpcclient.Client)

func (*Collector) SetExplorerBestBlock

func (c *Collector) SetExplorerBestBlock(ctx context.Context) error

func (*Collector) StartMonitoring

func (c *Collector) StartMonitoring(ctx context.Context, charts *cache.Manager)

type DataStore

type DataStore interface {
	MempoolTableName() string
	BlockTableName() string
	VoteTableName() string
	StoreMempool(context.Context, Mempool) error
	LastMempoolTime() (entryTime time.Time, err error)
	FetchMempoolForSync(ctx context.Context, date time.Time, offtset int, limit int) ([]Mempool, int64, error)
	SaveBlock(context.Context, Block) error
	FetchBlockForSync(ctx context.Context, blockHeight int64, offtset int, limit int) ([]Block, int64, error)
	SaveVote(ctx context.Context, vote Vote) error
	FetchVoteForSync(ctx context.Context, date time.Time, offtset int, limit int) ([]Vote, int64, error)

	datasync.Store
}

type Dto

type Dto struct {
	Time                 string  `json:"time"`
	FirstSeenTime        string  `json:"first_seen_time"`
	NumberOfTransactions int     `json:"number_of_transactions"`
	Voters               int     `json:"voters"`
	Tickets              int     `json:"tickets"`
	Revocations          int     `json:"revocations"`
	Size                 int32   `json:"size"`
	TotalFee             float64 `json:"total_fee"`
	Total                float64 `json:"total"`
}

type Mempool

type Mempool struct {
	Time                 time.Time `json:"time"`
	FirstSeenTime        time.Time `json:"first_seen_time"`
	NumberOfTransactions int       `json:"number_of_transactions"`
	Voters               int       `json:"voters"`
	Tickets              int       `json:"tickets"`
	Revocations          int       `json:"revocations"`
	Size                 int32     `json:"size"`
	TotalFee             float64   `json:"total_fee"`
	Total                float64   `json:"total"`
}

type PropagationChartData

type PropagationChartData struct {
	BlockHeight    int64     `json:"block_height"`
	TimeDifference float64   `json:"time_difference"`
	BlockTime      time.Time `json:"block_time"`
}

type Vote

type Vote struct {
	Hash              string
	ReceiveTime       time.Time
	TargetedBlockTime time.Time
	BlockReceiveTime  time.Time
	VotingOn          int64
	BlockHash         string
	ValidatorId       int
	Validity          string
}

type VoteDto

type VoteDto struct {
	Hash                  string `json:"hash"`
	ReceiveTime           string `json:"receive_time"`
	TargetedBlockTimeDiff string `json:"block_time_diff"`
	BlockReceiveTimeDiff  string `json:"block_receive_time_diff"`
	VotingOn              int64  `json:"voting_on"`
	BlockHash             string `json:"block_hash"`
	ShortBlockHash        string `json:"short_block_hash"`
	ValidatorId           int    `json:"validator_id"`
	Validity              string `json:"validity"`
}

Jump to

Keyboard shortcuts

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