nodepart

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: GPL-3.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxLoopTime int
}

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

type CoreDriver

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

CoreDriver manages the execution of the Core process

func NewCoreDriver

func NewCoreDriver(
	blockchainHook vmcommon.BlockchainHook,
	coreArguments common.CoreArguments,
	config Config,
) (*CoreDriver, error)

NewCoreDriver creates a new driver

func (*CoreDriver) Close

func (driver *CoreDriver) Close() error

Close stops Core

func (*CoreDriver) DiagnoseWait

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

DiagnoseWait sends a diagnose message to Core

func (*CoreDriver) GetVersion added in v0.0.3

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

func (*CoreDriver) IsClosed

func (driver *CoreDriver) IsClosed() bool

IsClosed checks whether the Core process is closed

func (*CoreDriver) RestartCoreIfNecessary

func (driver *CoreDriver) RestartCoreIfNecessary() error

RestartCoreIfNecessary restarts Core if the process is closed

func (*CoreDriver) RunSmartContractCall

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

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

func (*CoreDriver) RunSmartContractCreate

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

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

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 Core

func (*NodeMessenger) SendContractRequest

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

SendContractRequest sends a request to Core

func (*NodeMessenger) SendHookCallResponse

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

SendHookCallResponse sends a hook response to Core

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 Core 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

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