vm

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: ISC Imports: 15 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

	Notify consensus.Notify
	// contains filtered or unexported fields
}

func NewService

func NewService(cfg *config.Config, events *event.Feed, tp consensus.TxPool, Notify consensus.Notify) (*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) CheckConnectBlock

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

func (*Service) ConnectBlock

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

func (*Service) DisconnectBlock

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

func (*Service) Genesis

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

func (*Service) GetMempoolSize

func (s *Service) GetMempoolSize() int64

func (*Service) GetTxsFromMempool

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

func (*Service) GetVM

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

func (*Service) GetVMContext

func (s *Service) GetVMContext() consensus.Context

func (*Service) HasVM

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

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

func (s *Service) SetLogLevel(level string)

func (*Service) Start

func (s *Service) Start() error

func (*Service) Stop

func (s *Service) Stop() error

func (*Service) VerifyTx

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

func (*Service) VerifyTxSanity

func (s *Service) VerifyTxSanity(tx consensus.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