Documentation
¶
Index ¶
- Constants
- Variables
- func BlockBlobIndexKey(blockNumber uint64) []byte
- func BlockBlobKey(slot uint64, hash []byte) []byte
- func BlockBlobKeyUint64ToBytes(input uint64) []byte
- func BlockBlobMetadataKey(baseKey []byte) []byte
- func TxBlobKey(txHash []byte) []byte
- func UtxoBlobKey(txId []byte, outputIdx uint32) []byte
- type BlobItem
- type BlobIterator
- type BlobIteratorOptions
- type BlockMetadata
- type Rat
- type SignedURL
- type Txn
- type Uint64
Constants ¶
const ( BlockBlobKeyPrefix = "bp" BlockBlobIndexKeyPrefix = "bi" BlockBlobMetadataKeySuffix = "_metadata" UtxoBlobKeyPrefix = "u" TxBlobKeyPrefix = "t" )
const ( // StorageModeCore stores only consensus and chain state data. StorageModeCore = "core" // StorageModeAPI stores everything needed for API queries. StorageModeAPI = "api" )
Storage mode constants shared by the metadata plugins.
Variables ¶
var ErrBlobKeyNotFound = errors.New("blob key not found")
ErrBlobKeyNotFound is returned by blob operations when a key is missing
ErrBlobStoreUnavailable is returned when blob store cannot be accessed
var ErrNilTxn = errors.New("nil transaction")
ErrNilTxn is returned when a nil transaction is provided where a valid transaction is required
var ErrNoEpochData = errors.New(
"no epoch data available for requested slot",
)
ErrNoEpochData is returned when epoch data has not been synced yet for the requested slot. Callers should distinguish this from "no active pools" and handle it appropriately (e.g., retry after sync progresses).
var ErrNoStoreAvailable = errors.New("no store available")
ErrNoStoreAvailable is returned when no blob or metadata store is available
var ErrPartialCommit = errors.New(
"partial commit: blob committed but metadata failed",
)
ErrPartialCommit is returned when blob commits but metadata fails, leaving the database in an inconsistent state that requires recovery.
var ErrTxnWrongType = errors.New("invalid transaction type")
ErrTxnWrongType is returned when a transaction has the wrong type
var ErrUtxoConflict = errors.New("UTxO already spent")
ErrUtxoConflict is returned when a UTxO spend fails because the UTxO was already consumed by another transaction or restored by a rollback. This sentinel error allows callers to distinguish optimistic locking conflicts from other errors and retry or reject accordingly.
Functions ¶
func BlockBlobIndexKey ¶ added in v0.20.0
func BlockBlobKey ¶ added in v0.20.0
func BlockBlobKeyUint64ToBytes ¶ added in v0.20.0
func BlockBlobMetadataKey ¶ added in v0.20.0
func TxBlobKey ¶ added in v0.22.0
TxBlobKey creates a key for storing transaction offset data. Key format: 't' + txHash (32 bytes)
func UtxoBlobKey ¶ added in v0.20.0
Types ¶
type BlobIterator ¶ added in v0.19.0
type BlobIterator interface {
Rewind()
Seek(prefix []byte)
Valid() bool
ValidForPrefix(prefix []byte) bool
Next()
Item() BlobItem
Close()
Err() error
}
BlobIterator provides key iteration over the blob store.
Important lifecycle constraint: items returned by `Item()` must only be accessed while the underlying transaction used to create the iterator is still active. Implementations may validate transaction state at access time (for example `ValueCopy` may fail if the transaction has been committed or rolled back). Typical usage iterates and accesses item values within the same transaction scope.
type BlobIteratorOptions ¶ added in v0.19.0
BlobIteratorOptions configures blob iterator creation
type BlockMetadata ¶ added in v0.20.0
BlockMetadata contains metadata for a block stored in blob. IMPORTANT: Field order must remain [ID, Type, Height, PrevHash] because cbor.StructAsArray encodes/decodes by position. Changing the order would break deserialization of existing stored data.
type SignedURL ¶ added in v0.22.0
SignedURL is a url that has been pre-signed and has an expiration time