rinkeby truffle-migration – Truffle migrate to rinkeby fails with insufficient gas price

rinkebytruffle-migration

I'm trying to migrate my contracts to rinkeby using truffle (truffle migrate --network rinkeby), but it keeps telling me that I don't have enough funds:

Using network 'rinkeby'.

Running migration: 1_initial_migration.js Deploying Migrations…
… undefined Error encountered, bailing. Network state unknown.
Review successful transactions manually. Error: insufficient funds for
gas * price + value

Here's my truffle.js:

module.exports = {
  networks: {
    rinkeby: {
      network_id: 4,
      host: '10.21.0.94',
      port: 8545,
      gas: 4000,
      gasPrice: 200000,
      from:  "0x852c1e19114b1ff775c59a61b345cc839f3307fd"
    }
  }
};

The "from" address has 3ETH, this should be more than enough.

UPDATE: I tried to switch to a local light node running geth --networkid=4 --syncmode=light --datadir . --rpc --rpcapi="eth,web3,personal,net" (on Windows), but still get either insufficient funds or exceeds block gas limit error.

Best Answer

You can determine the current GasLimit for Rinkeby by visiting Rinkeby Blocks and look into the GasLimit Column. In Truffle, your gas should below this value.

With the GasPrice, you can control how quickly a Miner will take your transaktion. The higher the value, the faster your transaction is included in a Block.

For me, these values are a good fit:

"gas":      6500000,
"gasPrice": 100000000000
Related Topic