Documentation ¶
Index ¶
- type IndexerDb
- func (db *IndexerDb) AddBlock(vb *itypes.ValidatedBlock) error
- func (db *IndexerDb) AppLocalState(ctx context.Context, filter idb.ApplicationQuery) (<-chan idb.AppLocalStateRow, uint64)
- func (db *IndexerDb) ApplicationBoxes(ctx context.Context, queryOpts idb.ApplicationBoxQuery) (<-chan idb.ApplicationBoxRow, uint64)
- func (db *IndexerDb) Applications(ctx context.Context, filter idb.ApplicationQuery) (<-chan idb.ApplicationRow, uint64)
- func (db *IndexerDb) AssetBalances(ctx context.Context, abq idb.AssetBalanceQuery) (<-chan idb.AssetBalanceRow, uint64)
- func (db *IndexerDb) Assets(ctx context.Context, filter idb.AssetsQuery) (<-chan idb.AssetRow, uint64)
- func (db *IndexerDb) Close()
- func (db *IndexerDb) DeleteTransactions(ctx context.Context, keep uint64) error
- func (db *IndexerDb) GetAccounts(ctx context.Context, opts idb.AccountQueryOptions) (<-chan idb.AccountRow, uint64)
- func (db *IndexerDb) GetBlock(ctx context.Context, round uint64, options idb.GetBlockOptions) (blockHeader sdk.BlockHeader, transactions []idb.TxnRow, err error)
- func (db *IndexerDb) GetNetworkState() (idb.NetworkState, error)
- func (db *IndexerDb) GetNextRoundToAccount() (uint64, error)
- func (db *IndexerDb) GetSpecialAccounts(ctx context.Context) (itypes.SpecialAddresses, error)
- func (db *IndexerDb) Health(ctx context.Context) (idb.Health, error)
- func (db *IndexerDb) LoadGenesis(genesis sdk.Genesis) error
- func (db *IndexerDb) SetNetworkState(gh sdk.Digest) error
- func (db *IndexerDb) Transactions(ctx context.Context, tf idb.TransactionFilter) (<-chan idb.TxnRow, uint64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IndexerDb ¶
type IndexerDb struct {
// contains filtered or unexported fields
}
IndexerDb is an idb.IndexerDB implementation
func OpenPostgres ¶
func OpenPostgres(connection string, opts idb.IndexerDbOptions, log *log.Logger) (*IndexerDb, chan struct{}, error)
OpenPostgres is available for creating test instances of postgres.IndexerDb Returns an error object and a channel that gets closed when blocking migrations finish running successfully.
func (*IndexerDb) AddBlock ¶
func (db *IndexerDb) AddBlock(vb *itypes.ValidatedBlock) error
AddBlock is part of idb.IndexerDb.
func (*IndexerDb) AppLocalState ¶
func (db *IndexerDb) AppLocalState(ctx context.Context, filter idb.ApplicationQuery) (<-chan idb.AppLocalStateRow, uint64)
AppLocalState is part of idb.IndexerDB
func (*IndexerDb) ApplicationBoxes ¶
func (db *IndexerDb) ApplicationBoxes(ctx context.Context, queryOpts idb.ApplicationBoxQuery) (<-chan idb.ApplicationBoxRow, uint64)
ApplicationBoxes is part of interface idb.IndexerDB. The most complex query formed looks like:
WITH apps AS (SELECT index AS app FROM app WHERE index = $1) SELECT a.app, ab.name, ab.value FROM apps a LEFT OUTER JOIN app_box ab ON ab.app = a.app AND name [= or >] $2 ORDER BY ab.name ASC LIMIT {queryOpts.Limit}
where the binary operator in the last line is `=` for the box lookup and `>` for boxes search with query substitutions: $1 <-- queryOpts.ApplicationID $2 <-- queryOpts.BoxName $3 <-- queryOpts.PrevFinalBox
func (*IndexerDb) Applications ¶
func (db *IndexerDb) Applications(ctx context.Context, filter idb.ApplicationQuery) (<-chan idb.ApplicationRow, uint64)
Applications is part of idb.IndexerDB
func (*IndexerDb) AssetBalances ¶
func (db *IndexerDb) AssetBalances(ctx context.Context, abq idb.AssetBalanceQuery) (<-chan idb.AssetBalanceRow, uint64)
AssetBalances is part of idb.IndexerDB
func (*IndexerDb) Assets ¶
func (db *IndexerDb) Assets(ctx context.Context, filter idb.AssetsQuery) (<-chan idb.AssetRow, uint64)
Assets is part of idb.IndexerDB
func (*IndexerDb) DeleteTransactions ¶
DeleteTransactions removes old transactions keep is the number of rounds to keep in db
func (*IndexerDb) GetAccounts ¶
func (db *IndexerDb) GetAccounts(ctx context.Context, opts idb.AccountQueryOptions) (<-chan idb.AccountRow, uint64)
GetAccounts is part of idb.IndexerDB
func (*IndexerDb) GetBlock ¶
func (db *IndexerDb) GetBlock(ctx context.Context, round uint64, options idb.GetBlockOptions) (blockHeader sdk.BlockHeader, transactions []idb.TxnRow, err error)
GetBlock is part of idb.IndexerDB
func (*IndexerDb) GetNetworkState ¶
func (db *IndexerDb) GetNetworkState() (idb.NetworkState, error)
GetNetworkState is part of idb.IndexerDB
func (*IndexerDb) GetNextRoundToAccount ¶
GetNextRoundToAccount is part of idb.IndexerDB Returns ErrorNotInitialized if genesis is not loaded.
func (*IndexerDb) GetSpecialAccounts ¶
GetSpecialAccounts is part of idb.IndexerDB
func (*IndexerDb) LoadGenesis ¶
LoadGenesis is part of idb.IndexerDB
func (*IndexerDb) SetNetworkState ¶
SetNetworkState is part of idb.IndexerDB
func (*IndexerDb) Transactions ¶
func (db *IndexerDb) Transactions(ctx context.Context, tf idb.TransactionFilter) (<-chan idb.TxnRow, uint64)
Transactions is part of idb.IndexerDB