Skip to content

Commit

Permalink
FABN-1026: Add discovery 'asLocalhost' prop to TS defs
Browse files Browse the repository at this point in the history
Change-Id: I6388e16f42427a051dd8cf939151136cb44f6649
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
  • Loading branch information
bestbeforetoday committed Nov 21, 2018
1 parent e30e24e commit cf3abfd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fabric-client/lib/Channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const Channel = class {
* commit handler implementing {@link CommitHandler}.
* @property {boolean} asLocalhost - Optional. Convert discovered host addresses
* to be 'localhost'. Will be needed when running a docker composed
* fabric network on the local system.
* fabric network on the local system; otherwise should be disabled. Defaults to true.
* @property {byte[]} configUpdate - Optional. To initialize this channel with
* a serialized ConfigUpdate protobuf object.
*/
Expand Down
3 changes: 3 additions & 0 deletions fabric-network/lib/gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ const logger = require('./logger').getLogger('Gateway');
* @typedef {Object} Gateway~DiscoveryOptions
* @memberof module:fabric-network
* @property {boolean} [enabled=true] True if discovery should be used; otherwise false.
* @property {boolean} [asLocalhost=true] Convert discovered host addresses to be 'localhost'. Will be needed when
* running a docker composed fabric network on the local system; otherwise should be disabled.
*/

/**
* The gateway peer provides the connection point for an application to access the Fabric network. It is instantiated using
* the default constructor.
Expand Down
1 change: 1 addition & 0 deletions fabric-network/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface GatewayOptions {
}

export interface DiscoveryOptions {
asLocalhost?: boolean;
enabled?: boolean;
}

Expand Down
1 change: 1 addition & 0 deletions test/typescript/integration/network-e2e/invoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ test('\n\n***** Network End-to-end flow: invoke multiple transactions to move mo
const contract = await createContract(t, gateway, {
clientTlsIdentity: 'tlsId',
discovery: {
asLocalhost: true, // Redundant since discovery is disabled but ensures TS definitions are correct
enabled: false,
},
identity: 'User1@org1.example.com',
Expand Down

0 comments on commit cf3abfd

Please sign in to comment.