system

package
v1.0.0-beta-1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2023 License: MIT, Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

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

func (s *SystemStore) AreEVMEventsPersisted(ctx context.Context, txnHash common.Hash) (bool, error)

AreEVMEventsPersisted returns true if there're events persisted for the provided txn hash, and false otherwise.

func (*SystemStore) Begin

func (s *SystemStore) Begin(_ context.Context) (*sql.Tx, error)

Begin returns a new tx.

func (*SystemStore) Close

func (s *SystemStore) Close() error

Close closes the store.

func (*SystemStore) DeletePendingTxByHash

func (s *SystemStore) DeletePendingTxByHash(ctx context.Context, hash common.Hash) error

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) GetTable

func (s *SystemStore) GetTable(ctx context.Context, id tables.TableID) (sqlstore.Table, error)

GetTable fetchs a table from its UUID.

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

func (s *SystemStore) SaveEVMEvents(ctx context.Context, events []tableland.EVMEvent) error

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
db
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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL