Documentation ¶
Index ¶
- func AccountsInitDbQueries(q db.Queryable) (*accountsDbQueries, error)
- func AccountsInitLightTest(tb testing.TB, e db.Executable, ...) (newDatabase bool, err error)
- func AccountsInitTest(tb testing.TB, e db.Executable, ...) (newDatabase bool)
- func AccountsUpdateSchemaTest(ctx context.Context, e db.Executable) (err error)
- func MakeAccountsSQLWriter(e db.Executable, hasAccounts, hasResources, hasKvPairs, hasCreatables bool) (w *accountsSQLWriter, err error)
- func MakeCatchpointPendingHashesIterator(hashCount int, q db.Queryable) *catchpointPendingHashesIterator
- func MakeEncodedAccountsBatchIter(q db.Queryable) *encodedAccountsBatchIter
- func MakeKVsIter(ctx context.Context, q db.Queryable) (*kvsIter, error)
- func MakeMerkleCommitter(e db.Executable, staging bool) (mc *merkleCommitter, err error)
- func MakeOnlineAccountsIter(ctx context.Context, q db.Queryable, useStaging bool, ...) (trackerdb.TableIterator[*encoded.OnlineAccountRecordV6], error)
- func MakeOnlineAccountsSQLWriter(e db.Executable, hasAccounts bool) (w *onlineAccountsSQLWriter, err error)
- func MakeOnlineRoundParamsIter(ctx context.Context, q db.Queryable, useStaging bool, ...) (trackerdb.TableIterator[*encoded.OnlineRoundParamsRecordV6], error)
- func MakeOrderedAccountsIter(e db.Executable, accountCount int) *orderedAccountsIter
- func MakeStateProofVerificationReader(q db.Queryable) trackerdb.SpVerificationCtxReader
- func MakeStore(pair db.Pair) trackerdb.Store
- func NewAccountsSQLReader(q db.Queryable) *accountsV2Reader
- func NewAccountsSQLReaderWriter(e db.Executable) *accountsV2ReaderWriter
- func NewCatchpointSQLReaderWriter(e db.Executable) *catchpointReaderWriter
- func OnlineAccountsInitDbQueries(r db.Queryable) (*onlineAccountsDbQueries, error)
- func Open(dbFilename string, dbMem bool, log logging.Logger) (store trackerdb.Store, err error)
- func OpenForTesting(t testing.TB, inMemory bool) (trackerdb.Store, string)
- func RunMigrations(ctx context.Context, e db.Executable, params trackerdb.Params, ...) (mgr trackerdb.InitParams, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccountsInitDbQueries ¶
AccountsInitDbQueries constructs an AccountsReader backed by sql queries.
func AccountsInitLightTest ¶
func AccountsInitLightTest(tb testing.TB, e db.Executable, initAccounts map[basics.Address]basics.AccountData, proto config.ConsensusParams) (newDatabase bool, err error)
AccountsInitLightTest initializes an empty database for testing without the extra methods being called. implements Testing interface, test function only
func AccountsInitTest ¶
func AccountsInitTest(tb testing.TB, e db.Executable, initAccounts map[basics.Address]basics.AccountData, proto protocol.ConsensusVersion) (newDatabase bool)
AccountsInitTest initializes an empty database for testing. implements Testing interface, test function only
func AccountsUpdateSchemaTest ¶
func AccountsUpdateSchemaTest(ctx context.Context, e db.Executable) (err error)
AccountsUpdateSchemaTest adds some empty tables for tests to work with a "v6" store.
func MakeAccountsSQLWriter ¶
func MakeAccountsSQLWriter(e db.Executable, hasAccounts, hasResources, hasKvPairs, hasCreatables bool) (w *accountsSQLWriter, err error)
MakeAccountsSQLWriter constructs an AccountsWriter backed by sql queries.
func MakeCatchpointPendingHashesIterator ¶
func MakeCatchpointPendingHashesIterator(hashCount int, q db.Queryable) *catchpointPendingHashesIterator
MakeCatchpointPendingHashesIterator create a pending hashes iterator that retrieves the hashes in the catchpointpendinghashes table.
func MakeEncodedAccountsBatchIter ¶
MakeEncodedAccountsBatchIter creates an empty accounts batch iterator.
func MakeKVsIter ¶
MakeKVsIter creates a KV iterator.
func MakeMerkleCommitter ¶
func MakeMerkleCommitter(e db.Executable, staging bool) (mc *merkleCommitter, err error)
MakeMerkleCommitter creates a MerkleCommitter object that implements the merkletrie.Committer interface allowing storing and loading merkletrie pages from a sqlite database.
func MakeOnlineAccountsIter ¶
func MakeOnlineAccountsIter(ctx context.Context, q db.Queryable, useStaging bool, excludeBefore basics.Round) (trackerdb.TableIterator[*encoded.OnlineAccountRecordV6], error)
MakeOnlineAccountsIter creates an onlineAccounts iterator, used by the catchpoint system to dump the onlineaccounts table to a catchpoint snapshot file.
If excludeBefore is non-zero, the iterator will exclude all data that would have been deleted if OnlineAccountsDelete(excludeBefore) were called on this DB before calling MakeOnlineAccountsIter.
func MakeOnlineAccountsSQLWriter ¶
func MakeOnlineAccountsSQLWriter(e db.Executable, hasAccounts bool) (w *onlineAccountsSQLWriter, err error)
MakeOnlineAccountsSQLWriter constructs an OnlineAccountsWriter backed by sql queries.
func MakeOnlineRoundParamsIter ¶
func MakeOnlineRoundParamsIter(ctx context.Context, q db.Queryable, useStaging bool, excludeBefore basics.Round) (trackerdb.TableIterator[*encoded.OnlineRoundParamsRecordV6], error)
MakeOnlineRoundParamsIter creates an onlineRoundParams iterator.
func MakeOrderedAccountsIter ¶
func MakeOrderedAccountsIter(e db.Executable, accountCount int) *orderedAccountsIter
MakeOrderedAccountsIter creates an ordered account iterator. Note that due to implementation reasons, only a single iterator can be active at a time.
func MakeStateProofVerificationReader ¶
func MakeStateProofVerificationReader(q db.Queryable) trackerdb.SpVerificationCtxReader
MakeStateProofVerificationReader returns SpVerificationCtxReader for accessing from outside of ledger
func NewAccountsSQLReader ¶
NewAccountsSQLReader creates an SQL reader
func NewAccountsSQLReaderWriter ¶
func NewAccountsSQLReaderWriter(e db.Executable) *accountsV2ReaderWriter
NewAccountsSQLReaderWriter creates an SQL reader+writer
func NewCatchpointSQLReaderWriter ¶
func NewCatchpointSQLReaderWriter(e db.Executable) *catchpointReaderWriter
NewCatchpointSQLReaderWriter creates a Catchpoint SQL reader+writer
func OnlineAccountsInitDbQueries ¶
OnlineAccountsInitDbQueries constructs an OnlineAccountsReader backed by sql queries.
func OpenForTesting ¶
OpenForTesting opens a sqlite db file for testing purposes. It set the logging to the test logger and uses a tmp directory associated to the test for the db. The test tmp direction is automatically cleaned up by the golang test framework.
func RunMigrations ¶
func RunMigrations(ctx context.Context, e db.Executable, params trackerdb.Params, log logging.Logger, targetVersion int32) (mgr trackerdb.InitParams, err error)
RunMigrations initializes the accounts DB if needed and return current account round. as part of the initialization, it tests the current database schema version, and perform upgrade procedures to bring it up to the database schema supported by the binary.
Types ¶
This section is empty.