- Main
- fcw
- ChannelSetup
- Transactor
- UserClient
- getClient
- getMspId
- getCryptoSuite
- getStore
- getUsername
- getRoles
- setRoles
- getFabricCAClient
- setFabricCAClient
- getEnrollmentSecret
- setEnrollmentSecret
- newEventHubPeer
- registerUserInCA
- extractChannelConfig
- signChannelConfig
- newTransactionID
- queryChannels
- queryInstalledChaincodes
- queryChannelInfo
- queryInstantiatedChaincodes
- queryTransaction
- isChaincodeInstalled
- isChannelCreated
- isChannelJoined
- isChaincodeInstantiated
- bindChannel
- getChannelGenesisBlock
- initializeChannel
- createChannel
- updateChannel
- joinChannel
- installChaincode
- instantiateChaincode
- upgradeChaincode
- sendTransactionProposal
- sendTransaction
- queryChaincode
- invokeChaincode
- EventHubManager
- FcwPeer
- EventHubPeer
- EventHubChannel
- upgradePeerToFcwPeer
- newFcwPeer
- isFcwPeer
- upgradeFcwPeerToEventHubPeer
- upgradePeerToEventHubPeer
- newEventHubPeer
- isEventHubPeer
- upgradeChannelToEventHubChannel
- newEventHubChannel
- isEventHubChannel
- newFileKeyValueStoreAndCryptoSuite
- newCouchDBKeyValueStoreAndCryptoSuite
- newUserClientFromKeys
- newUserClientFromCAEnroll
- newUserClientFromCARegisterAndEnroll
- newUserClientFromStore
- pickPeersForPolicy
- Objects
- NewEventHubChannelOpts
- CryptoStore
- InvokeChaincodeResponse
- QueryChaincodeResponse
- SendTransactionProposalResponse
- SendTransactionResponse
- WaitSendTransaction
- WaitPoll
- WaitEvent
- WaitSimple
- WaitCreateChannel
- fabric-client (external)
- FabricClient
- Peer
- Channel
- Orderer
- EventHub
- FabricCAClient
- KeyValueStore
- CryptoSuite
- ConnectionOpts
- Policy
- IdentityPEMs
- ProposalResponse
- ProposalResponseObject
- Block
- TransactionRequest
- RegisterRequest
Creates a new object for issuing chaincode transactions or listening for chaincode events
Parameters
userClient
UserClient The UserClient representing the user performing chaincode transactionschannel
Channel The Channel object representing the channel to transact onchaincodeId
string The ID of the chaincode being transacted onpeersOrPolicy
(Array<Peer> | Policy)? An array of peers to transact with or the endorsement policy to select peers with
Properties
UserClient
UserClient Class representing a user and also a wrapper over FabricClientupgradePeerToFcwPeer
upgradePeerToFcwPeer Upgrades a fabric-client Peer with additional MSP informationnewFcwPeer
newFcwPeer Creates a fabric-clietn Peer with additional MSP informationisFcwPeer
isFcwPeer Checks whether an object is a FcwPeerupgradeFcwPeerToEventHubPeer
upgradeFcwPeerToEventHubPeer Upgrades a FcwPeer with an EventHubManagerupgradePeerToEventHubPeer
upgradePeerToEventHubPeer Upgrades a fabric-client Peer with additional MSP information and an EventHubManagernewEventHubPeer
newEventHubPeer Creates a fabric-client Peer with additional MSP information and an EventHubManagerisEventHubPeer
isEventHubPeer Checks whether an object is an EventHubPeerupgradeChannelToFcwChannel
upgradeChannelToFcwChannel Upgrades a fabric-client Channel to keep track of recent transactionsnewFcwChannel
newFcwChannel Creates a fabric-client Channel that keeps track of recent transactionsisFcwChannel
isFcwChannel Checks whether an object is a FcwChannelnewFileKeyValueStoreAndCryptoSuite
newFileKeyValueStoreAndCryptoSuite Creates a new file based key-value store and the associated cryptoSuitenewCouchDBKeyValueStoreAndCryptoSuite
newCouchDBKeyValueStoreAndCryptoSuite Creates a new CouchDB based key-value and the associated cryptoSuitenewUserClientFromKeys
newUserClientFromKeys Creates a new UserClient from a public private key pairnewUserClientFromCAEnroll
newUserClientFromCAEnroll Creates a new UserClient from enrolling in the CAnewUserClientFromCARegisterAndEnroll
newUserClientFromCARegisterAndEnroll Creates a new UserClient from registering and enrolling in the CAnewUserClientFromStore
newUserClientFromStore Creates a new UserClient from the key value storepickPeersForPolicy
pickPeersForPolicy Picks peers from a larger set that satisfy an endorsement policyADMIN_ROLE
string The string 'admin'CA_ADMIN_ROLE
string The string 'ca_admin'MEMBER_ROLE
string The string 'member'
Returns Transactor The new object for interacting with the chaincode
creates an object for building and running channel setup requests
Parameters
userClient
The UserClient representing the user setting up the channelchannelOrChannelName
opts
Additional optionsopts.swallowAlreadyCreatedErrors
boolean? Option to swallow errors about channel being already created/joined or chaincode being installed/instantiatedopts.network
Network optionsopts.network.leader
boolean? Whether to be the network leader (the server)opts.network.mspIds
Array<string>? The MSP IDs that the org represents, only required for non-leadersopts.network.externalMspIds
Array<string>? The MSP IDs of external organisations. Is optional and is only used by leaderopts.network.host
string? The host of the server. Is optional and is only used by non-leaders.opts.network.port
string The port to communicate on. (optional, default45207
)opts.network.timeout
number? The maximum amount of time to wait between various stages of the network setup phaseopts.network.onError
Function? Callback function for socket errors
channelOrChannelOpts
Either the channel object you wish to use or the arguments to create a new channel
Returns Promise<Channel> The setup channel
Class for building and running channel setup requests
Parameters
userClient
UserClient The UserClient representing the user setting up the channelchannelOrChannelOpts
(Channel | ChannelOpts) Either the EventHubChannel object you wish to use or the arguments to create a new EventHubChannelopts
any Additional options[swallowAlreadyCreatedErrors]opts.swallowAlreadyCreatedErrors
boolean? Option to swallow errors about channel being already created/joined or chaincode being installed/instantiatedopts.network
Network optionsopts.network.leader
boolean? Whether to be the network leader (the server)opts.network.mspIds
Array<string>? The MSP IDs that the org represents, only required for non-leadersopts.network.externalMspIds
Array<string>? The MSP IDs of external organisations. Is optional and is only used by leaderopts.network.host
string? The host of the server. Is optional and is only used by non-leaders.opts.network.port
string The port to communicate on. (optional, default45207
)opts.network.timeout
number The maximum amount of time to wait between various stages of the network setup phase (optional, default600000
)opts.network.onError
Function? Callback function for socket errors
Adds a createChannel operation to the builder
Parameters
createChannelRequest
CreateChannelRequest The options for creating a channel on the networkcreateChannelRequest.channelEnvelope
Array<byte>? The envelope for the new channel, required if no config is specifiedcreateChannelRequest.channelConfig
Array<byte>? The configuration for the new channel, required if no envelope is specifiedcreateChannelRequest.signatures
Array<ConfigSignature>? The signatures required for the new chanel, required if no envelope is specifiedcreateChannelRequest.txId
TransactionID? TransactionID object with the transaction id and nonce. One will be generated automatically if not supplied
opts
any Additional options
Returns ChannelSetup The ChannelSetup instance
Adds a joinChannel operation to the builder
Parameters
joinChannelRequest
JoinChannelRequest The options for joining the channel on the networkjoinChannelRequest.targets
Array<(Peer | FcwPeer | EventHubPeer)>? An array of Peer objects or Peer names that will be asked to join this channel.joinChannelRequest.genesisBlock
Block? The genesis block for the channeljoinChannelRequest.txId
TransactionID? TransactionID object with the transaction id and nonce. One will be generated automatically if not supplied
opts
any Additional options
Returns ChannelSetup The ChannelSetup instance
Adds an updateChannel operation to the builder
Parameters
updateChannelRequest
CreateChannelRequest The options for updating a channel on the networkupdateChannelRequest.channelEnvelope
Array<byte>? The envelope for the new channel, required if no config is specifiedupdateChannelRequest.channelConfig
Array<byte>? The configuration for the new channel, required if no envelope is specifiedupdateChannelRequest.signatures
Array<ConfigSignature>? The signatures required for the new chanel, required if no envelope is specifiedupdateChannelRequest.txId
TransactionID? TransactionID object with the transaction id and nonce. One will be generated automatically if not supplied
opts
any Additional options
Returns ChannelSetup The ChannelSetup instance
Adds an installChaincode operation to the builder
Parameters
chaincodeInstallRequest
ReducedChaincodeInstallRequest The options for installing chaincode on peers.chaincodeInstallRequest.targets
Array<Peer>? An array of Peer objects that the chaincode will be installed on. Uses peers from channel if none are suppliedchaincodeInstallRequest.chaincodePath
string The path to the location of the source code of the chaincode. If the chaincode type is golang, then this path is the fully qualified package name, such as 'mycompany.com/myproject/mypackage/mychaincode'chaincodeInstallRequest.chaincodeId
string Name of the chaincodechaincodeInstallRequest.chaincodeVersion
string Version string of the chaincode, such as 'v1'chaincodeInstallRequest.chaincodePackage
string? Byte array of the archive content for the chaincode source. The archive must have a 'src' folder containing subfolders corresponding to the 'chaincodePath' field. For instance, if the chaincodePath is 'mycompany.com/myproject/mypackage/mychaincode', then the archive must contain a folder 'src/mycompany.com/myproject/mypackage/mychaincode', where the GO source code resides.chaincodeInstallRequest.chaincodeType
string? Type of chaincode. One of 'golang', 'car' or 'java'. Default is 'golang'. Note that 'java' is not supported as of v1.0.
opts
any Additional options
Returns ChannelSetup The ChannelSetup instance
Adds an instantiateChaincode operation to the builder
Parameters
chaincodeInstantiateRequest
FcwChaincodeInstantiateUpgradeRequest The chaincode instantiation request to be madechaincodeInstantiateRequest.targets
(Array<Peer> | Policy)? An array of Peer objects that are used to satisfy the instantiation policy or a policy used to select peers from the channel. If targets is not specified Defaults to channel peers if not specifiedchaincodeInstantiateRequest.chaincodeId
string Name of the chaincodechaincodeInstantiateRequest.chaincodeVersion
string Version string of the chaincode, such as 'v1'chaincodeInstantiateRequest.txId
TransactionID? TransactionID object with the transaction id and nonce. One will be generated automatically if not suppliedchaincodeInstantiateRequest.chaincodeType
string? Type of chaincode. One of 'golang', 'car' or 'java'. Default is 'golang'. Note that 'java' is not supported as of v1.0.chaincodeInstantiateRequest.transientMap
Map? Map that can be used by the chaincode during intialization, but not saved in the ledger. Data such as cryptographic information for encryption can be passed to the chaincode using this techniquechaincodeInstantiateRequest.fcn
string? The function name to be returned when calling stub.GetFunctionAndParameters() in the target chaincode. Default is 'init'chaincodeInstantiateRequest.args
Array<string>? Array of string arguments to pass to the function identified by the fcn valuechaincodeInstantiateRequest.endorsement-policy
Policy? EndorsementPolicy object for this chaincode (see examples below). If not specified, a default policy of "a signature by any member from any of the organizations corresponding to the array of member service providers" is used. WARNING: The default policy is NOT recommended for production, because this allows an application to bypass the proposal endorsement and send a manually constructed transaction, with arbitrary output in the write set, to the orderer directly. An application's own signature would allow the transaction to be successfully validated and committed to the ledger.
opts
any Additional optionsopts.timeout
number A number indicating milliseconds to wait on the response before rejecting the promise with a timeout error. (optional, default600000
)opts.waitOpts
Options for waitingopts.swallowAlreadyCreatedErrors
boolean? Option to swallow errors about chaincode being already instantiated. Overrides class level option
Returns ChannelSetup The ChannelSetup instance
Adds an upgradeChaincode operation to the builder
Parameters
chaincodeUpgradeRequest
FcwChaincodeInstantiateUpgradeRequest The chaincode upgrade request to be madechaincodeUpgradeRequest.chaincodeId
string Name of the chaincodechaincodeUpgradeRequest.chaincodeVersion
string Version string of the chaincode, such as 'v1'chaincodeUpgradeRequest.txId
TransactionID? TransactionID object with the transaction id and nonce. One will be generated automatically if not suppliedchaincodeUpgradeRequest.chaincodeType
string? Type of chaincode. One of 'golang', 'car' or 'java'. Default is 'golang'. Note that 'java' is not supported as of v1.0.chaincodeUpgradeRequest.transientMap
Map? Map that can be used by the chaincode during intialization, but not saved in the ledger. Data such as cryptographic information for encryption can be passed to the chaincode using this techniquechaincodeUpgradeRequest.fcn
string? The function name to be returned when calling stub.GetFunctionAndParameters() in the target chaincode. Default is 'init'chaincodeUpgradeRequest.args
Array<string>? Array of string arguments to pass to the function identified by the fcn valuechaincodeUpgradeRequest.endorsement-policy
Policy? EndorsementPolicy object for this chaincode (see examples below). If not specified, a default policy of "a signature by any member from any of the organizations corresponding to the array of member service providers" is used. WARNING: The default policy is NOT recommended for production, because this allows an application to bypass the proposal endorsement and send a manually constructed transaction, with arbitrary output in the write set, to the orderer directly. An application's own signature would allow the transaction to be successfully validated and committed to the ledger.
opts
any Additional optionsopts.timeout
number A number indicating milliseconds to wait on the response before rejecting the promise with a timeout error. (optional, default600000
)opts.waitOpts
Options for waiting
Returns ChannelSetup The ChannelSetup instance
Sends the request that has been built
Returns Promise<Channel> The channel instance that has been setup
Class for issuing chaincode transactions Creates a new object for issuing chaincode transactions or listening for chaincode events
Parameters
userClient
UserClient The UserClient representing the user performing chaincode transactionschannel
Channel The Channel object representing the channel to transact onchaincodeId
string The ID of the chaincode being transacted ondefaultTargets
(Array<Peer> | Policy) An array of peers to transact with or the endorsement policy to select peers withqueryPeer
Peer The peer you wish to use by default for queries
Updates the endorsing peers that are used
Parameters
targets
(Array<Peer> | Policy) An array of peers to transact with or the endorsement policy to select peers with
Returns void
Gets the UserClient
Returns UserClient
Gets the channel
Returns Channel
Gets the chaincode ID
Returns string
Gets the endorsingPeers
Performs a chaincode transaction proposal and formats the response
Parameters
fcn
string The function name to be returned when callingstub.GetFunctionAndParameters()
in the target chaincode. Default is 'invoke'argsOrArgBytes
(Array<string> | Buffer)opts
any The options for the queryopts.txId
TransactionID? TransactionID object with the transaction id and nonce. One will be generated automatically if not suppliedopts.transientMap
Map? Map that can be used by the chaincode but not saved in the ledger, such as cryptographic information for encryptionopts.target
Peer? The peer to use for the transaction proposal, falls back to the first peer in the channel if unspecifiedopts.timeout
number A number indicating milliseconds to wait on the response before rejecting the promise with a timeout error. (optional, default60000
)
args
An array of string arguments or a buffer specific to the chaincode's 'Invoke' method
Returns Promise<QueryChaincodeResponse> A promise containing formatted transactionProposal response from a single peer
Performs a chaincode invoke
Parameters
fcn
string The function name to be returned when callingstub.GetFunctionAndParameters()
in the target chaincode. Default is 'invoke'argsOrArgBytes
(Array<string> | Buffer)opts
any The options for the invokeopts.txId
TransactionID? TransactionID object with the transaction id and nonce. One will be generated automatically if not suppliedopts.transientMap
Map? Map that can be used by the chaincode but not saved in the ledger, such as cryptographic information for encryptionopts.targets
(Array<Peer> | Policy)? The peers to use for the transaction proposal or endorsement policy for the chaincode, falls back to the peers in the channel if unspecifiedopts.timeout
number A number indicating milliseconds to wait on the response before rejecting the promise with a timeout error. (optional, default60000
)opts.waitOpts
args
An array of string arguments or a buffer specific to the chaincode's 'Invoke' method
Returns Promise<InvokeChaincodeResponse> A promise containing an object that contains information about the invoke
Performs a chaincode transaction proposal
Parameters
fcn
string The function name to be returned when callingstub.GetFunctionAndParameters()
in the target chaincode. Default is 'invoke'argsOrArgBytes
(Array<string> | Buffer) An array of string arguments or a buffer specific to the chaincode's 'Invoke' methodopts
any The options for the transaction proposalopts.txId
TransactionID? TransactionID object with the transaction id and nonce. One will be generated automatically if not suppliedopts.transientMap
Map? Map that can be used by the chaincode but not saved in the ledger, such as cryptographic information for encryptionopts.targets
(Array<Peer> | Policy)? The peers to use for the transaction proposal or endorsement policy for the chaincode, falls back to the peers in the channel if unspecifiedopts.timeout
number A number indicating milliseconds to wait on the response before rejecting the promise with a timeout error. (optional, default60000
)
Returns Promise<SendTransactionProposalResponse> A promise containing a transactionProposal response from all the peers
Performs a chaincode transaction
Parameters
transactionId
string The id of the transactiontransactionRequest
TransactionRequest an object representing an transaction requestwaitOpts
WaitOpts
Returns Promise<SendTransactionResponse> A promise containing an object that contains information about the transaction
Registers a chaincode event listener. Note this is not channel specific!
Parameters
eventName
string The name of the event to listen ononEvent
Function Callback function for matched events. It gets passed a single parameter which is a ChaincodeEvent objectonError
Function Callback function to be notified when this event hub is shutdown. The shutdown may be caused by a network error or by a call to the "disconnect()" method or a connection error.
Returns {eventHubManager: EventHubManager, handle: Object} eventHubManager and handle
Class representing a user and also a wrapper over FabricClient
Parameters
opts
any The options for creating a UserClientopts.client
FabricClient The FabricClient object to wrapopts.mspId
string The MSP ID of the organisation the user is attached toopts.cryptoSuite
CryptoSuite The cryptoSuite for the useropts.store
KeyValueStore? The store which the user's credentials are stored inopts.fabricCAClient
FabricCAClient? The FabricCAClient to use for registering usersopts.enrollmentSecret
string? The enrollment secret for the useropts.roles
Array<string>? The set of roles for the user
Gets the underlying FabricClient instance
Returns FabricClient
Gets the mspId for the user's organisation
Returns string
Gets the cryptoSuite for the user
Returns CryptoSuite
Gets the store for the user
Returns KeyValueStore
Gets the username of the user
Returns string
Gets the roles of the user
Sets the roles of the user, also saves user to store
Parameters
Gets the FabricCAClient for the user
Returns FabricCAClient
Sets the FabricCAClient for the user
Parameters
fabricCAClient
FabricCAClient The FabricCAClient for the CA the user is associated with
Gets the enrollment secret for the user
Returns string?
Sets the Enrollment secret for the user
Parameters
enrollmentSecret
string The FabricCAClient for the CA the user is associated with
Creates an EventHubPeer object
Parameters
opts
{requestUrl: string, eventUrl: string, peerOpts: ConnectionOpts, eventHubOpts: ConnectionOpts, role: (string | void)}requestUrl
the peer url to make requests toeventUrl
the peer url to listen to for eventsconnectionOpts
ReducedConnectionOpts The options for connecting to the peers request urlconnectionOpts.request-timeout
number? An integer value in milliseconds to be used as maximum amount of time to wait on the request to respond.connectionOpts.pem
string The certificate file, in PEM format, to use with the gRPC protocol (that is, with TransportCredentials). Required when using the grpcs protocol.connectionOpts.ssl-target-name-override
string Used in test environment only, when the server certificate's hostname (in the 'CN' field) does not match the actual host endpoint that the server process runs at, the application can work around the client TLS verify failure by setting this property to the value of the server certificate's hostnameconnectionOpts.null
any - ANY OTHER PROPERTY. Any other standard grpc call options will be passed to the grpc service calls directly
Returns Peer a new EventHubPeer instance
This method registers a new user in the CA, requires an admin of the CA
Parameters
registerRequest
RegisterRequest The register request
Returns Promise<string> The enrollment secret to use when this user enrolls
Extracts the protobuf 'ConfigUpdate' object out of the 'ConfigEnvelope' object that is produced by the configtxgen tool. The returned object may then be signed using the signChannelConfig() method of this class. Once the all signatures have been collected, the 'ConfigUpdate' object and the signatures may be used on the createChannel() or updateChannel() calls.
Parameters
channelEnvelope
Array<byte> The encoded bytes of the ConfigEnvelope protobuf
Returns Array<byte> Channel Config object
Channel configuration updates can be sent to the orderers to be processed. The orderer enforces the Channel creation or update policies such that the updates will be made only when enough signatures from participating organizations are discovered in the request. Typically channel creation or update requests must be signed by participating organizations' ADMIN principals, although this policy can be customized when the consortium is defined. This method uses the client instance's current signing identity to sign over the configuration bytes passed in, and returns the signature that is ready to be included in the configuration update protobuf message to send to the orderer.
Parameters
channelConfig
Array<byte> The channel configuration to sign
Returns ConfigSignature The signature of the user on the config bytes
Returns a new TransactionID object. Fabric transaction ids are constructed as a hash of a nonce concatenated with the signing identity's serialized bytes. The TransactionID object keeps the nonce and the resulting id string bundled together as a coherent pair.
Returns TransactionID
Queries the target peer for the names of all the channels that a peer has joined.
Parameters
peer
Peer
Queries the installed chaincodes on a peer.
Parameters
peer
Peer
Queries for various useful information on the state of the Channel (height, known peers).
Parameters
Queries the ledger on the target peer for instantiated chaincodes on this channel.
Parameters
Queries the ledger on the target peer for Transaction by id.
Parameters
Returns whether a chaincode has been installed on all supplied peers owned by the clients organization
Parameters
Returns whether a channel has been created
Parameters
channel
Channel
Returns whether a channel has been joined by all peers owned by the clients organization in the channel object
Parameters
channel
Channel
Returns whether a chaincode has been instantiated on a channel
Parameters
Creates a channel instance bound to the user
Parameters
channel
Channel the channel object to use
Returns Channel The new bound channel instance
Gets the genesis block for the channel
Parameters
channel
Channel The channel object to use
Initializes a channel
Parameters
channel
Channel The channel object to use
Calls the orderer to start building the new channel. A channel typically has more than one participating organizations. To create a new channel, one of the participating organizations should call this method to submit the creation request to the orderer service. Once the channel is successfully created by the orderer, the next step is to have each organization's peer nodes join the channel, by sending the channel configuration to each of the peer nodes. The step is accomplished by calling the joinChannel() method.
Parameters
channel
Channel The channel object to userscreateChannelRequest
any The options for building a new channel on the networkcreateChannelRequest.envelope
Array<byte>? The envelope for the new channel, required if no config is specifiedcreateChannelRequest.config
Array<byte>? The configuration for the new channel, required if no envelope is specifiedcreateChannelRequest.signatures
Array<ConfigSignature>? The signatures required for the new channel, required if no envelope is specifiedcreateChannelRequest.txId
TransactionID? TransactionID object with the transaction id and nonce. One will be generated automatically if not supplied
Returns Promise<{data: Object, wait: WaitCreateChannel}> Promise containing the status of the create channel order, note that the wait function returns the genesis block
Calls the orderer to update an existing channel. After the channel updates are successfully processed by the orderer, the orderer cuts a new block containing the new channel configuration and delivers it to all the participating peers in the channel.
Parameters
channel
Channel The channel object to usersupdateChannelRequest
any The options for updating a channel on the networkupdateChannelRequest.envelope
Array<byte>? The envelope for the updated channel, required if no config is specifiedupdateChannelRequest.config
Array<byte>? The configuration for the updated channel, required if no envelope is specifiedupdateChannelRequest.signatures
Array<ConfigSignature>? The signatures required for the updated channel, required if no envelope is specifiedupdateChannelRequest.txId
TransactionID? TransactionID object with the transaction id and nonce. One will be generated automatically if not supplied
waitOpts
any The options for the wait functionwaitOpts.disable
boolean Disables wait function. Enable if you do not want to listen to peers for confirmation (optional, defaultfalse
)waitOpts.timeout
number Max time to wait for peers (optional, default60000
)waitOpts.targets
Array<Peer>? The peers to use, defaults to peers used for the function the wait is attached to
Returns Promise<{data: Object, wait: WaitSimple}> Promise containing the status of the update channel order
This method sends a join channel proposal to one or more endorsing peers.
Parameters
channel
Channel The channel object to usejoinChannelRequest
any The options for joining the channeljoinChannelRequest.targets
Array<Peer>? An array of Peer objects or Peer names that will be asked to join this channel.joinChannelRequest.genesisBlock
Block? The genesis block for the channeljoinChannelRequest.txId
TransactionID? TransactionID object with the transaction id and nonce. One will be generated automatically if not supplied
timeout
number? A number indicating milliseconds to wait on the response before rejecting the promise with a timeout error. This overrides the default timeout of the Peer instance and the global timeout in the config settings.
Returns Promise<{data: Array<ProposalResponse>, wait: WaitTimeout}> a promise containing an array of proposal response objects
In fabric v1.0, a chaincode must be installed and instantiated before it can be called to process transactions. Chaincode installation is simply uploading the chaincode source and dependencies to the peers. This operation is "channel-agnostic" and is performed on a peer-by-peer basis. Only the peer organization's ADMIN identities are allowed to perform this operation.
Parameters
chaincodeInstallRequest
ChaincodeInstallRequest The chaincode install request to be madechaincodeInstallRequest.targets
Array<Peer> An array of Peer objects that the chaincode will be installed onchaincodeInstallRequest.chaincodePath
string The path to the location of the source code of the chaincode. If the chaincode type is golang, then this path is the fully qualified package name, such as 'mycompany.com/myproject/mypackage/mychaincode'chaincodeInstallRequest.chaincodeId
string Name of the chaincodechaincodeInstallRequest.chaincodeVersion
string Version string of the chaincode, such as 'v1'chaincodeInstallRequest.chaincodePackage
string? Byte array of the archive content for the chaincode source. The archive must have a 'src' folder containing subfolders corresponding to the 'chaincodePath' field. For instance, if the chaincodePath is 'mycompany.com/myproject/mypackage/mychaincode', then the archive must contain a folder 'src/mycompany.com/myproject/mypackage/mychaincode', where the GO source code resides.chaincodeInstallRequest.chaincodeType
string? Type of chaincode. One of 'golang', 'car' or 'java'. Default is 'golang'. Note that 'java' is not supported as of v1.0.
timeout
number? A number indicating milliseconds to wait on the response before rejecting the promise with a timeout error. This overrides the default timeout of the Peer instance and the global timeout in the config settings.
Returns Promise<{data: ProposalResponseObject}> a promise containing a proposal response object
Sends a chaincode instantiate proposal to one or more endorsing peers. A chaincode must be instantiated on a channel-by-channel basis before it can be used. The chaincode must first be installed on the endorsing peers where this chaincode is expected to run
Parameters
channel
Channel The channel to usechaincodeInstantiateRequest
FcwChaincodeInstantiateUpgradeRequest The chaincode instantiation request to be madechaincodeInstantiateRequest.targets
(Array<Peer> | Policy)? An array of Peer objects that are used to satisfy the instantiation policy or a policy used to select peers from the channel. If targets is not specified Defaults to channel peers if not specifiedchaincodeInstantiateRequest.chaincodeId
string Name of the chaincodechaincodeInstantiateRequest.chaincodeVersion
string Version string of the chaincode, such as 'v1'chaincodeInstantiateRequest.txId
TransactionID? TransactionID object with the transaction id and nonce. One will be generated automatically if not suppliedchaincodeInstantiateRequest.chaincodeType
string? Type of chaincode. One of 'golang', 'car' or 'java'. Default is 'golang'. Note that 'java' is not supported as of v1.0.chaincodeInstantiateRequest.transientMap
Map? Map that can be used by the chaincode during intialization, but not saved in the ledger. Data such as cryptographic information for encryption can be passed to the chaincode using this techniquechaincodeInstantiateRequest.fcn
string? The function name to be returned when calling stub.GetFunctionAndParameters() in the target chaincode. Default is 'init'chaincodeInstantiateRequest.args
Array<string>? Array of string arguments to pass to the function identified by the fcn valuechaincodeInstantiateRequest.endorsement-policy
Policy? EndorsementPolicy object for this chaincode (see examples below). If not specified, a default policy of "a signature by any member from any of the organizations corresponding to the array of member service providers" is used. WARNING: The default policy is NOT recommended for production, because this allows an application to bypass the proposal endorsement and send a manually constructed transaction, with arbitrary output in the write set, to the orderer directly. An application's own signature would allow the transaction to be successfully validated and committed to the ledger.
timeout
number A number indicating milliseconds to wait on the response before rejecting the promise with a timeout error. (optional, default60000
)
Returns Promise<{data: ProposalResponseObject, wait: WaitSendTransaction}> a promise containing a ProposalResponseObject
Sends a chaincode upgrade proposal to one or more endorsing peers. A chaincode must be instantiated on a channel-by-channel basis before it can be used. The chaincode must first be installed on the endorsing peers where this chaincode is expected to run
Parameters
channel
Channel The channel to usechaincodeUpgradeRequest
FcwChaincodeInstantiateUpgradeRequest The chaincode upgrade request to be madechaincodeUpgradeRequest.chaincodeId
string Name of the chaincodechaincodeUpgradeRequest.chaincodeVersion
string Version string of the chaincode, such as 'v1'chaincodeUpgradeRequest.txId
TransactionID? TransactionID object with the transaction id and nonce. One will be generated automatically if not suppliedchaincodeUpgradeRequest.chaincodeType
string? Type of chaincode. One of 'golang', 'car' or 'java'. Default is 'golang'. Note that 'java' is not supported as of v1.0.chaincodeUpgradeRequest.transientMap
Map? Map that can be used by the chaincode during intialization, but not saved in the ledger. Data such as cryptographic information for encryption can be passed to the chaincode using this techniquechaincodeUpgradeRequest.fcn
string? The function name to be returned when calling stub.GetFunctionAndParameters() in the target chaincode. Default is 'init'chaincodeUpgradeRequest.args
Array<string>? Array of string arguments to pass to the function identified by the fcn valuechaincodeUpgradeRequest.endorsement-policy
Policy? EndorsementPolicy object for this chaincode (see examples below). If not specified, a default policy of "a signature by any member from any of the organizations corresponding to the array of member service providers" is used. WARNING: The default policy is NOT recommended for production, because this allows an application to bypass the proposal endorsement and send a manually constructed transaction, with arbitrary output in the write set, to the orderer directly. An application's own signature would allow the transaction to be successfully validated and committed to the ledger.
timeout
number A number indicating milliseconds to wait on the response before rejecting the promise with a timeout error. (optional, default60000
)
Returns Promise<{data: ProposalResponseObject, wait: WaitSendTransaction}> a promise containing a ProposalResponseObject
Sends a Transaction Proposal to peers in a channel
Parameters
channel
Channel The channel object to usetransactionProposalRequest
FcwTransactionProposalRequest The arguments for the transaction proposal requesttransactionProposalRequest.chaincodeId
string The id of the channeltransactionProposalRequest.targets
(Array<Peer> | Policy)? The peers to use for the transaction proposal or endorsement policy for the chaincode, falls back to the peers in the channel if unspecifiedtransactionProposalRequest.txId
TransactionID? TransactionID object with the transaction id and nonce. One will be generated automatically if not suppliedtransactionProposalRequest.fcn
string? The function to be called on the chaincode, defaults to 'invoke'transactionProposalRequest.args
Array<string>? The arguments to suppied to the chaincode functiontransactionProposalRequest.transientMap
string? Map that can be used by the chaincode during intialization, but not saved in the ledger. Data such as cryptographic information for encryption can be passed to the chaincode using this technique
timeout
number A number indicating milliseconds to wait on the response before rejecting the promise with a timeout error. (optional, default60000
)
Returns Promise<SendTransactionProposalResponse> A promise containing the transaction ID and transaction request objects
Sends a Transaction to peers in a channel
Parameters
channel
Channel The channel object to usetransactionId
string The transaction ID to wait ontransactionRequest
TransactionRequest An object containing the proposal responses from the peers and the proposalwaitOpts
WaitOpts
Returns Promise<SendTransactionResponse> A promise containing the response to the transaction
Sends a Transaction Proposal to a peer in the channel and formats the response
Parameters
channel
Channel The channel object to usequeryChaincodeRequest
QueryChaincodeRequest The arguments for the transaction proposal requestqueryChaincodeRequest.chaincodeId
string The id of the channelqueryChaincodeRequest.target
Peer? The peers to use for the transaction proposal, falls back to the peers in the channel if unspecifiedqueryChaincodeRequest.txId
TransactionID? TransactionID object with the transaction id and nonce. One will be generated automatically if not suppliedqueryChaincodeRequest.fcn
string? The function to be called on the chaincode, defaults to 'invoke'queryChaincodeRequest.args
Array<string>? The arguments to suppied to the chaincode functionqueryChaincodeRequest.transientMap
string? Map that can be used by the chaincode during intialization, but not saved in the ledger. Data such as cryptographic information for encryption can be passed to the chaincode using this technique
timeout
number A number indicating milliseconds to wait on the response before rejecting the promise with a timeout error. (optional, default60000
)
Returns Promise<QueryChaincodeResponse> A formatted proposal response from a single peer
Sends a Transaction Proposal to peers in a channel and formats the response
Parameters
channel
Channel The channel object to usetransactionProposalRequest
TransactionProposalRequest The arguments for the transaction proposal requesttransactionProposalRequest.chaincodeId
string The id of the channeltransactionProposalRequest.targets
(Array<Peer> | Policy)? The peers to use for the transaction proposal or endorsement policy for the chaincode, falls back to the peers in the channel if unspecifiedtransactionProposalRequest.txId
TransactionID? TransactionID object with the transaction id and nonce. One will be generated automatically if not suppliedtransactionProposalRequest.fcn
string? The function to be called on the chaincode, defaults to 'invoke'transactionProposalRequest.args
Array<string>? The arguments to suppied to the chaincode functiontransactionProposalRequest.transientMap
string? Map that can be used by the chaincode during intialization, but not saved in the ledger. Data such as cryptographic information for encryption can be passed to the chaincode using this technique
timeout
number A number indicating milliseconds to wait on the response before rejecting the promise with a timeout error. (optional, default60000
)waitOpts
WaitOpts
Returns Promise<InvokeChaincodeResponse> An object holding the transaction response, transaction proposal response, and transaction ID
A class that manages an EventHub and when it is connected
Parameters
eventHub
EventHub The EventHub to manage
Gets the underlying EventHub
Returns EventHub
Waits until the EventHub has been connected
Parameters
timeout
number The maximum amount of time to wait for the EventHub to connect (optional, default60000
)
Connects Eventhub if it is not connected and registers a listener to receive all block events from all the channels that the target peer is part of. The listener's "onEvent" callback gets called on the arrival of every block. If the target peer is expected to participate in more than one channel, then care must be taken in the listener's implementation to differentiate blocks from different channels. See the example below on how to accomplish that. An error may be thrown by this call if no "onError" callback is provided and this EventHub has noticed that the connection has not been established. However since the connection establishment is running asynchronously, a register call could be made before this EventHub has been notified of the network issue. The best practice would be to provide an "onError" callback to be notified when this EventHub has an issue.
Parameters
onEvent
Function Callback function that takes a single parameter of a Block objectonError
Function Optional callback function to be notified when this event hub is shutdown. The shutdown may be caused by a network error or by a call to the "disconnect()" method or a connection error.onConnectError
Function
Returns number
Connects Eventhub if it is not connected and registers a listener to receive chaincode events. An error may be thrown by this call if no "onError" callback is provided and this EventHub has noticed that the connection has not been established. However since the connection establishment is running asynchronously, a register call could be made before this EventHub has been notified of the network issue. The best practice would be to provide an "onError" callback to be notified when this EventHub has an issue.
Parameters
ccId
string Id of the chaincode of interesteventName
string The exact name of the chaincode event (must match the name given to the target chaincode's call to stub.SetEvent(name, payload)), or a regex string to match more than one event by this chaincodeonEvent
Function Callback function for matched events. It gets passed a single parameter which is a ChaincodeEvent objectonError
Function Optional callback function to be notified when this event hub is shutdown. The shutdown may be caused by a network error or by a call to the "disconnect()" method or a connection error.onConnectError
Function
Returns Object
Connects Eventhub if it is not connected and register a callback function to receive a notification when the transaction by the given id has been committed into a block. An error may be thrown by this call if no "onError" callback is provided and this EventHub has noticed that the connection has not been established. However since the connection establishment is running asynchronously, a register call could be made before this EventHub has been notified of the network issue. The best practice would be to provide an "onError" callback to be notified when this EventHub has an issue.
Parameters
txId
string Transaction id stringonEvent
Function Callback function that takes a parameter of type Transaction, and a string parameter which indicates if the transaction is valid (code = 'VALID'), or not (code string indicating the reason for invalid transaction)onError
Function Optional callback function to be notified when this event hub is shutdown. The shutdown may be caused by a network error or by a call to the "disconnect()" method or a connection error.onConnectError
Function
Returns string
Unregister the block event listener using the block registration number that is returned by the call to the registerBlockEvent() method. If there are no more listeners, it disconnects the EventHub
Parameters
handle
number block registration number that was returned during registration.
Unregister the chaincode event listener represented by the listener_handle object returned by the registerChaincodeEvent() method. If there are no more listeners, it disconnects the EventHub
Parameters
handle
Object The handle object returned from the call to registerChaincodeEvent.
Unregister transaction event listener for the transaction id. If there are no more listeners, it disconnects the EventHub
Parameters
txId
string The transaction ID
Extends Peer
A fabric-client Peer with additional MSP information
Type: Object
Gets the role of the peer
Sets the role of the peer
Parameters
role
string The role of the peer
Gets the Peer's organization's MSP ID
Gets an array of MSP ID's for organizations that have admin priviledges over the peer
Extends FcwPeer
A fabric-client Peer with additional MSP information and an EventHubManager
Type: Object
Gets the Peer's EventHubManager
Returns EventHubManager The Peer's EventHubManager
Extends FcwChannel
A fabric-client Channel with additional MSP information and an EventHubManager
Type: Object
Gets the Channel's EventHubManager
Returns EventHubManager The Channel's EventHubManager
Checks whether the eventHubManager can currently connect
Parameters
timeout
number (optional, default60000
)
Returns Promise<boolean> true if the channel can connect, false otherwise
Upgrades a fabric-client Peer with additional MSP information
Parameters
peer
Peeropts
any The options for upgrading the Peeropts.mspId
string The MSP ID of the organization the peer belongs toopts.adminMspIds
Array<string>? An Array of MSP ID's for organizations that have admin priviledges over the peer. Defaults to the peer's organization's mspId.opts.role
string The role of the Peer. Defaults to member (optional, default'member'
)
Returns FcwPeer The FcwPeer
Creates a fabric-client Peer with additional MSP information
Parameters
opts
any The options for creating the FcwPeeropts.requestUrl
string The URL to issue requests to the Peer withopts.peerOpts
ConnectionOpts The options for connecting to the peer's request urlopts.mspId
string The MSP ID of the organization the peer belongs toopts.adminMspIds
Array<string>? An Array of MSP ID's for organizations that have admin priviledges over the peer. Defaults to the peer's organization's mspId.opts.role
string The role of the Peer. Defaults to member (optional, default'member'
)
Returns FcwPeer The FcwPeer
Checks whether an object is a FcwPeer
Parameters
obj
any The object to check
Returns boolean true if the object is a FcwPeer, false otherwise
Upgrades a FcwPeer with an EventHubManager
Parameters
fcwPeer
Peeropts
Object The options for upgrading the FcwPeer or the EventHubManager to useopts.client
(FabricClient | UserClient)? The Client/UserClient tied to the user that creates the EventHubopts.eventUrl
string? The URL to listen to events from the Peer withopts.eventHubOpts
ConnectionOpts? The options for connecting to the peers event urlopts.eventHubManager
EventHubManager? The eventHubManager to use, required if eventUrl and eventHubOpts aren't specified
Returns EventHubPeer The EventHubPeer
Upgrades a fabric-client Peer with additional MSP information and an EventHubManager
Parameters
peer
Peeropts
EventHubPeerOpts The options for upgrading the Peeropts.mspId
string The MSP ID of the organization the peer belongs toopts.adminMspIds
Array<string>? An Array of MSP ID's for organizations that have admin priviledges over the peer. Defaults to the peer's organization's mspId.opts.role
string The role of the Peer. Defaults to member (optional, default'member'
)opts.client
(FabricClient | UserClient)? The Client/UserClient tied to the user that creates the EventHubopts.eventUrl
string? The URL to listen to events from the Peer withopts.eventHubOpts
ConnectionOpts? The options for connecting to the peers event urlopts.eventHubManager
EventHubManager? The eventHubManager to use, required if eventUrl and eventHubOpts aren't specified
Returns EventHubPeer The EventHubPeer
Creates a fabric-client Peer with additional MSP information and an EventHubManager
Parameters
opts
NewEventHubPeerOpts The options for creating the EventhHubPeeropts.requestUrl
string The URL to issue requests to the Peer withopts.peerOpts
ConnectionOpts The options for connecting to the peer's request urlopts.mspId
string The MSP ID of the organization the peer belongs toopts.role
string The role of the Peer. Defaults to member (optional, default'member'
)opts.adminMspIds
Array<string>? An Array of MSP ID's for organizations that have admin priviledges over the peer. Defaults to the peer's organization's mspId.opts.client
(FabricClient | UserClient)? The Client/UserClient tied to the user that creates the EventHubopts.eventUrl
string? The URL to listen to events from the Peer withopts.eventHubOpts
ConnectionOpts? The options for connecting to the peers event urlopts.eventHubManager
EventHubManager? The eventHubManager to use, required if eventUrl and eventHubOpts aren't specified
Returns EventHubPeer The EventHubPeer
Checks whether an object is a EventHubPeer
Parameters
obj
any The object to check
Returns boolean true if the object is a EventHubPeer, false otherwise
Upgrades a Channel with an EventHubManager
Parameters
channel
Channelopts
(EventHubManager | Object) The options for upgrading the Channel or an EventHubManageropts.client
(FabricClient | UserClient) The Client/UserClient tied to the user that creates the EventHubopts.eventUrl
string The URL to listen to events from the Channel withopts.eventHubOpts
ConnectionOpts The options for connecting to the event url
fcwChannel
Channel
Returns EventHubChannel The EventHubChannel
Creates a fabric-client Channel and adds an EventHubManager
Parameters
opts
any The options for creating the EventhHubChannelopts.client
(FabricClient | UserClient) The Client/UserClient tied to the user that creates the EventHubopts.eventUrl
string The URL to listen to events from the Channel withopts.eventHubOpts
ConnectionOpts The options for connecting to the channels event urlopts.requestUrl
string The URL to issue requests to the Channel withopts.channelOpts
ConnectionOpts The options for connecting to the channel's request urlopts.channelName
opts.peers
opts.orderers
opts.eventHubManager
Returns EventHubChannel The EventHubChannel
Checks whether an object is a EventHubChannel
Parameters
obj
any The object to check
Returns boolean true if the object is a EventHubChannel, false otherwise
Creates a new OrganizationConfig that's based on a file based key value store
Parameters
keyValueStorePath
string a path that will be used for the key value store
Returns Promise<CryptoStore> an object holding information about a organization
Creates a new OrganizationConfig that's based on a CouchDB key value store
Parameters
url
string The CouchDB instance url, in the form of http(s)://:@host:portdbName
string? Identifies the name of the database to use. (optional, default'member_db'
)
Returns Promise<CryptoStore> an object holding information about a organization
Creates a new UserClient from a public private key pair
Parameters
opts
any The options to create the user withopts.username
string The username of the useropts.cryptoContent
IdentityPEMs The public/private key pair for the useropts.mspId
string The MSP ID that the user belongs toopts.cryptoSuite
CryptoSuite The CryptoSuite to use to create the useropts.store
KeyValueStore? The store to persist the user information inopts.roles
Array<string>? An array containing the roles that the user has
Returns Promise<UserClient> A promise containing a new UserClient instance
Creates a new UserClient from enrolling in the CA
Parameters
opts
any The options to create the user withopts.fabricCAClient
FabricCAClient The FabricCAClient to use to interact with the CAopts.enrollmentID
string The username to enroll withopts.enrollmentSecret
string The secret to enroll withopts.username
string? The username to use for the user, defaults to enrollmentIDopts.mspId
string The MSP ID that the user belongs toopts.cryptoSuite
CryptoSuite The CryptoSuite to use to create the useropts.store
KeyValueStore? The store to persist the user information inopts.roles
Array<string>? An array containing the roles that the user has
Returns Promise<UserClient> A promise containing a new UserClient instance
Creates a new UserClient from registering and enrolling in the CA
Parameters
opts
any The options to create the user withopts.userClient
UserClient The UserClient to register and enroll withopts.mspId
string? The MSP ID that the user belongs to. Fallsback to userClient's MSP IDopts.username
string? The username to use for the user, defaults to enrollmentIDopts.cryptoSuite
CryptoSuite The CryptoSuite to use to create the useropts.store
KeyValueStore? The store to persist the user information inopts.roles
Array<string>? An array containing the roles that the user hasopts.registerRequest
RegisterRequest The request arguments to register the user with
Returns any A promise containing a new UserClient instance
Creates a new UserClient from the key value store
Parameters
opts
any The options to create the user withopts.userClient
UserClient? The UserClient to use to retrieve the user.opts.username
string The username of the useropts.mspId
string The MSP ID that the user belongs toopts.cryptoSuite
CryptoSuite? The CryptoSuite to use to create the user. Fallsback to the userClient's CryptoSuiteopts.store
KeyValueStore? The store to persist the user information in. Fallsback to the userClient's KeyValueStoreopts.roles
Array<string>? An array containing the roles that the user hasopts.cryptoContent
IdentityPEMs The public/private key pair for the user
Returns Promise<UserClient> A promise containing a new UserClient instance
Picks peers from a larger set that satisfy an endorsement policy
Parameters
peers
Array<Peer> the larger set of peers to pick frompolicy
Policy the endorsment policy to satisfy
Returns Array<Peer> An array of Peers that satisfy the policy
Options to create a EventHubChannel
Type: Object
Properties
channelName
string The name of the channelclient
(FabricClient | UserClient)? The client context to use for operationspeers
Array<Peer>? An array of peers to use for channel operationsorderers
Array<Orderer> The orderers to use for the channeleventUrl
string? The URL to listen to events from the Channel witheventHubOpts
ConnectionOpts? The options for connecting to the event urleventHubManager
EventHubManager? The eventHubManager to use, required if eventUrl and eventHubOpts aren't specified
A set of objects and configuration used by/representing the organization
Type: Object
Properties
cryptoSuite
CryptoSuite An abstraction over crytpographic algorithmsstore
KeyValueStore A key value store used to store user credentials
Response to an chaincode invoke
Type: {data: {transactionResponse: {status: string}, proposalResponse: {status: number, message: string, payload: Buffer}, transactionId: string}, wait: Function?}
Properties
data
{transactionResponse: {status: string}, proposalResponse: {status: number, message: string, payload: Buffer}, transactionId: string}data.transactionResponse
{status: string}data.transactionResponse.status
stringdata.proposalResponse
{status: number, message: string, payload: Buffer}data.proposalResponse.status
numberdata.proposalResponse.message
stringdata.proposalResponse.payload
Bufferdata.transactionId
stringwait
Function?
Response to a chaincode query
Type: {data: {status: number, message: string, payload: Buffer}}
Properties
data
{status: number, message: string, payload: Buffer}data.status
numberdata.message
stringdata.payload
Buffer
Response to sending a chaincode transaction proposal
Type: {data: {txId: TransactionID, transactionRequest: TransactionRequest}}
Properties
data
{txId: TransactionID, transactionRequest: TransactionRequest}data.txId
TransactionIDdata.transactionRequest
TransactionRequest
Response to sending a chaincode transaction
Type: {data: {status: string}, wait: Function?}
Properties
Type: Function
Parameters
opts
Options for wait functionopts.targets
Array<Peer>? The peers to use, defaults to peers used for the function the wait is attached toopts.race
boolean Option to only wait for a single peer (optional, defaultfalse
)opts.pollInterval
number Time between polls (optional, default1000
)opts.timeout
number? Max time to wait for peers. Defaults to 10 Minutes for instantiate/upgrade chaincode operations, 1 minute for all other operations
Returns Promise<any> Resolves once peer(s) have responded
Type: Function
Parameters
opts
Options for wait function
Returns any Resolves once peer(s) have responded
Type: Function
Parameters
opts
Options for wait function
Returns any Resolves once peer(s) have responded
Type: Function
Returns any Resolves once peer(s) have responded
Type: Function
Parameters
opts
Options for wait function
Returns any The genesis block of the channel. Resolves once peer(s) have responded
fabric-client FabricClient class see Client
fabric-client Peer class see Peer
fabric-client Channel class see Channel
fabric-client Orderer class see Orderer
fabric-client EventHub class see EventHub
fabric-ca-client FabricCAClient class see FabricCAClient
fabric-client KeyValueStore object see KeyValueStore
fabric-client CryptoSuite object see CryptoSuite
fabric-client ConnectionOpts object see ConnectionOpts
fabric-client Policy object see the endorsement policy example listed here https://fabric-sdk-node.github.io/global.html#ChaincodeInstantiateUpgradeRequest
fabric-client IdentityPEMs object see IdentityPEMs
fabric-client ProposalResponse object see https://fabric-sdk-node.github.io/global.html#ProposalResponse
fabric-client ProposalResponseObject object see https://fabric-sdk-node.github.io/global.html#ProposalResponseObject
fabric-client Block object see https://fabric-sdk-node.github.io/global.html#Block
fabric-client TransactionRequest object see TransactionRequest
fabric-ca-client RegisterRequest object see RegisterRequest