Skip to content

Commit eebff0e

Browse files
enable/disable service discovery for fabric gateway (#156)
Signed-off-by: adityajoshi12 <[email protected]>
1 parent 9aac877 commit eebff0e

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/main/java/hlf/java/rest/client/config/FabricProperties.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public class FabricProperties {
2222
"org.hyperledger.fabric.sdk.service_discovery.as_localhost";
2323

2424
private boolean localhostReportAddress;
25+
private boolean discoveryEnabled = true;
2526
private WalletConfig wallet;
2627
private OrgConnectionConfig orgConnectionConfig;
2728
private Client client;

src/main/java/hlf/java/rest/client/config/GatewayConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public Gateway gateway(Wallet wallet) throws IOException {
4848
builder
4949
.identity(wallet, fabricProperties.getWallet().getClientUser().getName())
5050
.networkConfig(networkConfigPath)
51-
.discovery(true);
51+
.discovery(fabricProperties.isDiscoveryEnabled());
5252
return builder.connect();
5353
}
5454

src/main/resources/application.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ metrics:
1616
enable: false
1717
fabric:
1818
localhostReportAddress: true
19+
discoveryEnabled: true
1920
wallet:
2021
path: wallet
2122
adminUser:

0 commit comments

Comments
 (0)