blockchain

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: 12 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AVMChain

type AVMChain struct {
	*blockchain.BlockChain
	Validator *mempool.Validator
	Store     ILedgerStore
}
var DefaultChain *AVMChain

func NewBlockChain

func NewBlockChain(cfg *blockchain.Config, valditator *mempool.Validator, store ILedgerStore) (*AVMChain, error)

func (*AVMChain) GetBlockByHash

func (b *AVMChain) GetBlockByHash(hash common.Uint256) (*types.Block, error)

Get block with block hash.

func (*AVMChain) GetHeader

func (b *AVMChain) GetHeader(hash common.Uint256) (interfaces.Header, error)

type DBCache

type DBCache struct {
	RWSet *storage.RWSet
	// contains filtered or unexported fields
}

func NewDBCache

func NewDBCache(db database.Database) *DBCache

func (*DBCache) Commit

func (cache *DBCache) Commit()

func (*DBCache) FindInternal

func (cache *DBCache) FindInternal(prefix blockchain.EntryPrefix, keyPrefix string) database.Iterator

func (*DBCache) GetChainStoreDb

func (cache *DBCache) GetChainStoreDb() database.Database

func (*DBCache) GetOrAdd

func (*DBCache) GetWriteSet

func (cache *DBCache) GetWriteSet() *storage.RWSet

func (*DBCache) TryDelete

func (cache *DBCache) TryDelete(prefix blockchain.EntryPrefix, key string) bool

func (*DBCache) TryGet

func (cache *DBCache) TryGet(prefix blockchain.EntryPrefix, key string) (states.IStateValueInterface, error)

func (*DBCache) TryGetInternal

func (cache *DBCache) TryGetInternal(prefix blockchain.EntryPrefix, key string) (states.IStateValueInterface, error)

type ILedgerStore

type ILedgerStore interface {
	database.Database
	GetUnspents(txid common.Uint256) ([]*types.Output, error)
	GetTxReference(tx *types.Transaction) (map[*types.Input]*types.Output, error)
	GetAccount(programHash *common.Uint168) (*states.AccountState, error)
	ReadTransaction(hash common.Uint256) (*types.Transaction, common.Uint256, uint32, uint32)
	GetReceipts(height uint32, hash *common.Uint256) (ntype.Receipts, error)
	GetBlock(hash common.Uint256) (*types.Block, error)
	GetHeader(hash common.Uint256) (interfaces.Header, error)
}

Jump to

Keyboard shortcuts

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