models

package
v0.0.94 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	ID      uint
	Address string `gorm:"uniqueIndex"`
}

type Block

type Block struct {
	ID                    uint
	TimeStamp             time.Time
	Height                int64 `gorm:"uniqueIndex:chainheight"`
	ChainID               uint  `gorm:"uniqueIndex:chainheight"`
	Chain                 Chain
	ProposerConsAddress   Address
	ProposerConsAddressID uint
	TxIndexed             bool
	TotalTxs              int
	// TODO: Should block event indexing be split out or rolled up?
	BlockEventsIndexed bool
	BlockHash          string
	Signatures         []BlockSignature
}

type BlockEvent

type BlockEvent struct {
	ID uint
	// These fields uniquely identify every block event
	// Index refers to the position of the event in the block event lifecycle array
	// LifecyclePosition refers to whether the event is a BeginBlock or EndBlock event
	Index             uint64                 `gorm:"uniqueIndex:eventBlockPositionIndex,priority:3"`
	LifecyclePosition BlockLifecyclePosition `gorm:"uniqueIndex:eventBlockPositionIndex,priority:2"`
	BlockID           uint                   `gorm:"uniqueIndex:eventBlockPositionIndex,priority:1"`
	Block             Block
	BlockEventTypeID  uint
	BlockEventType    BlockEventType
}

type BlockEventAttribute

type BlockEventAttribute struct {
	ID           uint
	BlockEvent   BlockEvent
	BlockEventID uint `gorm:"uniqueIndex:eventAttributeIndex,priority:1"`
	Value        string
	Index        uint64 `gorm:"uniqueIndex:eventAttributeIndex,priority:2"`
	// Keys are limited to a smallish subset of string values set by the Cosmos SDK and external modules
	// Save DB space by storing the key as a foreign key
	BlockEventAttributeKeyID uint
	BlockEventAttributeKey   BlockEventAttributeKey
}

type BlockEventAttributeKey

type BlockEventAttributeKey struct {
	ID  uint
	Key string `gorm:"uniqueIndex"`
}

type BlockEventParser

type BlockEventParser struct {
	ID                     uint
	BlockLifecyclePosition BlockLifecyclePosition `gorm:"uniqueIndex:idx_block_event_parser_identifier_lifecycle_position"`
	Identifier             string                 `gorm:"uniqueIndex:idx_block_event_parser_identifier_lifecycle_position"`
}

type BlockEventParserError

type BlockEventParserError struct {
	ID                 uint
	BlockEventParserID uint
	BlockEventParser   BlockEventParser
	BlockEventID       uint
	BlockEvent         BlockEvent
	Error              string
}

type BlockEventType

type BlockEventType struct {
	ID   uint
	Type string `gorm:"uniqueIndex"`
}

type BlockLifecyclePosition

type BlockLifecyclePosition int

Used to keep track of BeginBlock and EndBlock events

const (
	BeginBlockEvent BlockLifecyclePosition = iota
	EndBlockEvent
)

type BlockSignature

type BlockSignature struct {
	ID               uint
	BlockID          uint64 `gorm:"uniqueIndex:idx_bl_signature"`
	Block            Block
	ValidatorAddress string `gorm:"uniqueIndex:idx_bl_signature"`
	Timestamp        time.Time
	Signature        []byte `gorm:"type:bytea"`
}

type Chain

type Chain struct {
	ID      uint   `gorm:"primaryKey"`
	ChainID string `gorm:"uniqueIndex"` // e.g. osmosis-1
	Name    string // e.g. Osmosis
}

type Denom

type Denom struct {
	ID   uint
	Base string `gorm:"uniqueIndex"`
}

type FailedBlock

type FailedBlock struct {
	ID           uint
	Height       int64 `gorm:"uniqueIndex:failedchainheight"`
	BlockchainID uint  `gorm:"uniqueIndex:failedchainheight"`
	Chain        Chain `gorm:"foreignKey:BlockchainID"`
}

type FailedEventBlock

type FailedEventBlock struct {
	ID           uint
	Height       int64 `gorm:"uniqueIndex:failedchaineventheight"`
	BlockchainID uint  `gorm:"uniqueIndex:failedchaineventheight"`
	Chain        Chain `gorm:"foreignKey:BlockchainID"`
}

Jump to

Keyboard shortcuts

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