I'm having issues getting any transactions to confirm on Rinkeby with geth and web3j. Question what is the best way to programmatically determine the best gas and gassLimit prices ?

Should I use the value of GassPrice returned from geth ? MyEther wallet is setting GasPrice to:41000000000 Geth api call is returning 1000000000

echo '{"jsonrpc":"2.0","method":"personal_sendTransaction","params":[{"from":"0xf1b0725bd64cbe62a5160357d53e92c54788f2e5","to":"0xB1C26AB1c159F60AFa21A7c24D313fA4aA05812F","gas":"0x6208","gasPrice":"0x3b9aca00","value":"0x470de4df820000","nonce":"0x5"},"PRIVATE_KEY"],"id":15}' | nc -U ~/Library/Ethereum/rinkeby/geth.ipc {"jsonrpc":"2.0","id":15,"result":"0x00e44a5a6f6994c9e0494be9541faea873b9234117de26c76d0dcddc3f33cb3b"}

This transaction was accepted however is not mined. The Api has gas and gasPrice, but no GassLimit value, What would be the best way to set these values to ensure this transaction is mined with out paying over the top fees ??


If you look at last outgoing transaction of the from address it has nonce equal to 0 and the transaction you are sending has nonce 5. Nonces has to be consecutive numbers starting from 0, it doesn't matter the gas price your transaction will not be mined.

Geth calculates the median price of the last blocks mined which usually is fine. If you want fast confirmation times you have to use a higher gas price.

| improve this answer | |
  • Interesting. I chose nonce 5 as there have been other transaction sent to the node already using 1,2,3, Then I get a replacement transaction error so nonce 0 but with higher fee should work ? – Abelgo Sep 12 '18 at 13:37
  • The nonce is a property of the account, to get the nonce in javascript you call web3.eth.getTransactionCount. Used nonces cannot be replaced easily, for example your transaction with nonce zero was used 5 day ago to replace it you have to mine 30k blocks, they can only be replaced reasonably when transaction is pending. – Ismael Sep 12 '18 at 15:23

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.