src/main/java/hlf/java/rest/client/service/impl/GatewayBuilderSingleton.java
/**
   * Create the gateway connection for connecting to the peer.
   *
   * @return gateway Gateway object to connect to Fabric network
   * @throws IOException
   */
Create the gateway connection for connecting to the peer.
@return gateway Gateway object to connect to Fabric network
@throws IOException
Create the gateway connection for connecting to the peer . @return gateway Gateway object to connect to Fabric network @throws IOException
private Gateway createGatewayConnection() throws IOException {
    Wallet wallet = obtainWallet();
    Path networkConfigPath =
        Paths.get(
            applicationProperties.getOrgConnectionConfigPath(),
            applicationProperties.getOrgConnectionConfigFilename());
    Gateway.Builder builder = Gateway.createBuilder();
    builder
        .identity(wallet, applicationProperties.getWalletClientUserName())
        .networkConfig(networkConfigPath)
        .discovery(true);
    return builder.connect();
  }
private Gateway createGatewayConnection ( ) throws IOException { Wallet wallet = obtainWallet ( ) ; Path networkConfigPath = Paths . get ( applicationProperties . getOrgConnectionConfigPath ( ) , applicationProperties . getOrgConnectionConfigFilename ( ) ) ; Gateway . Builder builder = Gateway . createBuilder ( ) ; builder . identity ( wallet , applicationProperties . getWalletClientUserName ( ) ) . networkConfig ( networkConfigPath ) . discovery ( true ) ; return builder . connect ( ) ; }
Create the gateway connection for connecting to the peer.
Create the gateway connection for connecting to the peer .
// Load the Network Connection Configuration path // Create the gateway builder based on the path to the org configuration file // using the specified user, then connect