Documentation
¶
Index ¶
- type BlockDatabase
- func (database *BlockDatabase) NewCachingSnapshotReadTransaction(parameters state.StateParameters) (Transaction, error)
- func (database *BlockDatabase) NewSnapshotReadTransaction(parameters state.StateParameters) Transaction
- func (database *BlockDatabase) NewTransaction(executionTime logical.Time, parameters state.StateParameters) (Transaction, error)
- type Transaction
- type TransactionPreparer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockDatabase ¶ added in v0.31.0
type BlockDatabase struct {
*primary.BlockData
*derived.DerivedBlockData
}
BlockDatabase packages the primary index (BlockData) and secondary indices (DerivedBlockData) into a single database via 2PC.
func NewBlockDatabase ¶ added in v0.31.0
func NewBlockDatabase( storageSnapshot snapshot.StorageSnapshot, snapshotTime logical.Time, cachedDerivedBlockData *derived.DerivedBlockData, ) *BlockDatabase
NOTE: storageSnapshot must be thread safe.
func (*BlockDatabase) NewCachingSnapshotReadTransaction ¶ added in v0.33.19
func (database *BlockDatabase) NewCachingSnapshotReadTransaction( parameters state.StateParameters, ) (Transaction, error)
NewCachingSnapshotReadTransaction creates a new readonly transaction that allows writing to the derived transaction data table.
func (*BlockDatabase) NewSnapshotReadTransaction ¶ added in v0.31.0
func (database *BlockDatabase) NewSnapshotReadTransaction( parameters state.StateParameters, ) Transaction
NewSnapshotReadTransaction creates a new readonly transaction.
func (*BlockDatabase) NewTransaction ¶ added in v0.31.0
func (database *BlockDatabase) NewTransaction( executionTime logical.Time, parameters state.StateParameters, ) ( Transaction, error, )
type Transaction ¶
type Transaction interface {
TransactionPreparer
// SnapshotTime returns the transaction's current snapshot time.
SnapshotTime() logical.Time
// Finalize convert transaction preparer's intermediate state into
// committable state.
Finalize() error
// Validate returns nil if the transaction does not conflict with
// previously committed transactions. It returns an error otherwise.
Validate() error
// Commit commits the transaction. If the transaction conflict with
// previously committed transactions, an error is returned and the
// transaction is not committed.
Commit() (*snapshot.ExecutionSnapshot, error)
}
type TransactionPreparer ¶ added in v0.31.0
type TransactionPreparer interface {
state.NestedTransactionPreparer
derived.DerivedTransactionPreparer
}
Click to show internal directories.
Click to hide internal directories.