resmgmt

package
v1.0.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2018 License: Apache-2.0 Imports: 27 Imported by: 172

Documentation

Overview

Package resmgmt enables ability to update resources in a Fabric network.

Index

Constants

View Source
const (
	InstantiateChaincode chaincodeProposalType = iota
	UpgradeChaincode
)

Define chaincode proposal types

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client enables managing resources in Fabric network.

func New

func New(clientProvider context.ClientProvider, opts ...ClientOption) (*Client, error)

New returns a ResourceMgmtClient instance

func (*Client) InstallCC

func (rc *Client) InstallCC(req InstallCCRequest, options ...RequestOption) ([]InstallCCResponse, error)

InstallCC installs chaincode with optional custom options (specific peers, filtered peers)

func (*Client) InstantiateCC

func (rc *Client) InstantiateCC(channelID string, req InstantiateCCRequest, options ...RequestOption) error

InstantiateCC instantiates chaincode using default settings

func (*Client) JoinChannel

func (rc *Client) JoinChannel(channelID string, options ...RequestOption) error

JoinChannel allows for peers to join existing channel with optional custom options (specific peers, filtered peers)

func (*Client) QueryChannels

func (rc *Client) QueryChannels(options ...RequestOption) (*pb.ChannelQueryResponse, error)

QueryChannels queries the names of all the channels that a peer has joined. Returns the details of all channels that peer has joined.

func (*Client) QueryConfigFromOrderer

func (rc *Client) QueryConfigFromOrderer(channelID string, options ...RequestOption) (fab.ChannelCfg, error)

QueryConfigFromOrderer config returns channel configuration from orderer Valid request option is WithOrdererID If orderer id is not provided orderer will be defaulted to channel orderer (if configured) or random orderer from config

func (*Client) QueryInstalledChaincodes

func (rc *Client) QueryInstalledChaincodes(options ...RequestOption) (*pb.ChaincodeQueryResponse, error)

QueryInstalledChaincodes queries the installed chaincodes on a peer. Returns the details of all chaincodes installed on a peer.

func (*Client) QueryInstantiatedChaincodes

func (rc *Client) QueryInstantiatedChaincodes(channelID string, options ...RequestOption) (*pb.ChaincodeQueryResponse, error)

QueryInstantiatedChaincodes queries the instantiated chaincodes on a peer for specific channel. Valid option is WithTarget. If not specified it will query any peer on this channel

func (*Client) SaveChannel

func (rc *Client) SaveChannel(req SaveChannelRequest, options ...RequestOption) error

SaveChannel creates or updates channel

func (*Client) UpgradeCC

func (rc *Client) UpgradeCC(channelID string, req UpgradeCCRequest, options ...RequestOption) error

UpgradeCC upgrades chaincode with optional custom options (specific peers, filtered peers, timeout)

type ClientOption

type ClientOption func(*Client) error

ClientOption describes a functional parameter for the New constructor

func WithDefaultTargetFilter

func WithDefaultTargetFilter(filter fab.TargetFilter) ClientOption

WithDefaultTargetFilter option to configure new

type InstallCCRequest

type InstallCCRequest struct {
	Name    string
	Path    string
	Version string
	Package *api.CCPackage
}

InstallCCRequest contains install chaincode request parameters

type InstallCCResponse

type InstallCCResponse struct {
	Target string
	Status int32
	Info   string
}

InstallCCResponse contains install chaincode response status

type InstantiateCCRequest

type InstantiateCCRequest struct {
	Name       string
	Path       string
	Version    string
	Args       [][]byte
	Policy     *common.SignaturePolicyEnvelope
	CollConfig []*common.CollectionConfig
}

InstantiateCCRequest contains instantiate chaincode request parameters

type RequestOption

type RequestOption func(ctx context.Client, opts *requestOptions) error

RequestOption func for each Opts argument

func WithOrderer

func WithOrderer(orderer fab.Orderer) RequestOption

WithOrderer allows an orderer to be specified for the request.

func WithOrdererURL

func WithOrdererURL(url string) RequestOption

WithOrdererURL allows an orderer to be specified for the request. The orderer will be looked-up based on the url argument. A default orderer implementation will be used.

func WithParentContext

func WithParentContext(parentContext reqContext.Context) RequestOption

WithParentContext encapsulates grpc context parent to Options

func WithTargetFilter

func WithTargetFilter(targetFilter fab.TargetFilter) RequestOption

WithTargetFilter enables a target filter for the request.

func WithTargetURLs

func WithTargetURLs(urls ...string) RequestOption

WithTargetURLs allows overriding of the target peers for the request. Targets are specified by URL, and the SDK will create the underlying peer objects.

func WithTargets

func WithTargets(targets ...fab.Peer) RequestOption

WithTargets allows overriding of the target peers for the request.

func WithTimeout

func WithTimeout(timeoutType core.TimeoutType, timeout time.Duration) RequestOption

WithTimeout encapsulates key value pairs of timeout type, timeout duration to Options if not provided, default timeout configuration from config will be used

type SaveChannelRequest

type SaveChannelRequest struct {
	ChannelID         string
	ChannelConfig     io.Reader             // ChannelConfig data source
	ChannelConfigPath string                // Convenience option to use the named file as ChannelConfig reader
	SigningIdentities []msp.SigningIdentity // Users that sign channel configuration

}

SaveChannelRequest used to save channel request

type UpgradeCCRequest

type UpgradeCCRequest struct {
	Name       string
	Path       string
	Version    string
	Args       [][]byte
	Policy     *common.SignaturePolicyEnvelope
	CollConfig []*common.CollectionConfig
}

UpgradeCCRequest contains upgrade chaincode request parameters

Jump to

Keyboard shortcuts

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