How do i add images in Hyperledger

+1 vote
I am trying to make a registry based on hyperperledger with composer .

1- How to integrate image upload with hyperledger Fabric and Composer and How to create smart contract for the registry
Aug 10, 2018 in Blockchain by Shashank
• 10,400 points
776 views

1 answer to this question.

0 votes

You can not directly add an image to the Hyperledger. To add an image to the Hyperledger Blockchain, you need to first convert the image into a Base64 string. 

You can do the conversion using the following code:

fs.readFileSync(‘yourimageFile.jpg’).toString(‘base64’);

And then when the image is converted to the string, store it on the Blockchain like you would usually store any other string.

You can refer to the following links to know more:

https://www.thepolyglotdeveloper.com/2016/02/convert-an-uploaded-image-to-a-base64-string-in-node-js/

https://belltane.wordpress.com/2017/03/27/storing-images-in-hyperledger-fabric-blockchain/

answered Aug 10, 2018 by Omkar
• 69,210 points

Related Questions In Blockchain

0 votes
1 answer

How do i add images in hyperledger?

In your registry, you can Base64-ify your ...READ MORE

answered Aug 21, 2018 in Blockchain by Perry
• 17,100 points
370 views
+4 votes
2 answers

How do I create a new block in Hyperledger Fabric?

This link might help you: https://github.com/hyperledger/fabric-sample ...READ MORE

answered Oct 11, 2018 in Blockchain by Sahu
2,351 views
+1 vote
1 answer

How do i change the names of validating peers in IBM Bluemix blockchain?

IBM Bluemix Blockchain service Hyperledger Fabric v0.6 will ...READ MORE

answered Apr 11, 2018 in Blockchain by Perry
747 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,237 views
+1 vote
1 answer

I am unable to change port of composer-rest-server. Please help!

Use full format for running a business ...READ MORE

answered Mar 27, 2018 in Blockchain by Christine
• 15,790 points
960 views
+1 vote
1 answer
+3 votes
4 answers

How do I add a new node on a Hyperledger network?

You can do this by generating the crypto ...READ MORE

answered Apr 7, 2018 in Blockchain by Christine
• 15,790 points
4,932 views
+15 votes
5 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP