Documentation ¶
Index ¶
- Variables
- func FindPKCS11Lib(configuredLib string) string
- func GenerateRandomID() string
- func GetByteArgs(argsArray []string) [][]byte
- func GetChannelAnchorTxPath(channelID, orgName string) string
- func GetChannelTxPath(channelID string) string
- func HasPrimaryPeerJoinedChannel(client api.Resource, orgUser api.IdentityContext, channel api.Channel) (bool, error)
- func IsChaincodeInstalled(client api.Resource, peer api.Peer, name string) (bool, error)
- func NewCollectionConfig(collName string, requiredPeerCount, maxPeerCount int32, ...) *common.CollectionConfig
- type BDDContext
- func (b *BDDContext) AddPeerConfigToChannel(pconfig *PeerConfig, channelID string)
- func (b *BDDContext) AfterScenario(interface{}, error)
- func (b *BDDContext) BeforeScenario(scenarioOrScenarioOutline interface{})
- func (b *BDDContext) ClientConfig() apiconfig.Config
- func (b *BDDContext) CollectionConfig(coll string) *CollectionConfig
- func (b *BDDContext) DefineCollectionConfig(id, name, policy string, requiredPeerCount, maxPeerCount int32) *CollectionConfig
- func (b *BDDContext) Orderers() []string
- func (b *BDDContext) OrgClient(org, userType string) *fabsdk.Client
- func (b *BDDContext) OrgResourceClient(org, userType string) sdkApi.Resource
- func (b *BDDContext) OrgUser(org, userType string) sdkApi.IdentityContext
- func (b *BDDContext) Orgs() []string
- func (b *BDDContext) OrgsByChannel(channelID string) []string
- func (b *BDDContext) PeersByChannel(channelID string) []*PeerConfig
- type CollectionConfig
- type CommonSteps
- func (d *CommonSteps) InvokeCCWithArgs(ccID, channelID string, args []string, transientData map[string][]byte, ...) error
- func (d *CommonSteps) InvokeCConOrg(ccID, args, orgIDs, channelID string) error
- func (d *CommonSteps) OrgPeers(orgIDs, channelID string) []*PeerConfig
- func (d *CommonSteps) QueryCCWithArgs(ccID, channelID string, args []string, targets ...*PeerConfig) (string, error)
- func (d *CommonSteps) RegisterSteps(s *godog.Suite)
- 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 ConfigurationsSnapSteps
- type DockerHelper
- type EventSnapSteps
- type PeerConfig
Constants ¶
This section is empty.
Variables ¶
var ADMIN = "admin"
ADMIN type
var USER = "user"
USER type
Functions ¶
func FindPKCS11Lib ¶ added in v0.1.9
FindPKCS11Lib find lib based on configuration
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.Resource, orgUser api.IdentityContext, 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
func NewCollectionConfig ¶ added in v0.1.9
func NewCollectionConfig(collName string, requiredPeerCount, maxPeerCount int32, policy *common.SignaturePolicyEnvelope) *common.CollectionConfig
NewCollectionConfig return CollectionConfig
Types ¶
type BDDContext ¶
type BDDContext struct {
// contains filtered or unexported fields
}
BDDContext ...
func NewBDDContext ¶
func NewBDDContext(orgs []string, orderers []string, clientConfigFilePath string, clientConfigFileName string, snapsConfigFilePath string, peersMspID map[string]string, testCCPath string) (*BDDContext, error)
NewBDDContext create new BDDContext
func (*BDDContext) AddPeerConfigToChannel ¶ added in v0.1.9
func (b *BDDContext) AddPeerConfigToChannel(pconfig *PeerConfig, channelID string)
AddPeerConfigToChannel adds a peer to a channel
func (*BDDContext) AfterScenario ¶ added in v0.1.9
func (b *BDDContext) AfterScenario(interface{}, error)
AfterScenario execute code after bdd scenario
func (*BDDContext) BeforeScenario ¶ added in v0.1.9
func (b *BDDContext) BeforeScenario(scenarioOrScenarioOutline interface{})
BeforeScenario execute code before bdd scenario
func (*BDDContext) ClientConfig ¶ added in v0.1.9
func (b *BDDContext) ClientConfig() apiconfig.Config
ClientConfig returns client config
func (*BDDContext) CollectionConfig ¶ added in v0.1.9
func (b *BDDContext) CollectionConfig(coll string) *CollectionConfig
CollectionConfig returns the private data collection configuration for the given collection name. If the collection configuration does not exist then nil is returned.
func (*BDDContext) DefineCollectionConfig ¶ added in v0.1.9
func (b *BDDContext) DefineCollectionConfig(id, name, policy string, requiredPeerCount, maxPeerCount int32) *CollectionConfig
DefineCollectionConfig defines a new private data collection configuration
func (*BDDContext) Orderers ¶ added in v0.1.9
func (b *BDDContext) Orderers() []string
Orderers returns the orderers
func (*BDDContext) OrgClient ¶ added in v0.1.9
func (b *BDDContext) OrgClient(org, userType string) *fabsdk.Client
OrgClient returns the org client
func (*BDDContext) OrgResourceClient ¶ added in v0.1.9
func (b *BDDContext) OrgResourceClient(org, userType string) sdkApi.Resource
OrgResourceClient returns the org resource client
func (*BDDContext) OrgUser ¶ added in v0.1.9
func (b *BDDContext) OrgUser(org, userType string) sdkApi.IdentityContext
OrgUser returns the org user
func (*BDDContext) Orgs ¶ added in v0.1.9
func (b *BDDContext) Orgs() []string
Orgs returns the orgs
func (*BDDContext) OrgsByChannel ¶ added in v0.1.9
func (b *BDDContext) OrgsByChannel(channelID string) []string
OrgsByChannel returns the orgs for the given channel
func (*BDDContext) PeersByChannel ¶ added in v0.1.9
func (b *BDDContext) PeersByChannel(channelID string) []*PeerConfig
PeersByChannel returns the peers for the given channel
type CollectionConfig ¶ added in v0.1.9
type CollectionConfig struct { Name string Policy string RequiredPeerCount int32 MaxPeerCount int32 }
CollectionConfig contains the private data collection config
type CommonSteps ¶
type CommonSteps struct {
BDDContext *BDDContext
}
CommonSteps contain BDDContext
func NewCommonSteps ¶
func NewCommonSteps(context *BDDContext) *CommonSteps
NewCommonSteps create new CommonSteps struct
func (*CommonSteps) InvokeCCWithArgs ¶ added in v0.1.9
func (d *CommonSteps) InvokeCCWithArgs(ccID, channelID string, args []string, transientData map[string][]byte, targets ...*PeerConfig) error
InvokeCCWithArgs ...
func (*CommonSteps) InvokeCConOrg ¶ added in v0.1.9
func (d *CommonSteps) InvokeCConOrg(ccID, args, orgIDs, channelID string) error
InvokeCConOrg invoke cc on org
func (*CommonSteps) OrgPeers ¶ added in v0.1.9
func (d *CommonSteps) OrgPeers(orgIDs, channelID string) []*PeerConfig
OrgPeers return array of PeerConfig
func (*CommonSteps) QueryCCWithArgs ¶ added in v0.1.9
func (d *CommonSteps) QueryCCWithArgs(ccID, channelID string, args []string, targets ...*PeerConfig) (string, error)
QueryCCWithArgs ...
func (*CommonSteps) RegisterSteps ¶ added in v0.1.9
func (d *CommonSteps) RegisterSteps(s *godog.Suite)
RegisterSteps register steps
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 ConfigurationsSnapSteps ¶ added in v0.1.9
type ConfigurationsSnapSteps struct {
BDDContext *BDDContext
}
ConfigurationsSnapSteps ...
func NewConfigurationsSnapSteps ¶ added in v0.1.9
func NewConfigurationsSnapSteps(context *BDDContext) *ConfigurationsSnapSteps
NewConfigurationsSnapSteps ...
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 PeerConfig ¶ added in v0.1.9
type PeerConfig struct { OrgID string Config apiconfig.PeerConfig MspID string PeerID string }
PeerConfig holds the peer configuration and org ID