fabric

package
v0.0.0-...-f29557b Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSdkClient

func NewSdkClient(sdk *fabsdk.FabricSDK, channelID, orgName, orgAdmin, OrgUser string) (rc *resmgmt.Client, cc *channel.Client)

NewSdkClient create resource client and channel client

Types

type Client

type Client struct {
	// Fabric network information
	ConfigPath string
	OrgName    string
	OrgAdmin   string
	OrgUser    string

	// sdk clients
	SDK *fabsdk.FabricSDK

	// Same for each peer
	ChannelID string
	CCID      string // chaincode ID, eq name
	CCPath    string // chaincode source path, 是GOPATH下的某个目录
	CCGoPath  string // GOPATH used for chaincode
	// contains filtered or unexported fields
}

func New

func New(cfg, org, admin, user string) *Client

func (*Client) Close

func (c *Client) Close()

func (*Client) InvokeCC

func (c *Client) InvokeCC(peers []string) (fab.TransactionID, error)

func (*Client) InvokeCCDelete

func (c *Client) InvokeCCDelete(peers []string) (fab.TransactionID, error)

func (*Client) QueryCC

func (c *Client) QueryCC(peer, keys string) error

func (*Client) QueryCCInfo

func (c *Client) QueryCCInfo(v string, peer string)

func (*Client) RegisterChaincodeEvent

func (c *Client) RegisterChaincodeEvent(ccid, eventName string) (fab.Registration, <-chan *fab.CCEvent, error)

RegisterChaincodeEvent more easy than event client to registering chaincode event.

type FabricSetup

type FabricSetup struct {
	ConfigFile    string //sdk配置文件所在路径
	ChannelID     string //应用通道名称
	ChannelConfig string //应用通道交易配置文件所在路径
	OrgAdmin      string // 组织管理员名称
	OrgName       string //组织名称
	Initialized   bool   //是否初始化

	SDK *fabsdk.FabricSDK //SDK实例
	// contains filtered or unexported fields
}

定义结构体

func (*FabricSetup) Initialize

func (f *FabricSetup) Initialize() (*channel.Client, error)

Jump to

Keyboard shortcuts

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