Documentation ¶
Index ¶
- type PostDB
- func (db *PostDB) Delete(ctx context.Context, table interface{}, round uint64) error
- func (db *PostDB) GetBlockByHash(ctx context.Context, blockHash string) (*model.Block, error)
- func (db *PostDB) GetBlockByNumber(ctx context.Context, round uint64) (*model.Block, error)
- func (db *PostDB) GetBlockHash(ctx context.Context, round uint64) (string, error)
- func (db *PostDB) GetBlockRound(ctx context.Context, hash string) (uint64, error)
- func (db *PostDB) GetBlockTransaction(ctx context.Context, blockHash string, txIndex int) (*model.Transaction, error)
- func (db *PostDB) GetBlockTransactionCountByHash(ctx context.Context, blockHash string) (int, error)
- func (db *PostDB) GetBlockTransactionCountByNumber(ctx context.Context, round uint64) (int, error)
- func (db *PostDB) GetLastIndexedRound(ctx context.Context) (uint64, error)
- func (db *PostDB) GetLastRetainedRound(ctx context.Context) (uint64, error)
- func (db *PostDB) GetLatestBlockHash(ctx context.Context) (string, error)
- func (db *PostDB) GetLatestBlockNumber(ctx context.Context) (uint64, error)
- func (db *PostDB) GetLogs(ctx context.Context, startRound, endRound uint64) ([]*model.Log, error)
- func (db *PostDB) GetTransaction(ctx context.Context, hash string) (*model.Transaction, error)
- func (db *PostDB) GetTransactionReceipt(ctx context.Context, txHash string) (*model.Receipt, error)
- func (db *PostDB) Insert(ctx context.Context, value interface{}) error
- func (db *PostDB) InsertIfNotExists(ctx context.Context, value interface{}) error
- func (db *PostDB) RunInTransaction(ctx context.Context, fn func(storage.Storage) error) error
- func (db *PostDB) RunMigrations(ctx context.Context) error
- func (db *PostDB) Upsert(ctx context.Context, value interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostDB ¶
func (*PostDB) GetBlockByHash ¶
GetBlockByHash returns the block for the given hash.
func (*PostDB) GetBlockByNumber ¶
GetBlockByNumber returns the block for the given round.
func (*PostDB) GetBlockHash ¶
GetBlockHash returns block hash by block round.
func (*PostDB) GetBlockRound ¶
GetBlockRound returns block round by block hash.
func (*PostDB) GetBlockTransaction ¶
func (db *PostDB) GetBlockTransaction(ctx context.Context, blockHash string, txIndex int) (*model.Transaction, error)
GetBlockTransaction returns transaction by bock hash and transaction index.
func (*PostDB) GetBlockTransactionCountByHash ¶
func (db *PostDB) GetBlockTransactionCountByHash(ctx context.Context, blockHash string) (int, error)
GetBlockTransactionCountByHash returns the count of transactions in block by block hash.
func (*PostDB) GetBlockTransactionCountByNumber ¶
GetBlockTransactionCountByNumber returns the count of transactions in block by block number.
func (*PostDB) GetLastIndexedRound ¶
GetLastIndexedRound returns latest indexed block round.
func (*PostDB) GetLastRetainedRound ¶
GetLastRetainedRound returns the minimum round not pruned.
func (*PostDB) GetLatestBlockHash ¶
GetLatestBlockHash returns for the block hash of the latest round.
func (*PostDB) GetLatestBlockNumber ¶
GetLatestBlockNumber returns the latest block number.
func (*PostDB) GetTransaction ¶
GetTransaction queries ethereum transaction by hash.
func (*PostDB) GetTransactionReceipt ¶
GetTransactionReceipt returns receipt by transaction hash.
func (*PostDB) InsertIfNotExists ¶ added in v1.1.0
InsertIfNotExists inserts the record if it does not yet exist.
func (*PostDB) RunInTransaction ¶
RunInTransaction runs a function in a transaction. If function returns an error transaction is rolled back, otherwise transaction is committed.