Documentation ¶
Index ¶
- func GetBuiltinProcessorType(programHash hashing.HashValue) (string, bool)
- func NewProcessorFromBinary(vmtype string, binaryCode []byte) (coretypes.Processor, error)
- func RegisterVMType(vmtype string, constructor VMConstructor) error
- type ProcessorCache
- func (cps *ProcessorCache) ExistsProcessor(h hashing.HashValue) bool
- func (cps *ProcessorCache) GetOrCreateProcessor(rec *root.ContractRecord, ...) (coretypes.Processor, error)
- func (cps *ProcessorCache) GetOrCreateProcessorByProgramHash(progHash hashing.HashValue, ...) (coretypes.Processor, error)
- func (cps *ProcessorCache) NewProcessor(programHash hashing.HashValue, programCode []byte, vmtype string) error
- func (cps *ProcessorCache) RemoveProcessor(h hashing.HashValue)
- type VMConstructor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBuiltinProcessorType ¶
GetBuiltinProcessorType locates hardcoded processor: core contract or example
func NewProcessorFromBinary ¶
NewProcessorFromBinary creates an instance of the processor by its VM type and the binary code
func RegisterVMType ¶
func RegisterVMType(vmtype string, constructor VMConstructor) error
RegisterVMType registers new VM type by providing a constructor function to construct an instance of the processor. The constructor is a closure which also may encompass configuration params for the VM The function is normally called from the init code
Types ¶
type ProcessorCache ¶
ProcessorCache is an object maintained by each chain
func MustNew ¶
func MustNew() *ProcessorCache
func (*ProcessorCache) ExistsProcessor ¶
func (cps *ProcessorCache) ExistsProcessor(h hashing.HashValue) bool
func (*ProcessorCache) GetOrCreateProcessor ¶
func (*ProcessorCache) GetOrCreateProcessorByProgramHash ¶
func (*ProcessorCache) NewProcessor ¶
func (cps *ProcessorCache) NewProcessor(programHash hashing.HashValue, programCode []byte, vmtype string) error
NewProcessor deploys new processor in the cache
func (*ProcessorCache) RemoveProcessor ¶
func (cps *ProcessorCache) RemoveProcessor(h hashing.HashValue)
RemoveProcessor deletes processor from cache
Click to show internal directories.
Click to hide internal directories.