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

Commit

Permalink
Merge pull request #19 from chainstack/feature/change-paths-according…
Browse files Browse the repository at this point in the history
…-to-recent-platform-changes

Update README and paths to cryptomaterials according to recent platform changes
  • Loading branch information
zaslavskii committed Jan 26, 2021
2 parents 3a2137d + f2e29d2 commit 742b664
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Note that downloading the binaries will take some time.
In the `webapp/server/.env` file, replace the `ORDERER_NAME`, `PEER_NAME`, and `MSP_ID` variables with:
* `ORDERER_NAME` — the orderer name of the network you deployed your peer in. To access the orderer name, in the [Chainstack platform](https://console.chainstack.com/), from Hyperledger Fabric network, select **Service nodes** tab and click on **Orderer** to access its details page. Here you can copy the **Orderer name** value.
* `PEER_NAME` — the name of the peer that you deployed. To access the peer name, in the [Chainstack platform](https://console.chainstack.com/), from Hyperledger Fabric network, select **Peer nodes** tab, click on your peer name to access its details page. Here you can copy the **Peer name** value.
* `MSP_ID` — the Membership Service Provider identity (MSP ID) of the peer that you deployed. To access the MSP ID, in the [Chainstack platform](https://console.chainstack.com/), from Hyperledger Fabric network, select **Peer nodes** tab, click on your peer name to access its details page. Here you can copy the **MSP ID** value.
* `MSP_ID` — the Membership Service Provider identity (MSP ID). To access the MSP ID, in the [Chainstack platform](https://console.chainstack.com/), from Hyperledger Fabric network, click **Details** link to open network details modal. Here you can copy the **MSP ID** value.

You are now ready for the bootcamp.

Expand Down
16 changes: 10 additions & 6 deletions webapp/certs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ In the [Chainstack platform](https://console.chainstack.com/):
- Navigate to your Hyperledger Fabric network.
- Click **Details**.
- Click **Export connection profile**.
- Move the exported file to the `webapp/certs/` directory.
1. Orderer TLS certificate:
- Navigate to the Hyperledger Fabric **Service nodes** tab from the network.
- Access **Orderer**.
- Click **Export TLS certificate**.
- Click **Export**
- Unzip the downloaded folder
- Move `<Node ID>-cert.pem` file to the `webapp/certs/` directory.
1. Organization identity zip folder:
- Navigate to the Hyperledger Fabric **Peer nodes** tab from the network.
- Access your peer.
- Next to **Organization identity**, click **Export**.
- Unzip the downloaded folder.
1. Move the exported files to the `webapp/certs/` directory.
- Navigate to your Hyperledger Fabric network.
- Click **Details**.
- Access Admin identity
- Click **Export**
- Unzip the downloaded folder
- Move `msp` subdirectory to the `webapp/certs/` directory.
17 changes: 10 additions & 7 deletions webapp/server/fabric/utils/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ const generateCertPath = async () => {
MSP_ID,
PEER_NAME,
} = envfile.parseFileSync(`${rootPath}/webapp/server/.env`);
const certDirectoryPath = `${rootPath}/webapp/certs/`;
const certDirectoryPath = `${rootPath}/webapp/certs`;

const [adminFolder] = await getDirectory(`${rootPath}/webapp/certs/${MSP_ID}/users`);
const ADMIN_CERT = await getDirectory(`${rootPath}/webapp/certs/${MSP_ID}/users/${adminFolder}/msp/admincerts`).then(([certName]) => {
return `${certDirectoryPath}/${MSP_ID}/users/${adminFolder}/msp/admincerts/${certName}`;
const ADMIN_CERT = await getDirectory(`${certDirectoryPath}/msp/admincerts`).then(([certName]) => {
return `${certDirectoryPath}/msp/admincerts/${certName}`;
});
const ADMIN_PRIVATE_KEY = `${certDirectoryPath}/${MSP_ID}/users/${adminFolder}/msp/keystore/priv_sk`;
const ADMIN_PRIVATE_KEY = `${certDirectoryPath}/msp/keystore/priv_sk`;
const PEER_TLS_ROOTCERT_FILE = await getDirectory(`${certDirectoryPath}/msp/tlscacerts`).then(([certName]) => {
return `${certDirectoryPath}/msp/tlscacerts/${certName}`;
});

const ordererName = ORDERER_NAME.split('.').shift();

return ({
Expand All @@ -44,9 +47,9 @@ const generateCertPath = async () => {
ORDERER_CA: `${certDirectoryPath}/${ordererName}-cert.pem`,
ORDERER_ADDRESS: `${ORDERER_NAME}:7050`,
MSP_ID,
MSP_PATH: `${certDirectoryPath}/${MSP_ID}/users/${adminFolder}/msp`,
MSP_PATH: `${certDirectoryPath}/msp`,
PEER_ADDRESS: `${PEER_NAME}:7051`,
PEER_TLS_ROOTCERT_FILE: `${certDirectoryPath}/${MSP_ID}/peers/${PEER_NAME}/tls/ca.crt`,
PEER_TLS_ROOTCERT_FILE,
ROOT_PATH: rootPath,
});
};
Expand Down

0 comments on commit 742b664

Please sign in to comment.