Documentation ¶
Index ¶
- Variables
- func BlockBlobHeightKey(blockNumber uint64) []byte
- func BlockBlobKey(slot uint64, hash []byte) []byte
- func BlockBlobKeyHashHex(slot uint64, hashHex string) ([]byte, error)
- func BlockBlobMetadataKey(baseKey []byte) []byte
- func BlockCreateTxn(txn *database.Txn, block Block) error
- func BlockDeleteTxn(txn *database.Txn, block Block) error
- func TipGet(db database.Database) (ochainsync.Tip, error)
- func TipGetTxn(txn *database.Txn) (ochainsync.Tip, error)
- func TipUpdateTxn(txn *database.Txn, tip ochainsync.Tip) error
- func UtxoBlobKey(txId []byte, outputIdx uint32) []byte
- func UtxoDelete(db database.Database, utxo Utxo) error
- func UtxoDeleteTxn(txn *database.Txn, utxo Utxo) error
- func UtxosDeleteTxn(txn *database.Txn, utxos []Utxo) error
- type Block
- func BlockBeforeSlot(db database.Database, slotNumber uint64) (Block, error)
- func BlockBeforeSlotTxn(txn *database.Txn, slotNumber uint64) (Block, error)
- func BlockByNumber(db database.Database, blockNumber uint64) (Block, error)
- func BlockByNumberTxn(txn *database.Txn, blockNumber uint64) (Block, error)
- func BlockByPoint(db database.Database, point ocommon.Point) (Block, error)
- func BlockByPointTxn(txn *database.Txn, point ocommon.Point) (Block, error)
- func BlocksAfterSlotTxn(txn *database.Txn, slotNumber uint64) ([]Block, error)
- func BlocksRecent(db database.Database, count int) ([]Block, error)
- func BlocksRecentTxn(txn *database.Txn, count int) ([]Block, error)
- type BlockBlobMetadata
- type Epoch
- type PParamUpdate
- type PParams
- type PoolRegistration
- type PoolRegistrationOwner
- type PoolRegistrationRelay
- type PoolRetirement
- type StakeDelegation
- type StakeDeregistration
- type StakeRegistration
- type Tip
- type Utxo
- func UtxoByRef(db database.Database, txId []byte, outputIdx uint32) (Utxo, error)
- func UtxoByRefTxn(txn *database.Txn, txId []byte, outputIdx uint32) (Utxo, error)
- func UtxosByAddress(db database.Database, addr ledger.Address) ([]Utxo, error)
- func UtxosByAddressTxn(txn *database.Txn, addr ledger.Address) ([]Utxo, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBlockNotFound = fmt.Errorf("block not found")
View Source
var MigrateModels = []any{ &Epoch{}, &PoolRegistration{}, &PoolRegistrationOwner{}, &PoolRegistrationRelay{}, &PoolRetirement{}, &StakeRegistration{}, &StakeDeregistration{}, &StakeDelegation{}, &PParams{}, &PParamUpdate{}, &Tip{}, &Utxo{}, }
MigrateModels contains a list of model objects that should have DB migrations applied
Functions ¶
func BlockBlobHeightKey ¶ added in v0.3.3
func BlockBlobKey ¶
func BlockBlobMetadataKey ¶ added in v0.3.3
func TipUpdateTxn ¶ added in v0.3.1
func TipUpdateTxn(txn *database.Txn, tip ochainsync.Tip) error
func UtxoBlobKey ¶
Types ¶
type Block ¶
type Block struct { Slot uint64 Number uint64 Hash []byte Type uint PrevHash []byte Nonce []byte Cbor []byte }
func BlockBeforeSlot ¶ added in v0.3.3
func BlockBeforeSlotTxn ¶ added in v0.3.3
func BlocksAfterSlotTxn ¶ added in v0.3.3
func BlocksRecent ¶ added in v0.3.3
func BlocksRecentTxn ¶ added in v0.3.3
type BlockBlobMetadata ¶ added in v0.3.3
type Epoch ¶
type PParamUpdate ¶
type PParamUpdate struct { ID uint `gorm:"primarykey"` AddedSlot uint64 Epoch uint64 GenesisHash []byte Cbor []byte }
func (PParamUpdate) TableName ¶
func (PParamUpdate) TableName() string
type PParams ¶
type PoolRegistration ¶
type PoolRegistration struct { ID uint `gorm:"primarykey"` PoolKeyHash []byte `gorm:"index"` VrfKeyHash []byte Pledge database.Uint64 Cost database.Uint64 Margin *database.Rat Owners []PoolRegistrationOwner Relays []PoolRegistrationRelay MetadataUrl string MetadataHash []byte AddedSlot uint64 }
func (PoolRegistration) TableName ¶
func (PoolRegistration) TableName() string
type PoolRegistrationOwner ¶
type PoolRegistrationOwner struct { ID uint `gorm:"primarykey"` PoolRegistrationID uint KeyHash []byte }
func (PoolRegistrationOwner) TableName ¶
func (PoolRegistrationOwner) TableName() string
type PoolRegistrationRelay ¶
type PoolRegistrationRelay struct { ID uint `gorm:"primarykey"` PoolRegistrationID uint Port uint Ipv4 *net.IP Ipv6 *net.IP Hostname string }
func (PoolRegistrationRelay) TableName ¶
func (PoolRegistrationRelay) TableName() string
type PoolRetirement ¶
type PoolRetirement struct { ID uint `gorm:"primarykey"` PoolKeyHash []byte `gorm:"index"` Epoch uint AddedSlot uint64 }
func (PoolRetirement) TableName ¶
func (PoolRetirement) TableName() string
type StakeDelegation ¶
type StakeDelegation struct { ID uint `gorm:"primarykey"` StakingKey []byte `gorm:"index"` PoolKeyHash []byte `gorm:"index"` AddedSlot uint64 }
func (StakeDelegation) TableName ¶
func (StakeDelegation) TableName() string
type StakeDeregistration ¶
type StakeDeregistration struct { ID uint `gorm:"primarykey"` StakingKey []byte `gorm:"index"` AddedSlot uint64 }
func (StakeDeregistration) TableName ¶
func (StakeDeregistration) TableName() string
type StakeRegistration ¶
type StakeRegistration struct { ID uint `gorm:"primarykey"` StakingKey []byte `gorm:"index"` AddedSlot uint64 }
func (StakeRegistration) TableName ¶
func (StakeRegistration) TableName() string
type Utxo ¶
type Utxo struct { ID uint `gorm:"primarykey"` TxId []byte `gorm:"index:tx_id_output_idx"` OutputIdx uint32 `gorm:"index:tx_id_output_idx"` AddedSlot uint64 `gorm:"index"` DeletedSlot uint64 `gorm:"index"` PaymentKey []byte `gorm:"index"` StakingKey []byte `gorm:"index"` Cbor []byte `gorm:"-"` // This is here for convenience but not represented in the metadata DB }
func UtxoByRefTxn ¶
func UtxosByAddress ¶
func UtxosByAddressTxn ¶
Click to show internal directories.
Click to hide internal directories.