db

package
v0.0.0-...-2b9f4a6 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDB

func CreateDB()

Types

type Block

type Block struct {
	Number       int64
	Header       types.Header
	Transactions types.Transactions
}

func NewBlock

func NewBlock() *Block

func (*Block) From

func (c *Block) From(tx *types.Transaction) string

func (*Block) Read

func (c *Block) Read(fileName string) error

func (*Block) String

func (c *Block) String() string

func (*Block) Write

func (c *Block) Write(fileName string) error

type DB

type DB struct {
	// contains filtered or unexported fields
}
var Instance *DB

func NewDB

func NewDB(network string, url string, periodMs int) *DB

func (*DB) BlockExists

func (c *DB) BlockExists(blockNumber int64) bool

func (*DB) GetBlock

func (c *DB) GetBlock(blockNumber int64) (*Block, error)

func (*DB) LatestBlockNumber

func (c *DB) LatestBlockNumber() int64

func (*DB) SaveBlock

func (c *DB) SaveBlock(b *Block) error

func (*DB) Start

func (c *DB) Start()

func (*DB) State

func (c *DB) State() (minBlock int64, maxBlock int64, countOfBlocks int, network string)

func (*DB) Stop

func (c *DB) Stop()

Jump to

Keyboard shortcuts

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