nodepart

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArwenDriver

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

ArwenDriver manages the execution of the Arwen process

func NewArwenDriver

func NewArwenDriver(
	blockchainHook vmcommon.BlockchainHook,
	arwenArguments common.ArwenArguments,
	config Config,
) (*ArwenDriver, error)

NewArwenDriver creates a new driver

func (*ArwenDriver) Close

func (driver *ArwenDriver) Close() error

Close stops Arwen

func (*ArwenDriver) DiagnoseWait

func (driver *ArwenDriver) DiagnoseWait(milliseconds uint32) error

DiagnoseWait sends a diagnose message to Arwen

func (*ArwenDriver) GasScheduleChange added in v0.4.5

func (driver *ArwenDriver) GasScheduleChange(newGasSchedule map[string]map[string]uint64)

GasScheduleChange sends a "gas change" request to Arwen and waits for the output

func (*ArwenDriver) GetVersion added in v0.3.36

func (driver *ArwenDriver) GetVersion() (string, error)

GetVersion gets the Arwen version

func (*ArwenDriver) IsClosed

func (driver *ArwenDriver) IsClosed() bool

IsClosed checks whether the Arwen process is closed

func (*ArwenDriver) IsInterfaceNil added in v0.5.0

func (driver *ArwenDriver) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ArwenDriver) RestartArwenIfNecessary

func (driver *ArwenDriver) RestartArwenIfNecessary() error

RestartArwenIfNecessary restarts Arwen if the process is closed

func (*ArwenDriver) RunSmartContractCall

func (driver *ArwenDriver) RunSmartContractCall(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)

RunSmartContractCall sends an execution request to Arwen and waits for the output

func (*ArwenDriver) RunSmartContractCreate

func (driver *ArwenDriver) RunSmartContractCreate(input *vmcommon.ContractCreateInput) (*vmcommon.VMOutput, error)

RunSmartContractCreate sends a deploy request to Arwen and waits for the output

type Config

type Config struct {
	MaxLoopTime int
}

Config is the configuration for the driver and for Node's part

type NodeMessenger

type NodeMessenger struct {
	common.Messenger
}

NodeMessenger is the messenger on Node's part of the pipe

func NewNodeMessenger

func NewNodeMessenger(reader *os.File, writer *os.File, marshalizer marshaling.Marshalizer) *NodeMessenger

NewNodeMessenger creates a new messenger

func (*NodeMessenger) ReceiveHookCallRequestOrContractResponse

func (messenger *NodeMessenger) ReceiveHookCallRequestOrContractResponse(timeout int) (common.MessageHandler, int, error)

ReceiveHookCallRequestOrContractResponse waits for any message that could arrive from Arwen

func (*NodeMessenger) SendContractRequest

func (messenger *NodeMessenger) SendContractRequest(request common.MessageHandler) error

SendContractRequest sends a request to Arwen

func (*NodeMessenger) SendHookCallResponse

func (messenger *NodeMessenger) SendHookCallResponse(response common.MessageHandler) error

SendHookCallResponse sends a hook response to Arwen

type NodePart

type NodePart struct {
	Messenger *NodeMessenger

	Repliers []common.MessageReplier
	// contains filtered or unexported fields
}

NodePart is the endpoint that implements the message loop on Node's side

func NewNodePart

func NewNodePart(
	input *os.File,
	output *os.File,
	blockchain vmcommon.BlockchainHook,
	config Config,
	marshalizer marshaling.Marshalizer,
) (*NodePart, error)

NewNodePart creates the Node part

func (*NodePart) SendStopSignal

func (part *NodePart) SendStopSignal() error

SendStopSignal sends a stop signal to Arwen Should only be used for tests!

func (*NodePart) StartLoop

func (part *NodePart) StartLoop(request common.MessageHandler) (common.MessageHandler, error)

StartLoop runs the main loop

type ParentLogsPart added in v0.3.15

type ParentLogsPart interface {
	StartLoop(childStdout io.Reader, childStderr io.Reader) error
	StopLoop()
}

ParentLogsPart defines the interface for the Node's part of the logging dialogue

Jump to

Keyboard shortcuts

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