blocksynchronizer

package
v0.0.0-...-8401909 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAndInsertBlockData

func GetAndInsertBlockData(
	log *zap.SugaredLogger,
	algodClient *algod.Client,
	blockCore *block.Core,
	transactionCore *transaction.Core,
	accountCore *account.Core,
	assetCore *asset.Core,
	appCore *application.Core,
	algodCore *algod2.Core,
	blockNum uint64) error

Types

type BlockSynchronizer

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

BlockSynchronizer provides the ability to retrieve block data on an interval.

func New

func New(log *zap.SugaredLogger, interval time.Duration, algodClient *algod.Client, cfg couchdb.Config, hub *websocket.Hub, dbName string) (*BlockSynchronizer, error)

New creates a BlockSynchronizer for retrieving block data and saving it to CouchDB.

func (*BlockSynchronizer) Stop

func (p *BlockSynchronizer) Stop()

Stop is used to shutdown the goroutine for syncing block data.

type WsMessage

type WsMessage struct {
	Block            models.Block `json:"block"`
	TransactionList  []string     `json:"transaction_ids"`
	AccountList      []string     `json:"account_ids"`
	AssetList        []uint64     `json:"asset_ids"`
	AppList          []uint64     `json:"app_ids"`
	AvgBlockTxnSpeed float64      `json:"avg_block_txn_speed"`
}

Jump to

Keyboard shortcuts

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