ledger

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: LGPL-3.0 Imports: 11 Imported by: 80

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ledger

type Ledger struct {
	// contains filtered or unexported fields
}
var DefLedger *Ledger

func NewLedger

func NewLedger(dataDir string, stateHashHeight uint32) (*Ledger, error)

func (*Ledger) AddBlock

func (self *Ledger) AddBlock(block *types.Block, stateMerkleRoot common.Uint256) error

func (*Ledger) AddHeaders

func (self *Ledger) AddHeaders(headers []*types.Header) error

func (*Ledger) Close

func (self *Ledger) Close() error

func (*Ledger) ExecuteBlock added in v1.6.0

func (self *Ledger) ExecuteBlock(b *types.Block) (store.ExecuteResult, error)

func (*Ledger) GetBlockByHash

func (self *Ledger) GetBlockByHash(blockHash common.Uint256) (*types.Block, error)

func (*Ledger) GetBlockByHeight

func (self *Ledger) GetBlockByHeight(height uint32) (*types.Block, error)

func (*Ledger) GetBlockHash

func (self *Ledger) GetBlockHash(height uint32) common.Uint256

func (*Ledger) GetBlockRootWithNewTxRoots added in v1.6.0

func (self *Ledger) GetBlockRootWithNewTxRoots(startHeight uint32, txRoots []common.Uint256) common.Uint256

func (*Ledger) GetBookkeeperState

func (self *Ledger) GetBookkeeperState() (*states.BookkeeperState, error)

func (*Ledger) GetContractState

func (self *Ledger) GetContractState(contractHash common.Address) (*payload.DeployCode, error)

func (*Ledger) GetCurrentBlockHash

func (self *Ledger) GetCurrentBlockHash() common.Uint256

func (*Ledger) GetCurrentBlockHeight

func (self *Ledger) GetCurrentBlockHeight() uint32

func (*Ledger) GetCurrentHeaderHash

func (self *Ledger) GetCurrentHeaderHash() common.Uint256

func (*Ledger) GetCurrentHeaderHeight

func (self *Ledger) GetCurrentHeaderHeight() uint32

func (*Ledger) GetCurrentStateRoot

func (self *Ledger) GetCurrentStateRoot() (common.Uint256, error)

func (*Ledger) GetEventNotifyByBlock

func (self *Ledger) GetEventNotifyByBlock(height uint32) ([]*event.ExecuteNotify, error)

func (*Ledger) GetEventNotifyByTx

func (self *Ledger) GetEventNotifyByTx(tx common.Uint256) (*event.ExecuteNotify, error)

func (*Ledger) GetHeaderByHash

func (self *Ledger) GetHeaderByHash(blockHash common.Uint256) (*types.Header, error)

func (*Ledger) GetHeaderByHeight

func (self *Ledger) GetHeaderByHeight(height uint32) (*types.Header, error)

func (*Ledger) GetMerkleProof

func (self *Ledger) GetMerkleProof(proofHeight, rootHeight uint32) ([]common.Uint256, error)

func (*Ledger) GetRawHeaderByHash added in v1.6.2

func (self *Ledger) GetRawHeaderByHash(blockHash common.Uint256) (*types.RawHeader, error)

func (*Ledger) GetStateMerkleRoot added in v1.6.0

func (self *Ledger) GetStateMerkleRoot(height uint32) (result common.Uint256, err error)

func (*Ledger) GetStorageItem

func (self *Ledger) GetStorageItem(codeHash common.Address, key []byte) ([]byte, error)

func (*Ledger) GetStore

func (self *Ledger) GetStore() store.LedgerStore

func (*Ledger) GetTransaction

func (self *Ledger) GetTransaction(txHash common.Uint256) (*types.Transaction, error)

func (*Ledger) GetTransactionWithHeight

func (self *Ledger) GetTransactionWithHeight(txHash common.Uint256) (*types.Transaction, uint32, error)

func (*Ledger) Init

func (self *Ledger) Init(defaultBookkeeper []keypair.PublicKey, genesisBlock *types.Block) error

func (*Ledger) IsContainBlock

func (self *Ledger) IsContainBlock(blockHash common.Uint256) (bool, error)

func (*Ledger) IsContainTransaction

func (self *Ledger) IsContainTransaction(txHash common.Uint256) (bool, error)

func (*Ledger) PreExecuteContract

func (self *Ledger) PreExecuteContract(tx *types.Transaction) (*cstate.PreExecResult, error)

func (*Ledger) SubmitBlock added in v1.6.0

func (self *Ledger) SubmitBlock(b *types.Block, exec store.ExecuteResult) error

Jump to

Keyboard shortcuts

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