Documentation ¶
Index ¶
- Constants
- Variables
- func GetCodePath() string
- func GetTxStatus(hash []byte) (txpool.TxStatus, error)
- func SetNodeUrl(url string)
- func UploadChainCode(driverType common.DriverType, filePath string) ([]byte, error)
- func UploadChainCode2(driverType common.DriverType, f io.Reader) ([]byte, error)
- func WaitTxCommitted(tx *core.Transaction) error
- type Client
- func (client *Client) GetAddr() []byte
- func (client *Client) MakeDeploymentTx(driverType common.DriverType, codeID []byte, initInput []byte) *core.Transaction
- func (client *Client) MakeTx(input []byte) *core.Transaction
- func (client *Client) QueryState(input []byte) (ret []byte)
- func (client *Client) SetAddr(addr []byte)
- func (client *Client) SetSigner(signer *core.PrivateKey)
- func (client *Client) SubmitTx(tx *core.Transaction)
- func (client *Client) SubmitTxAndWait(tx *core.Transaction)
- type CodeDriver
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 SetNodeUrl ¶
func SetNodeUrl(url string)
func UploadChainCode ¶
func UploadChainCode(driverType common.DriverType, filePath string) ([]byte, error)
func UploadChainCode2 ¶
func WaitTxCommitted ¶
func WaitTxCommitted(tx *core.Transaction) error
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) MakeDeploymentTx ¶
func (client *Client) MakeDeploymentTx(driverType common.DriverType, codeID []byte, initInput []byte) *core.Transaction
func (*Client) QueryState ¶
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
Click to show internal directories.
Click to hide internal directories.