5

I tried to upload an Image into the ledger (converted image to base64 string and passed it as an arg in the transaction ).

When i send an image of size 30 kb it worked fine , But with an 100kb image my transaction failed , stating that the max size is 102400 .

My question is what is the maximum size of the transaction and the maximum size of the Block ?

jaswanth
  • 1,759
  • 2
  • 10
  • 16

1 Answers1

2

You can configure max size in your peer configuration under block size. But you may need to configure the grpc Frame size to a bigger value so that peer should accept a message from client. By default grpc frame size is "4194304".

Here is the way we can set frame size using fabric-sdk-java

Properties peerProperties = conf.getPeerProperties(peerName);
peerProperties.put("grpc.NettyChannelBuilderOption.maxInboundMessageSize", 9999999);
dhilmathy
  • 2,800
  • 2
  • 21
  • 29
  • 1
    But keep im mind that this approach is not recommended, you should save the files outside the blockchain and keep the hashes saved in the ledger – Bassel Kh Jul 26 '18 at 16:22
  • What is the typical size of a Fabric transaction? Say my payload is just 2 or 3 variables. Eg - Banking chaincode with { Acc_no : int, Action: String, Amount: int }. The action could be deposit/withdraw. – Rajeev Ranjan May 14 '19 at 10:50
  • What is conf property and where to set this property in smart contract? – Kanzt Apr 07 '20 at 09:58