db

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBPGX *pgxpool.Conn

DB is a pointer to the explorer-database

View Source
var EmbedPgsqlSchema embed.FS
View Source
var EmbedSqliteSchema embed.FS
View Source
var ReaderDb *sqlx.DB
View Source
var WriterDb *sqlx.DB

Functions

func ApplyEmbeddedDbSchema

func ApplyEmbeddedDbSchema(version int64) error

func EngineQuery added in v1.2.0

func EngineQuery(queryMap map[dbtypes.DBEngineType]string) string

func GetAssignedBlocks added in v1.1.0

func GetAssignedBlocks(proposer uint64, firstSlot uint64, offset uint64, limit uint32, withOrphaned bool) []*dbtypes.AssignedBlock

func GetBlocks

func GetBlocks(firstBlock uint64, limit uint32, withOrphaned bool) []*dbtypes.Block

func GetBlocksForSlots

func GetBlocksForSlots(firstSlot uint64, lastSlot uint64, withOrphaned bool) []*dbtypes.Block

func GetBlocksWithGraffiti

func GetBlocksWithGraffiti(graffiti string, firstSlot uint64, offset uint64, limit uint32, withOrphaned bool) []*dbtypes.Block

func GetEpochs

func GetEpochs(firstEpoch uint64, limit uint32) []*dbtypes.Epoch

func GetExplorerState

func GetExplorerState(key string, returnValue interface{}) (interface{}, error)

func GetOrphanedBlock

func GetOrphanedBlock(root []byte) *dbtypes.OrphanedBlock

func GetSlotAssignmentsForSlots

func GetSlotAssignmentsForSlots(firstSlot uint64, lastSlot uint64) []*dbtypes.SlotAssignment

func InsertBlock

func InsertBlock(block *dbtypes.Block, tx *sqlx.Tx) error

func InsertEpoch

func InsertEpoch(epoch *dbtypes.Epoch, tx *sqlx.Tx) error

func InsertOrphanedBlock

func InsertOrphanedBlock(block *dbtypes.OrphanedBlock, tx *sqlx.Tx) error

func InsertSlotAssignments

func InsertSlotAssignments(slotAssignments []*dbtypes.SlotAssignment, tx *sqlx.Tx) error

func IsEpochSynchronized

func IsEpochSynchronized(epoch uint64) bool

func MustCloseDB added in v1.2.0

func MustCloseDB()

func MustInitDB

func MustInitDB()

func SetExplorerState

func SetExplorerState(key string, value interface{}, tx *sqlx.Tx) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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