native

package
v0.0.0-...-fb4f826 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileCodeXCoin   = "xcoin"
	FileCodeTAddr   = "taddr"
	FileCodeSRole   = "srole"
	FileCodeDefault = "default"
	FileNodekey     = "nodekey"
	CodePathDefault = "./builtin"
)
View Source
const BuiltinCount = 3 // the number of built-in chaincode

Variables

View Source
var (
	CodeEmpty = bytes.Repeat([]byte{1}, 32)
	CodeKVDB  = bytes.Repeat([]byte{2}, 32)
	CodePCoin = bytes.Repeat([]byte{3}, 32)
	CodeXCoin = bytes.Repeat([]byte{4}, 32) // built-in chaincode
	CodeTAddr = bytes.Repeat([]byte{5}, 32) // built-in chaincode
	CodeSRole = bytes.Repeat([]byte{6}, 32) // built-in chaincode
)
View Source
var RootCmd = &cobra.Command{
	Use:   "client",
	Short: "The client of native contract",
}

Functions

func GetCodePath

func GetCodePath() string

func GetTxStatus

func GetTxStatus(hash []byte) (txpool.TxStatus, error)

func SetNodeUrl

func SetNodeUrl(url string)

func UploadChainCode

func UploadChainCode(driverType common.DriverType, filePath string) ([]byte, error)

func UploadChainCode2

func UploadChainCode2(driverType common.DriverType, f io.Reader) ([]byte, error)

func WaitTxCommitted

func WaitTxCommitted(tx *core.Transaction) error

Types

type Client

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

func NewClient

func NewClient(isDeploy bool) *Client

func (*Client) GetAddr

func (client *Client) GetAddr() []byte

func (*Client) MakeDeploymentTx

func (client *Client) MakeDeploymentTx(driverType common.DriverType,
	codeID []byte, initInput []byte) *core.Transaction

func (*Client) MakeTx

func (client *Client) MakeTx(input []byte) *core.Transaction

func (*Client) QueryState

func (client *Client) QueryState(input []byte) (ret []byte)

func (*Client) SetAddr

func (client *Client) SetAddr(addr []byte)

func (*Client) SetSigner

func (client *Client) SetSigner(signer *core.PrivateKey)

func (*Client) SubmitTx

func (client *Client) SubmitTx(tx *core.Transaction)

func (*Client) SubmitTxAndWait

func (client *Client) SubmitTxAndWait(tx *core.Transaction)

type CodeDriver

type CodeDriver struct{}

func NewCodeDriver

func NewCodeDriver() *CodeDriver

func (*CodeDriver) GetInstance

func (drv *CodeDriver) GetInstance(codeID []byte) (common.Chaincode, error)

func (*CodeDriver) Install

func (drv *CodeDriver) Install(codeID, data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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