I'm running a private testnet with Parity, and interacting with it using a nodejs cli. I have a script with which I trigger multiple transactions in quick succession for a smart contract that I have deployed:

function sendTransactions (amount, times){
    for(i=0; i<times; i++){
       smartContract.foo.sendTransaction({from: web3.eth.accounts[0], gas:100000, value: amount});

If I submit a limited number of such transactions - say < 100 - all the transactions go through successfully. For a larger value, the nodejs cli suddenly gets disconnected after completing some initial number of transactions and displays the following error log:

Error: CONNECTION ERROR: Couldn't connect to node http://localhost:8180.
at Object.module.exports.InvalidConnection (/home/euser/node_modules/web3/lib/web3/errors.js:28:16)
at HttpProvider.send (/home/euser/node_modules/web3/lib/web3/httpprovider.js:75:22)
at RequestManager.send (/home/euser/node_modules/web3/lib/web3/requestmanager.js:58:32)
at Eth.get [as accounts] (/home/euser/node_modules/web3/lib/web3/property.js:107:62)
at Object.exports.sendOneTransaction (/home/euser/parity/scripts.parity.js:10:51)
at Object.exports.sendTransactions (/home/euser/parity/scripts.parity.js:17:13)
at Object.<anonymous> (/home/euser/parity/scripts.parity.js:55:9)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)

What can be the reason behind this behaviour?

  • Ive got the similar problem, when I send a big chunk of string I get a simmilar issue like you. Have u solved it? – Miguel Díaz Montiel May 29 '17 at 12:17
  • No I couldn't get past it Miguel. I then decided to take the JSON RPC route instead. – Vishesh Jun 15 '17 at 13:32
  • For what I read back in june, the reason that it gets disconected is because the RPC is a light weight String protocol, so large ammount of data disconects web3 – Miguel Díaz Montiel Aug 28 '17 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.