When I create public getters (committed code), my contract exceeds code size limit

0 votes

I am pushing JSONs received from various services in the contract as well as final quote/price. The contract doesn't calculate anything, it just records every step of the pricing workflow unique to a primary customer.
The issue is that the data structures are large and I need all the info in the ledger. However, I can't do automatic public getter as it cannot accommodate more than 7 items in structure.
When I create public getters (committed code), my contract exceeds the code size limit. What should be my solution?

 

Dec 31, 2018 in Blockchain by slayer
• 29,240 points
23 views

1 answer to this question.

0 votes

Are you pushing info one by one or in a batch? I suggest you to push in a batch to reduce the amount of gas charged, in doing so you need to store the transactions temporary in a DB (MYSQL DB) and then push the same into Blockchain. Pushing info into ledger then gets easy, call web3 API and push the info that's it.

answered Dec 31, 2018 by Omkar
• 68,180 points

Related Questions In Blockchain

0 votes
1 answer

How can I deploy a HelloWorld contract on my testrpc network?

The problem lies in the command: truffle migrate Your truffle migrate command ...READ MORE

answered Apr 27, 2018 in Blockchain by Perry
• 17,090 points

edited Aug 10, 2018 by Omkar 542 views
0 votes
1 answer
0 votes
1 answer

What if Gas required in my program exceeds the limit of 3000000?

Going through your code, I noticed that  you ...READ MORE

answered May 29, 2018 in Blockchain by Perry
• 17,090 points
89 views
0 votes
1 answer

How to limit execution of smart contract only to my dapp?

You can use modifiers to do it ...READ MORE

answered Jul 17, 2018 in Blockchain by digger
• 26,600 points
25 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,810 points
186 views
+1 vote
3 answers

Removing double quotes from a string from JSON response in PHP

Just remove the json_encode call, and it should work: $resp ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 26,600 points
5,197 views
0 votes
1 answer
0 votes
1 answer

How can i import the csv/excel files into my contract and record the transaction ?

You can not directly import an excel/csv ...READ MORE

answered Apr 16 in Blockchain by Omkar
• 68,180 points
220 views