Documentation ¶
Index ¶
- func ApproveForMyOrgCmd(a *ApproverForMyOrg, cryptoProvider bccsp.BCCSP) *cobra.Command
- func CalculatePackageIDCmd(p *PackageIDCalculator) *cobra.Command
- func CheckCommitReadinessCmd(c *CommitReadinessChecker, cryptoProvider bccsp.BCCSP) *cobra.Command
- func Cmd(cryptoProvider bccsp.BCCSP) *cobra.Command
- func CommitCmd(c *Committer, cryptoProvider bccsp.BCCSP) *cobra.Command
- func GetInstalledPackageCmd(i *InstalledPackageGetter, cryptoProvider bccsp.BCCSP) *cobra.Command
- func InstallCmd(i *Installer, cryptoProvider bccsp.BCCSP) *cobra.Command
- func PackageCmd(p *Packager) *cobra.Command
- func QueryApprovedCmd(a *ApprovedQuerier, cryptoProvider bccsp.BCCSP) *cobra.Command
- func QueryCommittedCmd(c *CommittedQuerier, cryptoProvider bccsp.BCCSP) *cobra.Command
- func QueryInstalledCmd(i *InstalledQuerier, cryptoProvider bccsp.BCCSP) *cobra.Command
- func ResetFlags()
- type ApproveForMyOrgInput
- type ApprovedChaincodeDefinition
- type ApprovedQuerier
- type ApprovedQueryInput
- type ApproverForMyOrg
- type CalculatePackageIDInput
- type CalculatePackageIDOutput
- type ChaincodeDefinition
- type ClientConnections
- type ClientConnectionsInput
- type CommitInput
- type CommitReadinessCheckInput
- type CommitReadinessChecker
- type CommittedQuerier
- type CommittedQueryInput
- type Committer
- type EndorserClient
- type GetInstalledPackageInput
- type InstallInput
- type InstalledPackageGetter
- type InstalledQuerier
- type InstalledQueryInput
- type Installer
- type PackageIDCalculator
- type PackageInput
- type PackageMetadata
- type Packager
- type PeerDeliverClient
- type PlatformRegistry
- type Reader
- type Signer
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApproveForMyOrgCmd ¶
func ApproveForMyOrgCmd(a *ApproverForMyOrg, cryptoProvider bccsp.BCCSP) *cobra.Command
ApproveForMyOrgCmd returns the cobra command for chaincode ApproveForMyOrg
func CalculatePackageIDCmd ¶
func CalculatePackageIDCmd(p *PackageIDCalculator) *cobra.Command
CalculatePackageIDCmd returns the cobra command for calculating the package ID for a packaged chaincode
func CheckCommitReadinessCmd ¶
func CheckCommitReadinessCmd(c *CommitReadinessChecker, cryptoProvider bccsp.BCCSP) *cobra.Command
CheckCommitReadinessCmd returns the cobra command for the CheckCommitReadiness lifecycle operation
func GetInstalledPackageCmd ¶
func GetInstalledPackageCmd(i *InstalledPackageGetter, cryptoProvider bccsp.BCCSP) *cobra.Command
GetInstalledPackageCmd returns the cobra command for getting an installed chaincode package from a peer.
func InstallCmd ¶
InstallCmd returns the cobra command for chaincode install.
func PackageCmd ¶
PackageCmd returns the cobra command for packaging chaincode
func QueryApprovedCmd ¶
func QueryApprovedCmd(a *ApprovedQuerier, cryptoProvider bccsp.BCCSP) *cobra.Command
QueryApprovedCmd returns the cobra command for querying the approved chaincode definition for the organization
func QueryCommittedCmd ¶
func QueryCommittedCmd(c *CommittedQuerier, cryptoProvider bccsp.BCCSP) *cobra.Command
QueryCommittedCmd returns the cobra command for querying a committed chaincode definition given the chaincode name
func QueryInstalledCmd ¶
func QueryInstalledCmd(i *InstalledQuerier, cryptoProvider bccsp.BCCSP) *cobra.Command
QueryInstalledCmd returns the cobra command for listing the installed chaincodes
Types ¶
type ApproveForMyOrgInput ¶
type ApproveForMyOrgInput struct { ChannelID string Name string Version string PackageID string Sequence int64 EndorsementPlugin string ValidationPlugin string ValidationParameterBytes []byte CollectionConfigPackage *pb.CollectionConfigPackage InitRequired bool PeerAddresses []string WaitForEvent bool WaitForEventTimeout time.Duration TxID string }
ApproveForMyOrgInput holds all of the input parameters for approving a chaincode definition for an organization. ValidationParameter bytes is the (marshalled) endorsement policy when using the default endorsement and validation plugins
func (*ApproveForMyOrgInput) Validate ¶
func (a *ApproveForMyOrgInput) Validate() error
Validate the input for an ApproveChaincodeDefinitionForMyOrg proposal
type ApprovedQuerier ¶
type ApprovedQuerier struct { Command *cobra.Command EndorserClient EndorserClient Input *ApprovedQueryInput Signer Signer Writer io.Writer }
ApprovedQuerier holds the dependencies needed to query the approved chaincode definition for the organization
func (*ApprovedQuerier) Query ¶
func (a *ApprovedQuerier) Query() error
Query returns the approved chaincode definition for a given channel and chaincode name
type ApprovedQueryInput ¶
type ApproverForMyOrg ¶
type ApproverForMyOrg struct { Certificate tls.Certificate Command *cobra.Command BroadcastClient common.BroadcastClient DeliverClients []pb.DeliverClient EndorserClients []EndorserClient Input *ApproveForMyOrgInput Signer Signer }
ApproverForMyOrg holds the dependencies needed to approve a chaincode definition for an organization
func (*ApproverForMyOrg) Approve ¶
func (a *ApproverForMyOrg) Approve() error
Approve submits a ApproveChaincodeDefinitionForMyOrg proposal
type CalculatePackageIDInput ¶
CalculatePackageIDInput holds the input parameters for calculating the package ID of a packaged chaincode
func (*CalculatePackageIDInput) Validate ¶
func (i *CalculatePackageIDInput) Validate() error
Validate checks that the required parameters are provided
type CalculatePackageIDOutput ¶
type CalculatePackageIDOutput struct {
PackageID string `json:"package_id"`
}
CalculatePackageIDOutput holds the JSON output format
type ChaincodeDefinition ¶
type ClientConnections ¶
type ClientConnections struct { BroadcastClient common.BroadcastClient DeliverClients []pb.DeliverClient EndorserClients []pb.EndorserClient Certificate tls.Certificate Signer identity.SignerSerializer CryptoProvider bccsp.BCCSP }
ClientConnections holds the clients for connecting to the various endpoints in a Fabric network.
func NewClientConnections ¶
func NewClientConnections(input *ClientConnectionsInput, cryptoProvider bccsp.BCCSP) (*ClientConnections, error)
NewClientConnections creates a new set of client connections based on the input parameters.
type ClientConnectionsInput ¶
type ClientConnectionsInput struct { CommandName string EndorserRequired bool OrdererRequired bool OrderingEndpoint string ChannelID string PeerAddresses []string TLSRootCertFiles []string ConnectionProfilePath string TargetPeer string TLSEnabled bool }
ClientConnectionsInput holds the input parameters for creating client connections.
type CommitInput ¶
type CommitInput struct { ChannelID string Name string Version string Hash []byte Sequence int64 EndorsementPlugin string ValidationPlugin string ValidationParameterBytes []byte CollectionConfigPackage *pb.CollectionConfigPackage InitRequired bool PeerAddresses []string WaitForEvent bool WaitForEventTimeout time.Duration TxID string }
CommitInput holds all of the input parameters for committing a chaincode definition. ValidationParameter bytes is the (marshalled) endorsement policy when using the default endorsement and validation plugins
func (*CommitInput) Validate ¶
func (c *CommitInput) Validate() error
Validate the input for a CommitChaincodeDefinition proposal
type CommitReadinessCheckInput ¶
type CommitReadinessCheckInput struct { ChannelID string Name string Version string PackageID string Sequence int64 EndorsementPlugin string ValidationPlugin string ValidationParameterBytes []byte CollectionConfigPackage *pb.CollectionConfigPackage InitRequired bool PeerAddresses []string TxID string OutputFormat string InspectionEnabled bool }
CommitReadinessCheckInput holds all of the input parameters for checking whether a chaincode definition is ready to be committed ValidationParameter bytes is the (marshalled) endorsement policy when using the default endorsement and validation plugins.
func (*CommitReadinessCheckInput) Validate ¶
func (c *CommitReadinessCheckInput) Validate() error
Validate the input for a CheckCommitReadiness proposal
type CommitReadinessChecker ¶
type CommitReadinessChecker struct { Command *cobra.Command EndorserClient pb.EndorserClient Input *CommitReadinessCheckInput Signer identity.SignerSerializer Writer io.Writer }
CommitReadinessChecker holds the dependencies needed to check whether a chaincode definition is ready to be committed on a channel (i.e. has approvals from enough organizations to satisfy the lifecycle endorsement policy) and receive the list of orgs that have approved the definition.
func (*CommitReadinessChecker) ReadinessCheck ¶
func (c *CommitReadinessChecker) ReadinessCheck() error
ReadinessCheck submits a CheckCommitReadiness proposal and prints the result.
type CommittedQuerier ¶
type CommittedQuerier struct { Command *cobra.Command Input *CommittedQueryInput EndorserClient EndorserClient Signer Signer Writer io.Writer }
CommittedQuerier holds the dependencies needed to query the committed chaincode definitions
func (*CommittedQuerier) Query ¶
func (c *CommittedQuerier) Query() error
Query returns the committed chaincode definition for a given channel and chaincode name
type CommittedQueryInput ¶
type Committer ¶
type Committer struct { Certificate tls.Certificate Command *cobra.Command BroadcastClient common.BroadcastClient EndorserClients []EndorserClient DeliverClients []pb.DeliverClient Input *CommitInput Signer Signer }
Committer holds the dependencies needed to commit a chaincode
type EndorserClient ¶
type EndorserClient interface {
ProcessProposal(ctx context.Context, in *pb.SignedProposal, opts ...grpc.CallOption) (*pb.ProposalResponse, error)
}
EndorserClient defines the interface for sending a proposal to an endorser
type GetInstalledPackageInput ¶
GetInstalledPackageInput holds all of the input parameters for getting an installed chaincode package from a peer.
func (*GetInstalledPackageInput) Validate ¶
func (i *GetInstalledPackageInput) Validate() error
Validate checks that the required parameters are provided.
type InstallInput ¶
type InstallInput struct {
PackageFile string
}
InstallInput holds the input parameters for installing a chaincode.
func (*InstallInput) Validate ¶
func (i *InstallInput) Validate() error
Validate checks that the required install parameters are provided.
type InstalledPackageGetter ¶
type InstalledPackageGetter struct { Command *cobra.Command Input *GetInstalledPackageInput EndorserClient EndorserClient Signer Signer Writer Writer }
InstalledPackageGetter holds the dependencies needed to retrieve an installed chaincode package from a peer.
func (*InstalledPackageGetter) Get ¶
func (i *InstalledPackageGetter) Get() error
Get retrieves the installed chaincode package from a peer.
type InstalledQuerier ¶
type InstalledQuerier struct { Command *cobra.Command Input *InstalledQueryInput EndorserClient EndorserClient Signer Signer Writer io.Writer }
InstalledQuerier holds the dependencies needed to query the installed chaincodes
func (*InstalledQuerier) Query ¶
func (i *InstalledQuerier) Query() error
Query returns the chaincodes installed on a peer
type InstalledQueryInput ¶
type InstalledQueryInput struct {
OutputFormat string
}
type Installer ¶
type Installer struct { Command *cobra.Command EndorserClient EndorserClient Input *InstallInput Reader Reader Signer Signer }
Installer holds the dependencies needed to install a chaincode.
func (*Installer) InstallChaincode ¶
InstallChaincode installs the chaincode.
type PackageIDCalculator ¶
type PackageIDCalculator struct { Command *cobra.Command Input *CalculatePackageIDInput Reader Reader Writer io.Writer }
PackageIDCalculator holds the dependencies needed to calculate the package ID for a packaged chaincode
func (*PackageIDCalculator) CalculatePackageID ¶
func (p *PackageIDCalculator) CalculatePackageID(args []string) error
PackageIDCalculator calculates the package ID for a packaged chaincode.
func (*PackageIDCalculator) PackageID ¶
func (p *PackageIDCalculator) PackageID() error
PackageID calculates the package ID for a packaged chaincode and print it.
type PackageInput ¶
PackageInput holds the input parameters for packaging a ChaincodeInstallPackage
func (*PackageInput) Validate ¶
func (p *PackageInput) Validate() error
Validate checks for the required inputs
type PackageMetadata ¶
type PackageMetadata struct { Path string `json:"path"` Type string `json:"type"` Label string `json:"label"` }
PackageMetadata holds the path and type for a chaincode package
type Packager ¶
type Packager struct { Command *cobra.Command Input *PackageInput PlatformRegistry PlatformRegistry Writer Writer }
Packager holds the dependencies needed to package a chaincode and write it
func (*Packager) Package ¶
Package packages chaincodes into the package type, (.tar.gz) used by _lifecycle and writes it to disk
func (*Packager) PackageChaincode ¶
PackageChaincode packages a chaincode.
type PeerDeliverClient ¶
type PeerDeliverClient interface { Deliver(ctx context.Context, opts ...grpc.CallOption) (pb.Deliver_DeliverClient, error) DeliverFiltered(ctx context.Context, opts ...grpc.CallOption) (pb.Deliver_DeliverClient, error) }
PeerDeliverClient defines the interface for a peer deliver client
type PlatformRegistry ¶
type PlatformRegistry interface { GetDeploymentPayload(ccType, path string) ([]byte, error) NormalizePath(ccType, path string) (string, error) }
PlatformRegistry defines the interface to get the code bytes for a chaincode given the type and path