db

package
v0.0.0-...-5efa85e Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OsmosisRewardDistribution uint = iota
	TendermintLiquidityDepositCoinsToPool
	TendermintLiquidityDepositPoolCoinReceived
	TendermintLiquiditySwapTransactedCoinIn
	TendermintLiquiditySwapTransactedCoinOut
	TendermintLiquiditySwapTransactedFee
	TendermintLiquidityWithdrawPoolCoinSent
	TendermintLiquidityWithdrawCoinReceived
	TendermintLiquidityWithdrawFee
	OsmosisProtorevDeveloperRewardDistribution
)

Variables

This section is empty.

Functions

func CreateBlockEventParserError

func CreateBlockEventParserError(db *gorm.DB, blockEvent models.BlockEvent, parser models.BlockEventParser, parserError error) error

func CreateMessageParserError

func CreateMessageParserError(db *gorm.DB, message models.Message, parser models.MessageParser, parserError error) error

func DeleteCustomBlockEventParserError

func DeleteCustomBlockEventParserError(db *gorm.DB, blockEvent models.BlockEvent, parser models.BlockEventParser) error

func DeleteCustomMessageParserError

func DeleteCustomMessageParserError(db *gorm.DB, message models.Message, parser models.MessageParser) error

func FindOrCreateAddressByAddress

func FindOrCreateAddressByAddress(db *gorm.DB, address string) (models.Address, error)

func FindOrCreateCustomBlockEventParsers

func FindOrCreateCustomBlockEventParsers(db *gorm.DB, parsers map[string]models.BlockEventParser) error

func FindOrCreateCustomMessageParsers

func FindOrCreateCustomMessageParsers(db *gorm.DB, parsers map[string]models.MessageParser) error

func FindOrCreateDenomByBase

func FindOrCreateDenomByBase(db *gorm.DB, base string) (models.Denom, error)

func GetBlocksFromStart

func GetBlocksFromStart(db *gorm.DB, chainID uint, startHeight int64, endHeight int64) ([]models.Block, error)

func GetChains

func GetChains(db *gorm.DB) ([]models.Chain, error)

func GetDBChainID

func GetDBChainID(db *gorm.DB, chain models.Chain) (uint, error)

func GetHighestEventIndexedBlock

func GetHighestEventIndexedBlock(db *gorm.DB, chainID uint) (models.Block, error)

func GetHighestIndexedBlock

func GetHighestIndexedBlock(db *gorm.DB, chainID uint) models.Block

func IndexCustomBlockEvents

func IndexCustomBlockEvents(conf config.IndexConfig, db *gorm.DB, dryRun bool, blockDBWrapper *BlockDBWrapper, identifierLoggingString string, beginBlockParserTrackers map[string]models.BlockEventParser, endBlockParserTrackers map[string]models.BlockEventParser) error

func IndexCustomMessages

func IndexCustomMessages(conf config.IndexConfig, db *gorm.DB, dryRun bool, blockDBWrapper []TxDBWrapper, messageParserTrackers map[string]models.MessageParser) error

func MigrateInterfaces

func MigrateInterfaces(db *gorm.DB, interfaces []any) error

func MigrateModels

func MigrateModels(db *gorm.DB) error

MigrateModels runs the gorm automigrations with all the db models. This will migrate as needed and do nothing if nothing has changed.

func PostgresDbConnect

func PostgresDbConnect(host string, port string, database string, user string, password string, level string) (*gorm.DB, error)

PostgresDbConnect connects to the database according to the passed in parameters

func UpsertFailedBlock

func UpsertFailedBlock(db *gorm.DB, blockHeight int64, chainID string, chainName string) error

func UpsertFailedEventBlock

func UpsertFailedEventBlock(db *gorm.DB, blockHeight int64, chainID string, chainName string) error

Types

type BlockDBWrapper

type BlockDBWrapper struct {
	Block                         *models.Block
	BeginBlockEvents              []BlockEventDBWrapper
	EndBlockEvents                []BlockEventDBWrapper
	UniqueBlockEventTypes         map[string]models.BlockEventType
	UniqueBlockEventAttributeKeys map[string]models.BlockEventAttributeKey
}

func IndexBlockEvents

func IndexBlockEvents(db *gorm.DB, dryRun bool, blockDBWrapper *BlockDBWrapper, identifierLoggingString string) (*BlockDBWrapper, error)

type BlockEventDBWrapper

type BlockEventDBWrapper struct {
	BlockEvent               models.BlockEvent
	Attributes               []models.BlockEventAttribute
	BlockEventParsedDatasets []parsers.BlockEventParsedData
}

type DenomDBWrapper

type DenomDBWrapper struct {
	Denom models.Denom
}

type MessageDBWrapper

type MessageDBWrapper struct {
	Message               models.Message
	MessageEvents         []MessageEventDBWrapper
	MessageParsedDatasets []parsers.MessageParsedData
}

type MessageEventDBWrapper

type MessageEventDBWrapper struct {
	MessageEvent models.MessageEvent
	Attributes   []models.MessageEventAttribute
}

type TxDBWrapper

type TxDBWrapper struct {
	Tx                         models.Tx
	Messages                   []MessageDBWrapper
	UniqueMessageTypes         map[string]models.MessageType
	UniqueMessageEventTypes    map[string]models.MessageEventType
	UniqueMessageAttributeKeys map[string]models.MessageEventAttributeKey
}

Store transactions with their messages for easy database creation

func IndexNewBlock

func IndexNewBlock(db *gorm.DB, block models.Block, txs []TxDBWrapper, indexerConfig config.IndexConfig) (models.Block, []TxDBWrapper, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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