Commit 65839d40 authored by Javier Diaz's avatar Javier Diaz
Browse files

Debugging

parent 3f9d6775
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -23,8 +23,8 @@ data:
  PEER_ENDPOINT: "10.1.1.96:7051"  #Change to required peer#
  PEER_HOST_ALIAS: "peer0.org1.adrenaline.com"
  CRYPTO_PATH: "/test-network/organizations/peerOrganizations/org1.adrenaline.com"
  KEY_DIRECTORY_PATH: "/etc/hyperledger/fabric-keystore/"
  CERT_DIRECTORY_PATH: "/etc/hyperledger/fabric-signcerts/"
  KEY_DIRECTORY_PATH: "/etc/hyperledger/fabric-keystore/keystore"
  CERT_DIRECTORY_PATH: "/etc/hyperledger/fabric-signcerts/signcerts.pem"
  TLS_CERT_PATH: "/etc/hyperledger/fabric-ca-crt/ca.crt"

---
@@ -128,9 +128,9 @@ spec:
              name: dlt-config
              key: CRYPTO_PATH
        - name: KEY_DIRECTORY_PATH
          value: "/etc/hyperledger/fabric-keystore/"
          value: "/etc/hyperledger/fabric-keystore/keystore"
        - name: CERT_DIRECTORY_PATH
          value: "/etc/hyperledger/fabric-signcerts/"
          value: "/etc/hyperledger/fabric-signcerts/signcerts.pem"
        - name: TLS_CERT_PATH
          value: "/etc/hyperledger/fabric-ca-crt/ca.crt"
      volumes:
+12 −12
Original line number Diff line number Diff line
@@ -104,23 +104,23 @@ async function newGrpcConnection(): Promise<grpc.Client> {
}

async function newIdentity(): Promise<Identity> {
    const certPath = await getFirstDirFileName(certDirectoryPath);
    console.log("DEBUG", certPath);
    const credentials = await fs.readFile(certPath);
    //const certPath = await getFirstDirFileName(certDirectoryPath);
    console.log("DEBUG", certDirectoryPath);
    const credentials = await fs.readFile(certDirectoryPath);
    return { mspId, credentials };
}

async function getFirstDirFileName(dirPath: string): Promise<string> {
    const files = await fs.readdir(dirPath);
    const filePath = path.join(dirPath, files[0]);
    const realFilePath = await fs.readlink(filePath);
    return path.join(dirPath, realFilePath);
}
//async function getFirstDirFileName(dirPath: string): Promise<string> {
 //   const files = await fs.readdir(dirPath);
 //   const filePath = path.join(dirPath, files[0]);
 //   const realFilePath = await fs.readlink(filePath);
 //   return path.join(dirPath, realFilePath);
//}

async function newSigner(): Promise<Signer> {
    const keyPath = await getFirstDirFileName(keyDirectoryPath);
    console.log("DEBUG2", keyPath);
    const privateKeyPem = await fs.readFile(keyPath);
    //const keyPath = await getFirstDirFileName(keyDirectoryPath);
    console.log("DEBUG2", keyDirectoryPath);
    const privateKeyPem = await fs.readFile(keyDirectoryPath);
    const privateKey = crypto.createPrivateKey(privateKeyPem);
    return signers.newPrivateKeySigner(privateKey);
}