0

I am trying to follow these instructions.

I do not want to sync so I run

./geth-1.9.0 --maxpeers 0 console`

and do this:

FROM="0x..."
TO="0x..."
ETH_AMOUNT=0.1
NONCE=1

VALUE=web3.toWei(ETH_AMOUNT,"ether")

TX={ from: FROM, to: TO, value: VALUE, nonce: NONCE }

personal.unlockAccount(FROM)
eth.sendTransaction(TX)

I get this error

WARN [06-30|20:58:39.016] Served eth_sendTransaction               reqid=36 t=5.238384ms   err="gas required exceeds allowance (5003) or always failing transaction"
Error: gas required exceeds allowance (5003) or always failing transaction
    at web3.js:3143:20
    at web3.js:6347:15
    at web3.js:5081:36
    at <anonymous>:1:1

How do I figure out if the error is "gas required exceeds allowance" or "always failing transaction"?

How do I figure out what the required gas amount and allowance amounts are?

What went wrong?

spraff
  • 645
  • 1
  • 10
  • 22

1 Answers1

0

try to define enough gas in your TX

TX={ from: FROM, to: TO, value: VALUE, nonce: NONCE , gas: 3000000 }

keep rising the gas value until it works.

Badr Bellaj
  • 18,780
  • 4
  • 58
  • 75
  • I'm confused between "gas", "gas price", and "gas limit". ethgasstation.info says 1Gwei is "standard", you wrote 3Mwei in your example so I'm wondering if it means the same thing. Does the gas property here refer to price, limit, or something else? – spraff Jul 01 '19 at 22:00
  • gas : is The amount of gas to use for the transaction (unused gas is refunded)in other words it's the gas you'are wiling to pay for you transaction. Please check the doc https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethsendtransaction – Badr Bellaj Jul 02 '19 at 21:07
  • In many places elsewhere I read that "gasUsed=gasPrice*gas" but if unused "gas" is refunded then that usage of "gas" would seem to refer to a limit on "gasUsed" whereas "gas" in the equation would seem to refer to another kind of quantity, measured in a different dimensional unit. Right? – spraff Jul 07 '19 at 13:19
  • I mean, if "gasPrice" is measured in wei/some_unit and "gas" is measured in some_unit then "totalGas=gasPrice*gas" is measured in wei which makes sense but what on earth are the units for this "gas" parameter? Because it sure as hell isn't in wei. – spraff Jul 07 '19 at 13:23