Documentation ¶
Index ¶
- type SystemStore
- func (s *SystemStore) AreEVMEventsPersisted(ctx context.Context, txnHash common.Hash) (bool, error)
- func (s *SystemStore) Begin(_ context.Context) (*sql.Tx, error)
- func (s *SystemStore) Close() error
- func (s *SystemStore) DeletePendingTxByHash(ctx context.Context, hash common.Hash) error
- func (s *SystemStore) GetACLOnTableByController(ctx context.Context, id tables.TableID, controller string) (sqlstore.SystemACL, error)
- func (s *SystemStore) GetBlockExtraInfo(ctx context.Context, blockNumber int64) (tableland.EVMBlockInfo, error)
- func (s *SystemStore) GetBlocksMissingExtraInfo(ctx context.Context, lastKnownHeight *int64) ([]int64, error)
- func (s *SystemStore) GetEVMEvents(ctx context.Context, txnHash common.Hash) ([]tableland.EVMEvent, error)
- func (s *SystemStore) GetID(ctx context.Context) (string, error)
- func (s *SystemStore) GetReceipt(ctx context.Context, txnHash string) (eventprocessor.Receipt, bool, error)
- func (s *SystemStore) GetSchemaByTableName(ctx context.Context, name string) (sqlstore.TableSchema, error)
- func (s *SystemStore) GetTable(ctx context.Context, id tables.TableID) (sqlstore.Table, error)
- func (s *SystemStore) GetTablesByController(ctx context.Context, controller string) ([]sqlstore.Table, error)
- func (s *SystemStore) GetTablesByStructure(ctx context.Context, structure string) ([]sqlstore.Table, error)
- func (s *SystemStore) InsertBlockExtraInfo(ctx context.Context, blockNumber int64, timestamp uint64) error
- func (s *SystemStore) InsertPendingTx(ctx context.Context, addr common.Address, nonce int64, hash common.Hash) error
- func (s *SystemStore) ListPendingTx(ctx context.Context, addr common.Address) ([]nonce.PendingTx, error)
- func (s *SystemStore) ReplacePendingTxByHash(ctx context.Context, oldHash common.Hash, newHash common.Hash) error
- func (s *SystemStore) SaveEVMEvents(ctx context.Context, events []tableland.EVMEvent) error
- func (s *SystemStore) WithTx(tx *sql.Tx) sqlstore.SystemStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SystemStore ¶
type SystemStore struct {
// contains filtered or unexported fields
}
SystemStore provides a persistent layer for storage requests. The methods implemented by this layer can be executed inside a given transaction or not. For safety reasons, this layer has no access to the database object or the transaction object. The access is made through the dbWithTx interface.
func New ¶
func New(dbURI string, chainID tableland.ChainID) (*SystemStore, error)
New returns a new SystemStore backed by database/sql.
func (*SystemStore) AreEVMEventsPersisted ¶
AreEVMEventsPersisted returns true if there're events persisted for the provided txn hash, and false otherwise.
func (*SystemStore) DeletePendingTxByHash ¶
DeletePendingTxByHash deletes a pending tx.
func (*SystemStore) GetACLOnTableByController ¶
func (s *SystemStore) GetACLOnTableByController( ctx context.Context, id tables.TableID, controller string, ) (sqlstore.SystemACL, error)
GetACLOnTableByController returns the privileges on table stored in the database for a given controller.
func (*SystemStore) GetBlockExtraInfo ¶
func (s *SystemStore) GetBlockExtraInfo(ctx context.Context, blockNumber int64) (tableland.EVMBlockInfo, error)
GetBlockExtraInfo info returns stored information about an EVM block.
func (*SystemStore) GetBlocksMissingExtraInfo ¶
func (s *SystemStore) GetBlocksMissingExtraInfo(ctx context.Context, lastKnownHeight *int64) ([]int64, error)
GetBlocksMissingExtraInfo returns a list of block numbers that don't contain enhanced information. It receives an optional fromHeight to only look for blocks after a block number. If null it will look for blocks at any height.
func (*SystemStore) GetEVMEvents ¶
func (s *SystemStore) GetEVMEvents(ctx context.Context, txnHash common.Hash) ([]tableland.EVMEvent, error)
GetEVMEvents returns all the persisted events for a transaction.
func (*SystemStore) GetID ¶
func (s *SystemStore) GetID(ctx context.Context) (string, error)
GetID returns node identifier.
func (*SystemStore) GetReceipt ¶
func (s *SystemStore) GetReceipt( ctx context.Context, txnHash string, ) (eventprocessor.Receipt, bool, error)
GetReceipt returns a event receipt by transaction hash.
func (*SystemStore) GetSchemaByTableName ¶
func (s *SystemStore) GetSchemaByTableName(ctx context.Context, name string) (sqlstore.TableSchema, error)
GetSchemaByTableName get the schema of a table by its name.
func (*SystemStore) GetTablesByController ¶
func (s *SystemStore) GetTablesByController(ctx context.Context, controller string) ([]sqlstore.Table, error)
GetTablesByController fetchs a table from controller address.
func (*SystemStore) GetTablesByStructure ¶
func (s *SystemStore) GetTablesByStructure(ctx context.Context, structure string) ([]sqlstore.Table, error)
GetTablesByStructure gets all tables with a particular structure hash.
func (*SystemStore) InsertBlockExtraInfo ¶
func (s *SystemStore) InsertBlockExtraInfo(ctx context.Context, blockNumber int64, timestamp uint64) error
InsertBlockExtraInfo inserts enhanced information for a block.
func (*SystemStore) InsertPendingTx ¶
func (s *SystemStore) InsertPendingTx( ctx context.Context, addr common.Address, nonce int64, hash common.Hash, ) error
InsertPendingTx insert a new pending tx.
func (*SystemStore) ListPendingTx ¶
func (s *SystemStore) ListPendingTx(ctx context.Context, addr common.Address) ([]nonce.PendingTx, error)
ListPendingTx lists all pendings txs.
func (*SystemStore) ReplacePendingTxByHash ¶
func (s *SystemStore) ReplacePendingTxByHash(ctx context.Context, oldHash common.Hash, newHash common.Hash) error
ReplacePendingTxByHash replaces the txn hash of a pending txn and bumps the counter of how many times this happened.
func (*SystemStore) SaveEVMEvents ¶
SaveEVMEvents saves the provider EVMEvents.
func (*SystemStore) WithTx ¶
func (s *SystemStore) WithTx(tx *sql.Tx) sqlstore.SystemStore
WithTx returns a copy of the current SystemStore with a tx attached.
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
Package migrations generated by go-bindata.// sources: migrations/001_init.down.sql migrations/001_init.up.sql migrations/002_receipterroridx.down.sql migrations/002_receipterroridx.up.sql migrations/003_evm_events.down.sql migrations/003_evm_events.up.sql migrations/004_system_id.down.sql migrations/004_system_id.up.sql
|
Package migrations generated by go-bindata.// sources: migrations/001_init.down.sql migrations/001_init.up.sql migrations/002_receipterroridx.down.sql migrations/002_receipterroridx.up.sql migrations/003_evm_events.down.sql migrations/003_evm_events.up.sql migrations/004_system_id.down.sql migrations/004_system_id.up.sql |