forked from aws-samples/non-profit-blockchain
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
32 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ If the file has values for all keys, source it: | |
source ~/peer-exports.sh | ||
``` | ||
|
||
## Step 1 - copy the chaincode into the CLI container | ||
## Step 1 - Copy the chaincode into the CLI container | ||
|
||
The Fabric CLI container that is running on your Fabric client node (do `docker ps` to see it) | ||
mounts a folder from the Fabric client node EC2 instance: /home/ec2-user/fabric-samples/chaincode. | ||
|
@@ -57,7 +57,7 @@ mkdir -p ./fabric-samples/chaincode/ngo | |
cp ./non-profit-blockchain/ngo-chaincode/src/* ./fabric-samples/chaincode/ngo | ||
``` | ||
|
||
## Step 2 - install the chaincode on your peer | ||
## Step 2 - Install the chaincode on your peer | ||
|
||
Notice we are using the `-l node` flag, as our chaincode is written in Node.js. | ||
|
||
|
@@ -74,7 +74,7 @@ Expected response: | |
2018-11-15 06:39:47.636 UTC [chaincodeCmd] install -> INFO 004 Installed remotely response:<status:200 payload:"OK" > | ||
``` | ||
|
||
## Step 3 - instantiate the chaincode on the channel | ||
## Step 3 - Instantiate the chaincode on the channel | ||
|
||
``` | ||
docker exec -e "CORE_PEER_TLS_ENABLED=true" -e "CORE_PEER_TLS_ROOTCERT_FILE=/opt/home/taiga-tls.pem" -e "CORE_PEER_LOCALMSPID=$MSP" -e "CORE_PEER_MSPCONFIGPATH=$MSP_PATH" -e "CORE_PEER_ADDRESS=$PEER" cli peer chaincode instantiate -o $ORDERER -C mychannel -n ngo -v v0 -c '{"Args":["init"]}' --cafile /opt/home/taiga-tls.pem --tls | ||
|
@@ -89,7 +89,7 @@ instantiated once on a channel) | |
2018-11-15 06:41:02.847 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc | ||
``` | ||
|
||
## Step 4 - query the chaincode | ||
## Step 4 - Query the chaincode | ||
|
||
Query all donors | ||
``` | ||
|
@@ -101,7 +101,7 @@ Query a specific donor | |
docker exec -e "CORE_PEER_TLS_ENABLED=true" -e "CORE_PEER_TLS_ROOTCERT_FILE=/opt/home/taiga-tls.pem" -e "CORE_PEER_ADDRESS=$PEER" -e "CORE_PEER_LOCALMSPID=$MSP" -e "CORE_PEER_MSPCONFIGPATH=$MSP_PATH" cli peer chaincode query -C mychannel -n ngo -c '{"Args":["queryDonor","{\"donorUserName\": \"edge\"}"]}' | ||
``` | ||
|
||
## Step 5 - invoke a transaction | ||
## Step 5 - Invoke a transaction | ||
|
||
``` | ||
docker exec -e "CORE_PEER_TLS_ENABLED=true" -e "CORE_PEER_TLS_ROOTCERT_FILE=/opt/home/taiga-tls.pem" -e "CORE_PEER_ADDRESS=$PEER" -e "CORE_PEER_LOCALMSPID=$MSP" -e "CORE_PEER_MSPCONFIGPATH=$MSP_PATH" cli peer chaincode invoke -C mychannel -n ngo -c '{"Args":["createDonor","{\"donorUserName\": \"edge\", \"email\": \"[email protected]\", \"registeredDate\": \"2018-10-22T11:52:20.182Z\"}"]}' -o $ORDERER --cafile /opt/home/taiga-tls.pem --tls | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ cd ~ | |
git clone https://github.com/aws-samples/non-profit-blockchain.git | ||
``` | ||
|
||
## Step 1 - install Node | ||
## Step 1 - Install Node | ||
On the Fabric client node. | ||
|
||
Install Node.js. We will use v8.x. | ||
|
@@ -43,15 +43,15 @@ Amazon Linux seems to be missing g++, so: | |
sudo yum install gcc-c++ -y | ||
``` | ||
|
||
## Step 2 - install dependencies | ||
## Step 2 - Install dependencies | ||
On the Fabric client node. | ||
|
||
``` | ||
cd ~/non-profit-blockchain/ngo-rest-api | ||
npm install | ||
``` | ||
|
||
## Step 3 - generate a connection profile | ||
## Step 3 - Generate a connection profile | ||
On the Fabric client node. | ||
|
||
The REST API needs a connection profile to connect to the Fabric network. Connection profiles describe | ||
|
@@ -131,7 +131,7 @@ config.json should look something like this: | |
} | ||
``` | ||
|
||
## Step 4 - run the REST API Node.js application | ||
## Step 4 - Run the REST API Node.js application | ||
On the Fabric client node. | ||
|
||
Run the app (in the background if you prefer): | ||
|
@@ -142,7 +142,7 @@ nvm use lts/carbon | |
node app.js & | ||
``` | ||
|
||
## Step 5 - test the REST API | ||
## Step 5 - Test the REST API | ||
On the Fabric client node. | ||
|
||
Once the app is running you can register an identity, and then start to execute chaincode | ||
|
@@ -190,7 +190,7 @@ response: | |
{"docType":"donor","donorUserName":"edge","email":"[email protected]","registeredDate":"2018-10-22T11:52:20.182Z"} | ||
] | ||
``` | ||
## Step 6 - load the workshop test data | ||
## Step 6 - Load the workshop test data | ||
|
||
Loading the test data uses cURL commands similar to those you used above to test the API. You can | ||
use the same endpoint (i.e. localhost), since you will load the test data from the Fabric client node, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters