Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #83 from jkneubuh/feature/bricks
Browse files Browse the repository at this point in the history
Feature/bricks
  • Loading branch information
jkneubuh authored Aug 15, 2022
2 parents 87d78d2 + f208c69 commit c6e7388
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
7 changes: 3 additions & 4 deletions applications/trader-typescript/src/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ const hostAlias = process.env.HOST_ALIAS;

export async function newGrpcConnection(): Promise<grpc.Client> {
const certPath = path.resolve(tlsCertPath ?? defaultTlsCertificate);
const tlsRootCert = await fs.promises.readFile(certPath);

if (fs.existsSync(tlsRootCert)){
if (fs.existsSync(certPath)) {
const tlsRootCert = await fs.promises.readFile(certPath);
const tlsCredentials = grpc.credentials.createSsl(tlsRootCert);
return new grpc.Client(gatewayEndpoint, tlsCredentials, newGrpcClientOptions());
return new grpc.Client(gatewayEndpoint, tlsCredentials, newGrpcClientOptions());
} else {
return new grpc.Client(gatewayEndpoint, grpc.ChannelCredentials.createInsecure());
}
Expand Down
27 changes: 7 additions & 20 deletions docs/CloudReady/40-bananas.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,44 +55,31 @@ mv $USER_MSP_DIR/keystore/*_sk $USER_MSP_DIR/keystore/key.pem

## Go Bananas

- todo: the new cert paths / npm client app are throwing an error. There may still be another ENV var necessary from the old launch
- workaround: git checkout feature/creaky from jkneubuh branch and npm install. Use the older launch vars:
```shell

export KEY_DIRECTORY_PATH=$USER_MSP_DIR/keystore/
export CERT_PATH=$USER_MSP_DIR/signcerts/cert.pem
export TLS_CERT_PATH=$PEER_MSP_DIR/tlscacerts/tlsca-signcert.pem
export PEER_HOST_ALIAS=$WORKSHOP_NAMESPACE-$ORG-peer1-peer.${WORKSHOP_INGRESS_DOMAIN}
export PEER_ENDPOINT=$PEER_HOST_ALIAS:443

```

- todo: broken - why?
- Set the gateway client to connect to the org1-peer1 as the newly enrolled `${USERNAME}`:
```shell

# Path to private key file
# export PRIVATE_KEY=${USER_MSP_DIR}/keystore/key.pem
export PRIVATE_KEY=${USER_MSP_DIR}/keystore/key.pem

# Path to user certificate file
# export CERTIFICATE=${USER_MSP_DIR}/signcerts/cert.pem
export CERTIFICATE=${USER_MSP_DIR}/signcerts/cert.pem

# Path to CA certificate
# export TLS_CERT=${PEER_MSP_DIR}/tlscacerts/tlsca-signcert.pem
export TLS_CERT=${PEER_MSP_DIR}/tlscacerts/tlsca-signcert.pem

# Gateway peer SSL host name override
# export HOST_ALIAS=${WORKSHOP_NAMESPACE}-${ORG}-peer1-peer.${WORKSHOP_INGRESS_DOMAIN}
export HOST_ALIAS=${WORKSHOP_NAMESPACE}-${ORG}-peer1-peer.${WORKSHOP_INGRESS_DOMAIN}

# Gateway endpoint
# export ENDPOINT=$HOST_ALIAS:443
export ENDPOINT=$HOST_ALIAS:443

```

```shell

pushd applications/trader-typescript

# todo: fix the launch env. This works with the npm app < 8/12
#npm install
npm install

```

Expand Down

0 comments on commit c6e7388

Please sign in to comment.