This repository will not be updated. The repository will be kept available in read-only mode.
This code pattern is a sample auction Node.js based application that demonstrates storing base64 encoded and encrypted images on a Blockchain ledger and retrieving the same. This application launches Hyperledger Fabric network and then starts the application as a REST API server built on top of NodeSDK APIs.
Auction Blockchain Application Credits: Mohan Venkataraman, Sandeep Pulluru and Ratnakar Asara
Disclaimer: The image used in this sample demo has been downloaded from publicly available images on the internet, and the copyright belongs to the respective owners. The usage here is strictly for non-commercial purposes as sample data. We recommend that users create their own sample data as appropriate. All details used in the sample data are fictitious. The information provided in this README.md
is subject to change. Also this is based out of fabric-sample balance-transfer example.
When the reader has completed this code pattern, he or she will understand how to:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
# Place next three lines in ~/.bash_profile
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install v8.9.0
nvm use 8.9.0
Clone the SecuringArt-using-Blockchain-DigitalCertificates
repo locally. In a terminal, run:
git clone https://github.com/IBM/SecuringArt-using-Blockchain-DigitalCertificates
In one terminal launch hyperledger fabric network and Node.js application (a REST Server wrapper on top of Fabric NodeSDK api) with the following command
cd SecuringArt-using-Blockchain-DigitalCertificates
./bootstrap_app.sh
The above script bootstrap_app.sh performs the following actions:
NOTE: You may be tempted to run http://localhost:4000
at this point - please do not do that; otherwise you will get an UnauthorizedError: No authorization token was found
error. After running the bootstrap_app.sh
command, immediately go to Create the Network Channel and Invoke a Transaction and run the quicketest.sh
command.
In another terminal issue the following command from auction directory.
./quicktest.sh
The above script quicktest.sh performs the following actions:
public/images
folder.You should see similar results from running quicktest.sh
:
For all the image processing & conversion refer to the Node.js code here
Storing an image using chaincode, refer the code snippet here
Please check youtube video available here: https://goo.gl/jH1uCQ
Blockchain Code Patterns: Enjoyed this Code Pattern? Check out our other Blockchain Code Patterns
Blockchain 101: Learn why IBM believes that blockchain can transform businesses, industries – and even the world. Blockchain 101
This code pattern is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 (DCO) and the Apache Software License, Version 2.