logicrunner

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package logicrunner - infrastructure for executing smartcontracts

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashInterface added in v0.4.0

func HashInterface(in interface{}) []byte

func MakeBaseEvent added in v0.4.0

func MakeBaseEvent(req rpctypes.UpBaseReq) message.BaseLogicEvent

MakeBaseEvent makes base of logicrunner event from base of up request

Types

type CaseBind added in v0.4.0

type CaseBind struct {
	P core.Pulse           // pulse info for this bind
	R map[trf][]CaseRecord // ordered cases for each object
}

CaseBinder is a whole result of executor efforts on every object it seen on this pulse

type CaseRecord added in v0.4.0

type CaseRecord struct {
	Type   CaseRecordType
	ReqSig []byte
	Resp   rpctypes.UpRespIface
}

CaseRecord is one record of validateable object calling history

type CaseRecordType added in v0.4.0

type CaseRecordType int
const (
	CaseRecordTypeMethodCall CaseRecordType
	CaseRecordTypeConstructorCall
	CaseRecordTypeMethodCallResult
	CaseRecordTypeConstructorCallResult
	CaseRecordTypeRouteCall
	CaseRecordTypeSaveAsChild
	CaseRecordTypeGetObjChildren
	CaseRecordTypeSaveAsDelegate
	CaseRecordTypeGetDelegate
)

Types of records

type LogicRunner

type LogicRunner struct {
	Executors       [core.MachineTypesLastID]core.MachineLogicExecutor
	ArtifactManager core.ArtifactManager
	MessageBus      core.MessageBus

	Cfg *configuration.LogicRunner
	// contains filtered or unexported fields
}

LogicRunner is a general interface of contract executor

func NewLogicRunner added in v0.0.3

func NewLogicRunner(cfg *configuration.LogicRunner) (*LogicRunner, error)

NewLogicRunner is constructor for LogicRunner

func (*LogicRunner) Execute added in v0.0.3

func (lr *LogicRunner) Execute(msg core.Message) (core.Reply, error)

Execute runs a method on an object, ATM just thin proxy to `GoPlugin.Exec`

func (*LogicRunner) GetExecutor added in v0.0.3

GetExecutor returns an executor for the `MachineType` if it was registered (`RegisterExecutor`), returns error otherwise

func (*LogicRunner) OnPulse added in v0.4.0

func (lr *LogicRunner) OnPulse(pulse core.Pulse) error

func (*LogicRunner) RegisterExecutor added in v0.0.3

func (lr *LogicRunner) RegisterExecutor(t core.MachineType, e core.MachineLogicExecutor) error

RegisterExecutor registers an executor for particular `MachineType`

func (*LogicRunner) Start

func (lr *LogicRunner) Start(c core.Components) error

Start starts logic runner component

func (*LogicRunner) Stop

func (lr *LogicRunner) Stop() error

Stop stops logic runner component and its executors

type RPC added in v0.4.0

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

RPC is a RPC interface for runner to use for various tasks, e.g. code fetching

func StartRPC added in v0.4.0

func StartRPC(lr *LogicRunner) *RPC

StartRPC starts RPC server for isolated executors to use

func (*RPC) GetCode added in v0.4.0

func (gpr *RPC) GetCode(req rpctypes.UpGetCodeReq, reply *rpctypes.UpGetCodeResp) error

GetCode is an RPC retrieving a code by its reference

func (*RPC) GetDelegate added in v0.4.0

func (gpr *RPC) GetDelegate(req rpctypes.UpGetDelegateReq, reply *rpctypes.UpGetDelegateResp) error

GetDelegate is an RPC saving data as memory of a contract as child a parent

func (*RPC) GetObjChildren added in v0.4.0

func (gpr *RPC) GetObjChildren(req rpctypes.UpGetObjChildrenReq, reply *rpctypes.UpGetObjChildrenResp) error

GetObjChildren is an RPC returns set of object children

func (*RPC) RouteCall added in v0.4.0

func (gpr *RPC) RouteCall(req rpctypes.UpRouteReq, rep *rpctypes.UpRouteResp) error

RouteCall routes call from a contract to a contract through event bus.

func (*RPC) RouteConstructorCall added in v0.4.0

func (gpr *RPC) RouteConstructorCall(req rpctypes.UpRouteConstructorReq, rep *rpctypes.UpRouteConstructorResp) error

RouteConstructorCall routes call from a contract to a constructor of another contract

func (*RPC) SaveAsChild added in v0.4.0

func (gpr *RPC) SaveAsChild(req rpctypes.UpSaveAsChildReq, reply *rpctypes.UpSaveAsChildResp) error

SaveAsChild is an RPC saving data as memory of a contract as child a parent

func (*RPC) SaveAsDelegate added in v0.4.0

func (gpr *RPC) SaveAsDelegate(req rpctypes.UpSaveAsDelegateReq, reply *rpctypes.UpSaveAsDelegateResp) error

SaveAsDelegate is an RPC saving data as memory of a contract as child a parent

Directories

Path Synopsis
Package builtin is implementation of builtin contracts engine
Package builtin is implementation of builtin contracts engine
Package goplugin - golang plugin in docker runner
Package goplugin - golang plugin in docker runner
foundation
Package foundation server implementation of smartcontract functions
Package foundation server implementation of smartcontract functions

Jump to

Keyboard shortcuts

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