fabric

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigName = "fabric.toml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContractMeta

type ContractMeta struct {
	EventFilter string `json:"event_filter"`
	Username    string `json:"username"`
	CCID        string `json:"ccid"`
	ChannelID   string `json:"channel_id"`
	ORG         string `json:"org"`
}

ContractMeta .

type Fabric

type Fabric struct {
	Addr        string `toml:"addr" json:"addr"`
	Name        string `toml:"name" json:"name"`
	EventFilter string `mapstructure:"event_filter" toml:"event_filter" json:"event_filter"`
	Username    string `toml:"username" json:"username"`
	CCID        string `toml:"ccid" json:"ccid"`
	ChannelId   string `mapstructure:"channel_id" toml:"channel_id" json:"channel_id"`
	Org         string `toml:"org" json:"org"`
}

func DefaultConfig

func DefaultConfig() *Fabric

func UnmarshalConfig

func UnmarshalConfig(configPath string) (*Fabric, error)

type FabricClient

type FabricClient struct {
	Client *channel.Client
	Meta   *ContractMeta
	Name   string
}

FabricClient .

func New

func New(configPath string) (*FabricClient, error)

New . configPath is the config files path generated by goduck, e.g. "config/fabric" .

func (*FabricClient) Invoke

func (client *FabricClient) Invoke(chaincodeID, funcName string, invokeArgs ...[]byte) (string, error)

Invoke . ret is the Payload. you can use response.ChaincodeStatus to check Chaincode status.

Jump to

Keyboard shortcuts

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