Documentation ¶
Overview ¶
Package resmgmt enables ability to update resources in a Fabric network.
Index ¶
- Constants
- type Client
- func (rc *Client) InstallCC(req InstallCCRequest, options ...RequestOption) ([]InstallCCResponse, error)
- func (rc *Client) InstantiateCC(channelID string, req InstantiateCCRequest, options ...RequestOption) error
- func (rc *Client) JoinChannel(channelID string, options ...RequestOption) error
- func (rc *Client) QueryChannels(options ...RequestOption) (*pb.ChannelQueryResponse, error)
- func (rc *Client) QueryConfigFromOrderer(channelID string, options ...RequestOption) (fab.ChannelCfg, error)
- func (rc *Client) QueryInstalledChaincodes(options ...RequestOption) (*pb.ChaincodeQueryResponse, error)
- func (rc *Client) QueryInstantiatedChaincodes(channelID string, options ...RequestOption) (*pb.ChaincodeQueryResponse, error)
- func (rc *Client) SaveChannel(req SaveChannelRequest, options ...RequestOption) error
- func (rc *Client) UpgradeCC(channelID string, req UpgradeCCRequest, options ...RequestOption) error
- type ClientOption
- type InstallCCRequest
- type InstallCCResponse
- type InstantiateCCRequest
- type RequestOption
- func WithOrderer(orderer fab.Orderer) RequestOption
- func WithOrdererURL(url string) RequestOption
- func WithParentContext(parentContext reqContext.Context) RequestOption
- func WithTargetFilter(targetFilter fab.TargetFilter) RequestOption
- func WithTargetURLs(urls ...string) RequestOption
- func WithTargets(targets ...fab.Peer) RequestOption
- func WithTimeout(timeoutType core.TimeoutType, timeout time.Duration) RequestOption
- type SaveChannelRequest
- type UpgradeCCRequest
Constants ¶
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 ¶
ClientOption describes a functional parameter for the New constructor
func WithDefaultTargetFilter ¶
func WithDefaultTargetFilter(filter fab.TargetFilter) ClientOption
WithDefaultTargetFilter option to configure new
type InstallCCRequest ¶
InstallCCRequest contains install chaincode request parameters
type InstallCCResponse ¶
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 ¶
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