vm

package
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: ISC Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UseLogger

func UseLogger(logger l.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type Factory

type Factory interface {
	New() (consensus.ChainVM, error)
	GetVM() consensus.ChainVM
	Context() *consensus.Context
}

type PublicVMAPI

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

func NewPublicVMAPI

func NewPublicVMAPI(s *Service) *PublicVMAPI

func (*PublicVMAPI) GetVMsInfo

func (api *PublicVMAPI) GetVMsInfo() (interface{}, error)

type Service

type Service struct {
	service.Service
	// contains filtered or unexported fields
}

func NewService

func NewService(cons model.Consensus) (*Service, error)

func (*Service) APIs

func (s *Service) APIs() []api.API

func (*Service) AddTxToMempool

func (s *Service) AddTxToMempool(tx *types.Transaction, local bool) (int64, error)

func (*Service) BlockChain added in v1.0.21

func (s *Service) BlockChain() *core.BlockChain

func (*Service) ChainDatabase added in v1.0.21

func (s *Service) ChainDatabase() ethdb.Database

func (*Service) CheckConnectBlock

func (s *Service) CheckConnectBlock(block *types.SerializedBlock) error

func (*Service) ConnectBlock

func (s *Service) ConnectBlock(block *types.SerializedBlock) (uint64, error)

func (*Service) DisconnectBlock

func (s *Service) DisconnectBlock(block *types.SerializedBlock) (uint64, error)

func (*Service) Genesis

func (s *Service) Genesis(txs []*types.Tx) *hash.Hash

func (*Service) GetBalance added in v1.0.19

func (s *Service) GetBalance(addr string) (int64, error)

func (*Service) GetBlockByNumber added in v1.0.20

func (s *Service) GetBlockByNumber(num uint64) (interface{}, error)

func (*Service) GetBlockIDByTxHash added in v1.0.19

func (s *Service) GetBlockIDByTxHash(txhash *hash.Hash) uint64

func (*Service) GetCurHeader added in v1.0.21

func (s *Service) GetCurHeader() *etypes.Header

func (*Service) GetCurStateRoot added in v1.0.21

func (s *Service) GetCurStateRoot() common.Hash

func (*Service) GetMempoolSize

func (s *Service) GetMempoolSize() int64

func (*Service) GetTxsFromMempool

func (s *Service) GetTxsFromMempool() ([]*types.Transaction, []*hash.Hash, error)

func (*Service) GetVM

func (s *Service) GetVM(id string) (consensus.ChainVM, error)

func (*Service) HasTx added in v1.0.21

func (s *Service) HasTx(h *hash.Hash) bool

func (*Service) HasVM

func (s *Service) HasVM(id string) bool

func (*Service) PrepareEnvironment added in v1.0.21

func (s *Service) PrepareEnvironment(state model.BlockState) (*etypes.Header, error)

func (*Service) Register

func (s *Service) Register(cvm consensus.ChainVM) error

func (*Service) RegisterAPIs

func (s *Service) RegisterAPIs(apis []api.API)

func (*Service) RemoveTxFromMempool

func (s *Service) RemoveTxFromMempool(tx *types.Transaction) error

func (*Service) ResetTemplate

func (s *Service) ResetTemplate() error

func (*Service) RewindTo added in v1.0.21

func (s *Service) RewindTo(state model.BlockState) error

func (*Service) SetLogLevel

func (s *Service) SetLogLevel(level string)

func (*Service) SetNotify added in v1.0.19

func (s *Service) SetNotify(Notify consensus.Notify)

func (*Service) SetTxPool added in v1.0.19

func (s *Service) SetTxPool(tp model.TxPool)

func (*Service) Start

func (s *Service) Start() error

func (*Service) Stop

func (s *Service) Stop() error

func (*Service) VerifyTx

func (s *Service) VerifyTx(tx model.Tx) (int64, error)

func (*Service) VerifyTxSanity

func (s *Service) VerifyTxSanity(tx model.Tx) error

func (*Service) Versions

func (s *Service) Versions() (map[string]string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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