collector

package
v1.5.9 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

func NewCollector

func NewCollector(nodePublicAddress string, nodePrivateAddress string, syncMissingLayersFlag bool, syncFromLayerFlag int, recalculateEpochStatsFlag bool, listener Listener, db *sql2.Database, dbClient sql.DatabaseClient) *Collector

func (*Collector) GetAccountState

func (c *Collector) GetAccountState(address string) (uint64, uint64, error)

func (*Collector) Run

func (c *Collector) Run() error

func (*Collector) StartHttpServer added in v1.5.7

func (c *Collector) StartHttpServer(apiHost string, apiPort int)

type Listener

type Listener interface {
	OnNetworkInfo(genesisId string, genesisTime uint64, epochNumLayers uint32, maxTransactionsPerSecond uint64, layerDuration uint64, postUnitSize uint64)
	OnNodeStatus(connectedPeers uint64, isSynced bool, syncedLayer uint32, topLayer uint32, verifiedLayer uint32)
	OnLayer(layer *pb.Layer)
	OnAccounts(accounts []*types.Account)
	OnReward(reward *pb.Reward)
	OnMalfeasanceProof(proof *pb.MalfeasanceProof)
	OnTransactionResult(res *pb.TransactionResult, state *pb.TransactionState)
	GetLastLayer(parent context.Context) uint32
	LayersInQueue() int
	IsLayerInQueue(layer *pb.Layer) bool
	GetEpochNumLayers() uint32
	GetTransactions(parent context.Context, query *bson.D, opts ...*options.FindOptions) ([]model.Transaction, error)
	UpdateTransactionState(parent context.Context, id string, state int32) error
	UpdateEpochStats(layer uint32)
	OnActivation(atx *types.VerifiedActivationTx)
	GetLastActivationReceived() int64
	RecalculateEpochStats()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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