native

package
v0.0.0-...-d9e9996 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2019 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RelPathOfCWD

func RelPathOfCWD(rootpath string) (string, error)

RelPathOfCWD 返回工作目录的相对路径

Types

type DockerProcess

type DockerProcess struct {
	log.Logger
	// contains filtered or unexported fields
}

DockerProcess is the process running as a docker container

func (*DockerProcess) Start

func (d *DockerProcess) Start() error

Start implements process interface

func (*DockerProcess) Stop

func (d *DockerProcess) Stop(timeout time.Duration) error

Stop implements process interface

type GeneralSCFramework

type GeneralSCFramework struct {
	log.Logger
	// contains filtered or unexported fields
}

GeneralSCFramework manage native contracts

func New

func New(cfg *config.NativeConfig, rootpath string, xlog log.Logger, otherPaths []string, kvEngineType string) (*GeneralSCFramework, error)

New instances a new GeneralSCFramework

func (*GeneralSCFramework) Deploy

func (gscf *GeneralSCFramework) Deploy(desc *xpb.NativeCodeDesc, code []byte) error

Deploy 部署新版本到当前节点,并且启动合约进程

func (*GeneralSCFramework) Finalize

func (gscf *GeneralSCFramework) Finalize(blockid []byte) error

Finalize implements ContractInterface

func (*GeneralSCFramework) NewInstance

func (gscf *GeneralSCFramework) NewInstance(ctx *bridge.Context) (bridge.Instance, error)

NewInstance implements bridge.Executor

func (*GeneralSCFramework) ReadOutput

ReadOutput implements ContractInterface

func (*GeneralSCFramework) RegisterSyscallService

func (gscf *GeneralSCFramework) RegisterSyscallService(service *bridge.SyscallService)

RegisterSyscallService implements bridge.Executor

func (*GeneralSCFramework) Rollback

func (gscf *GeneralSCFramework) Rollback(desc *contract.TxDesc) error

Rollback implements ContractInterface

func (*GeneralSCFramework) Run

func (gscf *GeneralSCFramework) Run(desc *contract.TxDesc) error

Run implements ContractInterface 升级流程: 直接部署新版本,然后投票指定高度激活即可

func (*GeneralSCFramework) SetContext

func (gscf *GeneralSCFramework) SetContext(context *contract.TxContext) error

SetContext implements ContractInterface

func (*GeneralSCFramework) Status

func (gscf *GeneralSCFramework) Status() []*xpb.NativeCodeStatus

Status returns status of all the native contracts

func (*GeneralSCFramework) Stop

func (gscf *GeneralSCFramework) Stop()

Stop stop all the native contracts process It blocks until all the process ends

type HostProcess

type HostProcess struct {
	log.Logger
	// contains filtered or unexported fields
}

HostProcess is the process running as a native process

func (*HostProcess) Start

func (h *HostProcess) Start() error

Start implements process interface

func (*HostProcess) Stop

func (h *HostProcess) Stop(timeout time.Duration) error

Stop implements process interface

type Process

type Process interface {
	// Start 启动Native code进程
	Start() error

	// Stop 停止进程,如果在超时时间内进程没有退出则强制杀死进程
	Stop(timeout time.Duration) error
}

Process is the container of running contract

Jump to

Keyboard shortcuts

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