integration

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExampleCCInitB    = "200"
	ExampleCCUpgradeB = "400"
)

Initial B values for ExampleCC

View Source
const (
	// ConfigTestFile contains the path and filename of the config for integration tests
	ConfigTestFile = "../fixtures/config/config_test.yaml"

	//ConfigChBlockTestFile  the path and filename of the config for integration tests in which orderer config is not provided
	ConfigChBlockTestFile = "../fixtures/config/config_test_no_orderer.yaml"
)

Variables

This section is empty.

Functions

func CreateAndSendTransaction

func CreateAndSendTransaction(channel fab.Channel, resps []*fab.TransactionProposalResponse) (*fab.TransactionResponse, error)

CreateAndSendTransaction ...

func CreateAndSendTransactionProposal

func CreateAndSendTransactionProposal(channel fab.Channel, chainCodeID string,
	fcn string, args [][]byte, targets []fab.ProposalProcessor, transientData map[string][]byte) ([]*fab.TransactionProposalResponse, fab.TransactionID, error)

CreateAndSendTransactionProposal ... TODO duplicate

func CreateChannel

func CreateChannel(sdk *fabsdk.FabricSDK, req chmgmt.SaveChannelRequest) (bool, error)

CreateChannel attempts to save the named channel.

func CreateProposalProcessors

func CreateProposalProcessors(config apiconfig.Config, orgs []string) ([]fab.ProposalProcessor, error)

CreateProposalProcessors initializes target peers based on config

func ExampleCCInitArgs

func ExampleCCInitArgs() [][]byte

ExampleCCInitArgs returns example cc initialization args

func ExampleCCQueryArgs

func ExampleCCQueryArgs() [][]byte

ExampleCCQueryArgs returns example cc query args

func ExampleCCTxArgs

func ExampleCCTxArgs() [][]byte

ExampleCCTxArgs returns example cc move funds args

func ExampleCCUpgradeArgs

func ExampleCCUpgradeArgs() [][]byte

ExampleCCUpgradeArgs returns example cc upgrade args

func FilterTargetsJoinedChannel

func FilterTargetsJoinedChannel(sdk *fabsdk.FabricSDK, orgID string, channelID string, targets []fab.ProposalProcessor) ([]fab.ProposalProcessor, error)

FilterTargetsJoinedChannel filters targets to those that have joined the named channel.

func GenerateRandomID

func GenerateRandomID() string

GenerateRandomID generates random ID

func GetChannel

func GetChannel(sdk *fabsdk.FabricSDK, ic fab.IdentityContext, config apiconfig.Config, chCfg fab.ChannelCfg, orgs []string) (fab.Channel, error)

GetChannel initializes and returns a channel based on config

func GetDeployPath

func GetDeployPath() string

GetDeployPath ..

func HasPeerJoinedChannel

func HasPeerJoinedChannel(client fab.Resource, peer fab.ProposalProcessor, channel string) (bool, error)

HasPeerJoinedChannel checks whether the peer has already joined the channel. It returns true if it has, false otherwise, or an error

func InitializeChannel

func InitializeChannel(sdk *fabsdk.FabricSDK, orgID string, req chmgmt.SaveChannelRequest, targets []fab.ProposalProcessor) error

InitializeChannel ...

func InstallAndInstantiateCC

func InstallAndInstantiateCC(sdk *fabsdk.FabricSDK, user fabsdk.IdentityOption, orgName string, ccName, ccPath, ccVersion, goPath string, ccArgs [][]byte) error

InstallAndInstantiateCC install and instantiate using resource management client

func InstallAndInstantiateExampleCC

func InstallAndInstantiateExampleCC(sdk *fabsdk.FabricSDK, user fabsdk.IdentityOption, orgName string, chainCodeID string) error

InstallAndInstantiateExampleCC install and instantiate using resource management client

func JoinChannel

func JoinChannel(sdk *fabsdk.FabricSDK, name string) (bool, error)

JoinChannel attempts to save the named channel.

func RegisterTxEvent

func RegisterTxEvent(t *testing.T, txID fab.TransactionID, eventHub fab.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 TODO - Duplicate

Types

type BaseSetupImpl

type BaseSetupImpl struct {
	SDK             *fabsdk.FabricSDK
	Identity        fab.IdentityContext
	Client          fab.Resource
	Channel         fab.Channel
	EventHub        fab.EventHub
	ConnectEventHub bool
	ConfigFile      string
	OrgID           string
	ChannelID       string
	Initialized     bool
	ChannelConfig   string
}

BaseSetupImpl implementation of BaseTestSetup

func (*BaseSetupImpl) InitConfig

func (setup *BaseSetupImpl) InitConfig() apiconfig.ConfigProvider

InitConfig ...

func (*BaseSetupImpl) Initialize

func (setup *BaseSetupImpl) Initialize() error

Initialize reads configuration from file and sets up client, channel and event hub

func (*BaseSetupImpl) InstallCC

func (setup *BaseSetupImpl) InstallCC(name string, path string, version string, ccPackage *fab.CCPackage) error

InstallCC use low level client to install chaincode

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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