-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add attachments to blockchain payload #35
Comments
There are several ways of handling documents on the blockchain. If the documents (and I mean that generically, PDF, MP3, WAV, MP4 and so on) are large, then it is likely that the documents should remain remote and that the smart contract should be working with the documents' identities (URL plus Hash). This has pitfalls of course, in that the hash should be calculated by the contract but there is some complexity involved with making that deterministic (so that all endorsers calculate the same responses). Using an external hash calculation can work as well, but introduces the need to trust the system that calculates the has of the document as much as the blockchain is trusted. The second method for smaller documents is to embed a complete into a transaction that stores it in world state. The document should be compressed and then encoded to a textual format (e.g. base64). But you would have to test this pretty thoroughly to see how well the v1 fabric handles bulk data into world state. |
@kletkeman Thanks for the very early response! |
Let me know how you get along on that score. 500KB might be a bit much, but time will tell. You only need to write that once per doc to the database, after that you can simply update its metadata as needed. |
I have tested successfully posting 650KB of uncompressed base64 string(the pdf document) in the blockchain payload. It worked! I think the actual document will be <250KB. |
I would like my use case to have the ability to have PDF documents present in the blockchain payload.
How to achieve this?
Appreciate an early response. Many Thanks.
The text was updated successfully, but these errors were encountered: