'use strict' ; import { FabricSmartContractDefinition } from '../fabricModel/FabricSmartContractDefinition' ; import { IFabricWallet } from './IFabricWallet' ; import { FabricNode } from '../fabricModel/FabricNode' ; import { Attribute } from '../fabricModel/FabricCertificate' ; import { FabricInstalledSmartContract } from '../fabricModel/FabricInstalledSmartContract' ; import { FabricCollectionDefinition } from '../fabricModel/FabricCollectionDefinition' ; export interface IFabricEnvironmentConnection { environmentName : string ; connect ( nodes ) : Promise < void > ; disconnect ( ) : void ; getDiscoveredOrgs ( channelName ) : Promise < Map < string , string [ ] > > ; getAllDiscoveredPeerNames ( channelName ) : Promise < Array < string > > ; getAllPeerNames ( ) : Array < string > ; getAllPeerNamesForOrg ( orgName ) : Array < string > ; createChannelMap ( ) : Promise < Map < string , Array < string > > > ; getCommittedSmartContractDefinitions ( peerNames , channelName ) : Promise < Array < FabricSmartContractDefinition > > ; getAllCommittedSmartContractDefinitions ( ) : Promise < Array < FabricSmartContractDefinition > > ; getAllOrganizationNames ( ) : Array < string > ; getAllCertificateAuthorityNames ( ) : Array < string > ; getInstalledSmartContracts ( peerName , isV1 ? ) : Promise < FabricInstalledSmartContract [ ] > ; getAllOrdererNames ( ) : Array < string > ; installSmartContract ( pathToPackage , peerName , label , defaultTimeout ? ) : Promise < string > ; instantiateChaincode ( chaincodeName , version , peerNames , channelName , fcn , args , collectionConfigString , contractEP ) : Promise < void > ; upgradeChaincode ( chaincodeName , version , peerNames , channelName , fcn , args , collectionConfigString , contractEP ) : Promise < void > ; enroll ( certificateAuthorityName , enrollmentID , enrollmentSecret ) : Promise < { certificate : string ; privateKey : string ; } > ; register ( certificateAuthorityName , enrollmentID , affiliation , attributes ? ) : Promise < string > ; getNode ( nodeName ) : FabricNode ; getWallet ( nodeName ) : Promise < IFabricWallet > ; approveSmartContractDefinition ( ordererName , channelName , peerNames , smartContractDefinition , defaultTimeout ? ) : Promise < boolean > ; commitSmartContractDefinition ( ordererName , channelName , peerNames , smartContractDefinition , defaultTimeout ? ) : Promise < void > ; getOrgApprovals ( channelName , peerName , smartContractDefinition ) : Promise < Map < string , boolean > > ; getCommitReadiness ( channelName , peerName , smartContractDefinition ) : Promise < boolean > ; getEndorsementPolicyBuffer ( policy ) : Buffer ; getCollectionConfigBuffer ( collectionConfig ) : Buffer ; getChannelCapabilityFromPeer ( channelName , peerName ) : Promise < Array < string > > ; }