blocks

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Apache-2.0, MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockHeader

type BlockHeader struct {
	Height          int64  `pg:",pk,use_zero,notnull"`
	Cid             string `pg:",pk,notnull"`
	Miner           string `pg:",notnull"`
	ParentWeight    string `pg:",notnull"`
	ParentBaseFee   string `pg:",notnull"`
	ParentStateRoot string `pg:",notnull"`

	WinCount      int64  `pg:",use_zero"`
	Timestamp     uint64 `pg:",use_zero"`
	ForkSignaling uint64 `pg:",use_zero"`
}

func NewBlockHeader

func NewBlockHeader(bh *types.BlockHeader) *BlockHeader

func (*BlockHeader) Persist

func (bh *BlockHeader) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

type BlockHeaders

type BlockHeaders []*BlockHeader

func (BlockHeaders) Persist

func (bhl BlockHeaders) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

type BlockParent

type BlockParent struct {
	Height int64  `pg:",pk,notnull,use_zero"`
	Block  string `pg:",pk,notnull"`
	Parent string `pg:",notnull"`
}

func (*BlockParent) Persist

func (bp *BlockParent) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

type BlockParents

type BlockParents []*BlockParent

func NewBlockParents

func NewBlockParents(header *types.BlockHeader) BlockParents

func (BlockParents) Persist

func (bps BlockParents) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

type DrandBlockEntrie

type DrandBlockEntrie struct {
	// Round is the round number of randomness used.
	Round uint64 `pg:",pk,use_zero"`
	// Block is the CID of the block.
	Block string `pg:",notnull"`
}

DrandBlockEntrie contains Drand randomness round numbers used in each block.

func (*DrandBlockEntrie) Persist

func (dbe *DrandBlockEntrie) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

type DrandBlockEntries

type DrandBlockEntries []*DrandBlockEntrie

func NewDrandBlockEntries

func NewDrandBlockEntries(header *types.BlockHeader) DrandBlockEntries

func (DrandBlockEntries) Persist

func (dbes DrandBlockEntries) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

Jump to

Keyboard shortcuts

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