From 5be62b5200c9996025e5f14427a31f62222a9398 Mon Sep 17 00:00:00 2001 From: Simon Stone Date: Mon, 10 Dec 2018 11:43:40 +0000 Subject: [PATCH] [FAB-13207] Remove incorrect discovery options The TypeScript version of the FabCar app uses a dodgy "as any" cast to get around a bug that has been fixed; turns out the wrong name was being used (should have been asLocalhost, not useLocalhost). Note, because basic-network does not use TLS, we cannot use service discovery. We can enable service discovery when we migrate FabCar to BYFN instead. Change-Id: I36dad1c8cc7380ca1123805ae3e74fe1e7665b40 Signed-off-by: Simon Stone --- fabcar/javascript/invoke.js | 2 +- fabcar/javascript/query.js | 2 +- fabcar/javascript/registerUser.js | 2 +- fabcar/typescript/src/invoke.ts | 2 +- fabcar/typescript/src/query.ts | 2 +- fabcar/typescript/src/registerUser.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fabcar/javascript/invoke.js b/fabcar/javascript/invoke.js index a46d48c80d..7e3a2aeb5a 100644 --- a/fabcar/javascript/invoke.js +++ b/fabcar/javascript/invoke.js @@ -30,7 +30,7 @@ async function main() { // Create a new gateway for connecting to our peer node. const gateway = new Gateway(); - await gateway.connect(ccp, { wallet, identity: 'user1', discovery: { useLocalhost: true } }); + await gateway.connect(ccp, { wallet, identity: 'user1', discovery: { enabled: false } }); // Get the network (channel) our contract is deployed to. const network = await gateway.getNetwork('mychannel'); diff --git a/fabcar/javascript/query.js b/fabcar/javascript/query.js index 5fc035e6a1..0014f3afc8 100644 --- a/fabcar/javascript/query.js +++ b/fabcar/javascript/query.js @@ -30,7 +30,7 @@ async function main() { // Create a new gateway for connecting to our peer node. const gateway = new Gateway(); - await gateway.connect(ccp, { wallet, identity: 'user1' }); + await gateway.connect(ccp, { wallet, identity: 'user1', discovery: { enabled: false } }); // Get the network (channel) our contract is deployed to. const network = await gateway.getNetwork('mychannel'); diff --git a/fabcar/javascript/registerUser.js b/fabcar/javascript/registerUser.js index ad916032ea..a65edd37bf 100644 --- a/fabcar/javascript/registerUser.js +++ b/fabcar/javascript/registerUser.js @@ -37,7 +37,7 @@ async function main() { // Create a new gateway for connecting to our peer node. const gateway = new Gateway(); - await gateway.connect(ccp, { wallet, identity: 'admin' }); + await gateway.connect(ccp, { wallet, identity: 'admin', discovery: { enabled: false } }); // Get the CA client object from the gateway for interacting with the CA. const ca = gateway.getClient().getCertificateAuthority(); diff --git a/fabcar/typescript/src/invoke.ts b/fabcar/typescript/src/invoke.ts index b4120df88a..c1746f65e7 100644 --- a/fabcar/typescript/src/invoke.ts +++ b/fabcar/typescript/src/invoke.ts @@ -28,7 +28,7 @@ async function main() { // Create a new gateway for connecting to our peer node. const gateway = new Gateway(); - await (gateway as any).connect(ccp, { wallet, identity: 'user1', discovery: { useLocalhost: true } }); + await gateway.connect(ccp, { wallet, identity: 'user1', discovery: { enabled: false } }); // Get the network (channel) our contract is deployed to. const network = await gateway.getNetwork('mychannel'); diff --git a/fabcar/typescript/src/query.ts b/fabcar/typescript/src/query.ts index 7598077dfb..aa8fe1ea46 100644 --- a/fabcar/typescript/src/query.ts +++ b/fabcar/typescript/src/query.ts @@ -28,7 +28,7 @@ async function main() { // Create a new gateway for connecting to our peer node. const gateway = new Gateway(); - await gateway.connect(ccp, { wallet, identity: 'user1' }); + await gateway.connect(ccp, { wallet, identity: 'user1', discovery: { enabled: false } }); // Get the network (channel) our contract is deployed to. const network = await gateway.getNetwork('mychannel'); diff --git a/fabcar/typescript/src/registerUser.ts b/fabcar/typescript/src/registerUser.ts index 3d253cf1ee..5f699c1fcb 100644 --- a/fabcar/typescript/src/registerUser.ts +++ b/fabcar/typescript/src/registerUser.ts @@ -35,7 +35,7 @@ async function main() { // Create a new gateway for connecting to our peer node. const gateway = new Gateway(); - await gateway.connect(ccp, { wallet, identity: 'admin' }); + await gateway.connect(ccp, { wallet, identity: 'admin', discovery: { enabled: false } }); // Get the CA client object from the gateway for interacting with the CA. const ca = gateway.getClient().getCertificateAuthority();