Skip to content

Commit

Permalink
Delete trailing spaces
Browse files Browse the repository at this point in the history
Signed-off-by: myeongkil <clevermk7211@gmail.com>
  • Loading branch information
myeongkil committed Oct 16, 2020
1 parent c85c86f commit 912f84d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ $ npm install
$ npm run build
```

## Run Hyperledger Explorer
## Run Hyperledger Explorer

### Run Locally in Same Location

Expand All @@ -320,7 +320,7 @@ $ npm run build
```json
"sync": {
"type": "local"
}
}
```

* `npm start`
Expand All @@ -342,7 +342,7 @@ $ DISCOVERY_AS_LOCALHOST=false npm start
```json
"sync": {
"type": "host"
}
}
```
* If the Hyperledger Explorer was used previously in your browser be sure to clear the cache before relaunching
Expand Down
13 changes: 10 additions & 3 deletions app/platform/fabric/gateway/FabricGateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class FabricGateway {
defaultChannelName: string;
fabricCaEnabled: boolean;
client: any;
clientTlsIdentity: any;
FSWALLET: string;
enableAuthentication: boolean;
asLocalhost: boolean;
Expand All @@ -47,6 +48,7 @@ export class FabricGateway {
this.gateway = new Gateway();
this.fabricCaEnabled = false;
this.client = null;
this.clientTlsIdentity = false;
this.FSWALLET = null;
this.enableAuthentication = false;
this.asLocalhost = false;
Expand Down Expand Up @@ -124,8 +126,8 @@ export class FabricGateway {
if ('clientTlsIdentity' in this.config.client) {
logger.info('client TLS enabled');
const mTlsIdLabel = this.config.client.clientTlsIdentity;
const mTlsId = await this.wallet.get(mTlsIdLabel);
if (mTlsId !== undefined) {
this.clientTlsIdentity = await this.wallet.get(mTlsIdLabel);
if (this.clientTlsIdentity !== undefined) {
connectionOptions.clientTlsIdentity = mTlsIdLabel;
} else {
throw new ExplorerError(
Expand Down Expand Up @@ -374,7 +376,12 @@ export class FabricGateway {
const ds = new DiscoveryService('be discovery service', channel);

const client = new Client('discovery client');
client.setTlsClientCertAndKey();
if (this.clientTlsIdentity) {
logger.info('client TLS enabled');
client.setTlsClientCertAndKey(this.clientTlsIdentity.credentials.certificate, this.clientTlsIdentity.credentials.privateKey);
} else {
client.setTlsClientCertAndKey();
}

const mspID = this.config.client.organization;
const targets = [];
Expand Down

0 comments on commit 912f84d

Please sign in to comment.