Documentation ¶
Index ¶
- func GenerateRandomID() string
- func GetByteArgs(argsArray []string) [][]byte
- func GetChannelAnchorTxPath(channelID, orgName string) string
- func GetChannelTxPath(channelID string) string
- func HasPrimaryPeerJoinedChannel(client api.FabricClient, orgUser api.User, channel api.Channel) (bool, error)
- func IsChaincodeInstalled(client api.FabricClient, peer api.Peer, name string) (bool, error)
- type BDDContext
- type CommonSteps
- type Composition
- func (c *Composition) Decompose(dir string) (output string, err error)
- func (c *Composition) GenerateLogs(dir string) error
- func (c *Composition) GetAPIContainerForComposeService(composeService string) (apiContainer *docker.APIContainers, err error)
- func (c *Composition) GetContainerIDs(dir string) (containerIDs []string, err error)
- func (c *Composition) GetIPAddressForComposeService(composeService string) (ipAddress string, err error)
- type DockerHelper
- type EventSnapSteps
- type SnapTransactionRequest
- type TxnSnapSteps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetByteArgs ¶ added in v0.1.2
GetByteArgs is a utility which converts []string to [][]bytes
func GetChannelAnchorTxPath ¶
GetChannelAnchorTxPath returns path to the channel anchor tx file for the given channel
func GetChannelTxPath ¶
GetChannelTxPath returns path to the channel tx file for the given channel
func HasPrimaryPeerJoinedChannel ¶
func HasPrimaryPeerJoinedChannel(client api.FabricClient, orgUser api.User, channel api.Channel) (bool, error)
HasPrimaryPeerJoinedChannel checks whether the primary peer of a channel has already joined the channel. It returns true if it has, false otherwise, or an error
func IsChaincodeInstalled ¶
IsChaincodeInstalled Helper function to check if chaincode has been deployed
Types ¶
type BDDContext ¶
type BDDContext struct { Client sdkApi.FabricClient Channel sdkApi.Channel Org1Admin sdkApi.User OrdererAdmin sdkApi.User Org1User sdkApi.User Composition *Composition Sdk *sdkFabApi.FabricSDK }
BDDContext ...
type CommonSteps ¶
type CommonSteps struct {
BDDContext *BDDContext
}
CommonSteps contain BDDContext
func NewCommonSteps ¶
func NewCommonSteps(context *BDDContext) *CommonSteps
NewCommonSteps create new CommonSteps struct
func (*CommonSteps) RegisterTxEvent ¶ added in v0.1.2
func (d *CommonSteps) RegisterTxEvent(txID apitxn.TransactionID, eventHub sdkApi.EventHub) (chan bool, chan error)
RegisterTxEvent registers on the given eventhub for the give transaction returns a boolean channel which receives true when the event is complete and an error channel for errors
type Composition ¶
type Composition struct {
// contains filtered or unexported fields
}
Composition represents a docker-compose execution and management
func NewComposition ¶
func NewComposition(projectName string, composeFilesYaml string, dir string) (composition *Composition, err error)
NewComposition create a new Composition specifying the project name (for isolation) and the compose files.
func (*Composition) Decompose ¶
func (c *Composition) Decompose(dir string) (output string, err error)
Decompose decompose the composition. Will also remove any containers with the same projectName prefix (eg. chaincode containers)
func (*Composition) GenerateLogs ¶
func (c *Composition) GenerateLogs(dir string) error
GenerateLogs to file
func (*Composition) GetAPIContainerForComposeService ¶
func (c *Composition) GetAPIContainerForComposeService(composeService string) (apiContainer *docker.APIContainers, err error)
GetAPIContainerForComposeService return the docker.APIContainers with the supplied composeService name.
func (*Composition) GetContainerIDs ¶
func (c *Composition) GetContainerIDs(dir string) (containerIDs []string, err error)
GetContainerIDs returns the container IDs for the composition (NOTE: does NOT include those defined outside composition, eg. chaincode containers)
func (*Composition) GetIPAddressForComposeService ¶
func (c *Composition) GetIPAddressForComposeService(composeService string) (ipAddress string, err error)
GetIPAddressForComposeService returns the IPAddress of the container with the supplied composeService name.
type DockerHelper ¶
type DockerHelper interface { GetIPAddress(containerID string) (string, error) RemoveContainersWithNamePrefix(namePrefix string) error }
DockerHelper helper for docker specific functions
func NewDockerCmdlineHelper ¶
func NewDockerCmdlineHelper() (DockerHelper, error)
NewDockerCmdlineHelper returns a new command line DockerHelper instance
type EventSnapSteps ¶ added in v0.1.2
type EventSnapSteps struct {
BDDContext *BDDContext
}
EventSnapSteps ...
func NewEventSnapSteps ¶ added in v0.1.2
func NewEventSnapSteps(context *BDDContext) *EventSnapSteps
NewEventSnapSteps ...
type SnapTransactionRequest ¶
type SnapTransactionRequest struct { ChannelID string // required channel ID ChaincodeID string // required chaincode ID TransientMap map[string][]byte // optional transient Map EndorserArgs [][]byte // optional args for endorsement CCIDsForEndorsement []string // optional ccIDs For endorsement selection RegisterTxEvent bool // optional args for register Tx event (default is false) }
SnapTransactionRequest type will be passed as argument to a transaction snap ChannelID and ChaincodeID are mandatory fields