Ethereum nodejs: Unhandled rejection Error: Invalid JSON RPC response

0 votes

Is there something wrong with my command?

contract.methods.thu().send(
   { from: senderAddress, 
     gasPrice: web3.utils.toHex(GAS_PRICE), 
     gasLimit: web3.utils.toHex(GAS_LIMIT)
   }
);

When I execute it, I get this error:

Unhandled rejection Error: Invalid JSON RPC response: ""

Need to help

Oct 15, 2018 in Blockchain by digger
• 27,620 points
265 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

gasLimit is actually represented by gas as the gas limiter according to the docs: http://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#methods-mymethod-send

contract.methods.thu().send(
   { from: senderAddress, 
     gasPrice: web3.utils.toHex(GAS_PRICE), 
     gas: web3.utils.toHex(GAS_LIMIT)
   }
)

Also, it's probably best to use the parameter types of gasPrice (String) and gas (Number) from the docs.

answered Oct 15, 2018 by Omkar
• 65,850 points

Related Questions In Blockchain

0 votes
1 answer

Ethereum client-go RPC response 403 “invalid host specified”

Adding --rpcvhosts=* should solve the issue READ MORE

answered Oct 1, 2018 in Blockchain by slayer
• 29,040 points
36 views
0 votes
1 answer

NodeJS POST Request Over JSON-RPC

You're missing the --header option: curl --request POST \ ...READ MORE

answered Sep 28, 2018 in Blockchain by digger
• 27,620 points
285 views
0 votes
1 answer

Error connecting due to rpc error

In the previous version, this problem was ...READ MORE

answered Jul 6, 2018 in Blockchain by slayer
• 29,040 points
120 views
0 votes
1 answer

How to transact custom token instead of ethers using JSON rpc?

First create your custom token. Then develop ...READ MORE

answered Jul 10, 2018 in Blockchain by digger
• 27,620 points
20 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,790 points
65 views
0 votes
1 answer
0 votes
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by ariaholic
• 7,320 points
43 views
0 votes
1 answer

UnhandledPromiseRejectionWarning: Insufficient funds error in Ethereum: NodeJS web3

sendSignedTransaction returns a promiEvent onto which you can chain then and catch: web3.eth.sendSignedTransaction('0x' + ...READ MORE

answered Oct 15, 2018 in Blockchain by Omkar
• 65,850 points
88 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.