execution

package
v0.0.0-...-169a2f2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	TxExecTimeout:   10 * time.Second,
	ConcurrentLimit: 20,
}
View Source
var (
	NativeCodeIDJuriaCoin = bytes.Repeat([]byte{1}, 32)
)

Functions

This section is empty.

Types

type CodeDriver

type CodeDriver interface {
	// Install is called when code deployment transaction is received
	// Example data field - download url for code binary
	// After successful Install, getInstance should give a Chaincode instance without error
	Install(codeID, data []byte) error
	GetInstance(codeID []byte) (chaincode.Chaincode, error)
}

type CodeInfo

type CodeInfo struct {
	DriverType DriverType `json:"driverType"`
	CodeID     []byte     `json:"codeID"`
}

type Config

type Config struct {
	BinccDir        string
	TxExecTimeout   time.Duration
	ConcurrentLimit int
}

type DeploymentInput

type DeploymentInput struct {
	CodeInfo    CodeInfo `json:"codeInfo"`
	InstallData []byte   `json:"installData"`
	InitInput   []byte   `json:"initInput"`
}

type DriverType

type DriverType uint8
const (
	DriverTypeNative DriverType = iota + 1
	DriverTypeBincc
)

type Execution

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

func New

func New(stateStore StateStore, config Config) *Execution

func (*Execution) Execute

func (exec *Execution) Execute(blk *core.Block, txs []*core.Transaction) (
	*core.BlockCommit, []*core.TxCommit,
)

func (*Execution) Query

func (exec *Execution) Query(query *QueryData) (val []byte, err error)

func (*Execution) VerifyTx

func (exec *Execution) VerifyTx(tx *core.Transaction) error

type QueryData

type QueryData struct {
	CodeAddr []byte
	Input    []byte
}

type StateStore

type StateStore interface {
	VerifyState(key []byte) []byte
	GetState(key []byte) []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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