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
• 26,740 points
2,202 views

1 answer to this question.

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
• 69,210 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,350 points
1,709 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
• 26,740 points
2,189 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,350 points
662 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
• 26,740 points
883 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
1,706 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,238 views
+1 vote
1 answer

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

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,450 points
1,148 views
0 votes
1 answer
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
• 69,210 points
1,218 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP