store

package
v0.0.0-...-e920dd0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package rawdb contains a collection of low level database accessors.

Index

Constants

View Source
const AccountPersisFlag = "AccountPersisFlag"
View Source
const DEPLOY_TRANSACTION = "DeployTransaction"
View Source
const INVOKE_TRANSACTION = "InvokeTransaction"
View Source
const (
	PersisAccount blockchain.StoreFuncName = "PersisAccount"
)
View Source
const RunTime_Log = "RunTime_Log"
View Source
const RunTime_Notify = "RunTime_Notify"

Variables

View Source
var (
	ErrDBNotFound = errors.New("leveldb: not found")
)

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.

func UseLogger

func UseLogger(logger elalog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using elalog.

Types

type CacheCodeTable

type CacheCodeTable struct {
	// contains filtered or unexported fields
}

func NewCacheCodeTable

func NewCacheCodeTable(dbCache *blockchain.DBCache) *CacheCodeTable

func (*CacheCodeTable) GetScript

func (table *CacheCodeTable) GetScript(codeHash []byte) []byte

func (*CacheCodeTable) GetTxReference

func (table *CacheCodeTable) GetTxReference(tx *interfaces.IDataContainer) (map[*types.Input]*types.Output, error)

type LedgerStore

type LedgerStore struct {
	*sb.ChainStore
}

func NewLedgerStore

func NewLedgerStore(store *sb.ChainStore) (*LedgerStore, error)

func (*LedgerStore) Close

func (c *LedgerStore) Close() error

func (*LedgerStore) DeleteTxLookupEntry

func (c *LedgerStore) DeleteTxLookupEntry(hash common.Uint256) error

DeleteTxLookupEntry removes all transaction data associated with a hash.

func (*LedgerStore) GetAccount

func (c *LedgerStore) GetAccount(programHash *common.Uint168) (*states.AccountState, error)

func (*LedgerStore) GetBlock

func (c *LedgerStore) GetBlock(hash common.Uint256) (*side.Block, error)

func (*LedgerStore) GetContract

func (c *LedgerStore) GetContract(codeHash *common.Uint168) ([]byte, error)

func (*LedgerStore) GetHeader

func (s *LedgerStore) GetHeader(hash common.Uint256) (interfaces.Header, error)

func (*LedgerStore) GetReceipts

func (c *LedgerStore) GetReceipts(height uint32, hash *common.Uint256) (types.Receipts, error)

func (*LedgerStore) GetTxLookupEntry

func (c *LedgerStore) GetTxLookupEntry(hash common.Uint256) common.Uint256

ReadTxLookupEntry retrieves the positional metadata associated with a transaction hash to allow retrieving the transaction or receipt by hash.

func (*LedgerStore) GetUnspents

func (c *LedgerStore) GetUnspents(txid common.Uint256) ([]*side.Output, error)

func (*LedgerStore) PersisAccount

func (c *LedgerStore) PersisAccount(batch database.Batch, block *side.Block) error

func (*LedgerStore) PersisInvokeTransaction

func (c *LedgerStore) PersisInvokeTransaction(block *side.Block, tx *side.Transaction, batch database.Batch) (*types.Receipt, error)

func (*LedgerStore) PersistDeployTransaction

func (c *LedgerStore) PersistDeployTransaction(block *side.Block, tx *side.Transaction, batch database.Batch) error

func (*LedgerStore) ReadTransaction

func (c *LedgerStore) ReadTransaction(hash common.Uint256) (*side.Transaction, common.Uint256, uint32, uint32)

ReadTransaction retrieves a specific transaction from the database, along with its added positional metadata.

func (*LedgerStore) WriteReceipts

func (c *LedgerStore) WriteReceipts(block *side.Block, receipts types.Receipts) error

func (*LedgerStore) WriteTxLookupEntries

func (c *LedgerStore) WriteTxLookupEntries(block *side.Block)

WriteTxLookupEntries stores a positional metadata for every transaction from a block, enabling hash based transaction and receipt lookups.

type ResponseExt

type ResponseExt struct {
	Action   string
	Result   bool
	Error    int
	Desc     interface{}
	TxID     string
	CodeHash string
}

Response represent the response data structure.

Jump to

Keyboard shortcuts

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