Documentation ¶
Index ¶
- type DB
- func (idb *DB) AddBlock(b bookkeeping.Block) error
- func (idb *DB) Close()
- func (idb *DB) GetTransactionByID(txid string) (Transaction, error)
- func (idb *DB) GetTransactionsRoundsByAddr(addr string, top uint64) ([]uint64, error)
- func (idb *DB) GetTransactionsRoundsByAddrAndDate(addr string, top uint64, from, to int64) ([]uint64, error)
- func (idb *DB) MaxRound() (uint64, error)
- type Indexer
- func (idx *Indexer) GetRoundByTXID(txID string) (uint64, error)
- func (idx *Indexer) GetRoundsByAddress(addr string, top uint64) ([]uint64, error)
- func (idx *Indexer) GetRoundsByAddressAndDate(addr string, top uint64, from, to int64) ([]uint64, error)
- func (idx *Indexer) LastBlock() (basics.Round, error)
- func (idx *Indexer) NewBlock(b bookkeeping.Block) error
- func (idx *Indexer) Shutdown()
- func (idx *Indexer) Start() error
- type Ledger
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct { // DBPath holds the db file path DBPath string // contains filtered or unexported fields }
DB is a the db access layer for Indexer
func MakeIndexerDB ¶
MakeIndexerDB takes the db path, a bool for inMemory and returns the IndexerDB control obj
func (*DB) AddBlock ¶
func (idb *DB) AddBlock(b bookkeeping.Block) error
AddBlock takes an Algorand block and stores its transactions in the DB.
func (*DB) GetTransactionByID ¶
func (idb *DB) GetTransactionByID(txid string) (Transaction, error)
GetTransactionByID takes a transaction ID and returns its transaction record
func (*DB) GetTransactionsRoundsByAddr ¶
GetTransactionsRoundsByAddr takes an address and returns all its transaction rounds records if top is 0, it will return 25 transactions by default
func (*DB) GetTransactionsRoundsByAddrAndDate ¶
func (idb *DB) GetTransactionsRoundsByAddrAndDate(addr string, top uint64, from, to int64) ([]uint64, error)
GetTransactionsRoundsByAddrAndDate takes an address and a date range (as seconds from epoch) and returns all of its transaction rounds records. if top is 0, it will return 100 transactions by default
type Indexer ¶
type Indexer struct { IDB *DB // contains filtered or unexported fields }
Indexer keeps track of transactions and their senders to enable quick retrieval.
func MakeIndexer ¶
MakeIndexer makes a new indexer.
func (*Indexer) GetRoundByTXID ¶
GetRoundByTXID takes a transactionID an returns its round number
func (*Indexer) GetRoundsByAddress ¶
GetRoundsByAddress takes an address and the number of transactions to return and returns all blocks that contain transaction where the address was the sender or the receiver.
func (*Indexer) GetRoundsByAddressAndDate ¶
func (idx *Indexer) GetRoundsByAddressAndDate(addr string, top uint64, from, to int64) ([]uint64, error)
GetRoundsByAddressAndDate takes an address, date range and maximum number of txns to return , and returns all blocks that contain the relevant transaction. if top is 0, it defaults to 100.