I have a small contract

pragma solidity ^0.4.17;

contract A10test{
 mapping(uint=>string) public data;
 uint public revisionNo=0;

 function setdata(string _data) public {
     data[revisionNo] = _data;
     revisionNo =revisionNo+1;

I'm trying to save a file of 3MB in data using setdata. I have edited the go-ethereum/core/tx_pool.go ==> tx.Size() > 10000000*1024 to accommodate large transactions.

I'm able to do 2-3 transactions of 3MB, when I start a new chain and then I receive an error

"error invalid json rpc response:"""

and my transactions do not reach geth. Small transactions <100kb still works fine.

I'm using Truffle,web3 and truffle-hdwallet-provider to send transactions

Plz help

solution if some one is reading it now Changing geth version from 1.8.20 to 1.8.02 solves the problem

  • 1
    Why would you even save such ammounts of data on ethereum, the cost for it is insane. Consider using IPFS for big ammounts of data.
    – Maxpeinas
    Dec 17, 2018 at 1:48
  • I have found that if I make a new contract, I can send 2 strings of 3MB and then start receiving the same error "error invalid json rpc response:"""
    – ahmed
    Dec 17, 2018 at 5:02
  • @Maxpeinas This is private chain so cost is not an issue and it is recquirment of my project.
    – ahmed
    Dec 17, 2018 at 5:04
  • @ahmed Ethereum blockchain was not designed for storing large amounts of data. For example web3js will require data to be supplied in hexa which is wasteful for such purpose.
    – Ismael
    Dec 18, 2018 at 6:03
  • @Ismael your are right but the waste of resource is currently not my concern. Can you please suggest any solution for my actual problem?
    – ahmed
    Dec 18, 2018 at 8:21


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.