base

package
v0.0.0-...-2f16193 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 2 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockchainBase

type BlockchainBase struct {
	ClientConfig
	Logger *logging.Logger
}

BlockchainBase the base implementation of blockChain.

func NewBlockchainBase

func NewBlockchainBase(clientConfig ClientConfig) *BlockchainBase

NewBlockchainBase new blockchain base.

func (*BlockchainBase) Confirm

func (b *BlockchainBase) Confirm(result *common.Result, ops ...common.Option) *common.Result

Confirm confirm invoke result for tx.

func (*BlockchainBase) DeployContract

func (b *BlockchainBase) DeployContract() error

DeployContract send tx for deploy contract.

func (*BlockchainBase) GetContext

func (b *BlockchainBase) GetContext() (string, error)

GetContext get context for execute tx in vm.

func (*BlockchainBase) Invoke

Invoke send tx for invoke contract.

func (*BlockchainBase) LogStatus

func (b *BlockchainBase) LogStatus() (int64, error)

LogStatus records blockheight and time

func (*BlockchainBase) Option

func (b *BlockchainBase) Option(common.Option) error

Option receive some options.

func (*BlockchainBase) Query

func (b *BlockchainBase) Query(common.Query, ...common.Option) interface{}

Query query info.

func (*BlockchainBase) ResetContext

func (b *BlockchainBase) ResetContext() error

ResetContext reset context.

func (*BlockchainBase) SetContext

func (b *BlockchainBase) SetContext(ctx string) error

SetContext set context for execute tx in vm.

func (*BlockchainBase) Statistic

func (b *BlockchainBase) Statistic(statistic common.Statistic) (*common.RemoteStatistic, error)

Statistic statistic remote execute result.

func (*BlockchainBase) Transfer

Transfer send tx for transfer.

type ClientConfig

type ClientConfig struct {
	// client
	ClientType string `mapstructure:"type"`
	ConfigPath string `mapstructure:"config"`

	// contract
	ContractPath string        `mapstructure:"contract"`
	Args         []interface{} `mapstructure:"args"`

	// options
	Options map[string]interface{} `mapstructure:"options"`
}

ClientConfig define the filed for client config.

Jump to

Keyboard shortcuts

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