insufficient funds for gas * price + value

Viewed 13546

I am attempting to broadcast a constructed transaction for rinkeby. Web3 seems to always return errors, sometimes for

insufficient funds for gas * price + value

and other times for

Gas limit too high

var Web3 = require("web3")
var web3 = new Web3("https://rinkeby.infura.io/TOKEN")
var privateKey =
  "PRIVATE_KEY"

var tx = {
  chainId: 4,
  from: "22dd8860db83a962e8d2ec734eae62fab63e73ae",
  gas: "128028",
  gasPrice: web3.utils.toWei("0.00000002", "ether"),
  nonce: "0x0",
  to: "0x8a09e76a5255E3d07854647f4DBef7323F98323d",
  value: web3.utils.toWei(".000001", "ether")
}

var signed = web3.eth.accounts.signTransaction(tx, privateKey)
web3.eth.sendSignedTransaction(signed.rawTransaction).then(console.log)

Unhandled rejection Error: Returned error: insufficient funds for gas * price + value

2 Answers

The error is likely due to an insufficiency of ETH in your rinkeby test-net wallet. I recommend using a faucet to add eth to the wallet.

I used this one: https://rinkebyfaucet.com/

Related