ブロックチェーンのtruffleでmigrateすると「GAS代が足りない」というエラーが出る件。
Agenda
現象
truffle(development)> migrate
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Starting migrations...
======================
> Network name: 'development'
> Network id: 5777
> Block gas limit: 6721975 (0x6691b7)
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
Error: *** Deployment Failed ***
"Migrations" could not deploy due to insufficient funds
* Account: 0xd89Bcc7B08CbBA3bC8f1E69F03DB4ac9b59aDF07
* Balance: 0 wei
* Message: Returned error: sender doesn't have enough funds to send tx. The upfront cost is: 4104360000000000 and the sender's account only has: 0
* Try:
+ Using an adequately funded account
+ If you are using a local Geth node, verify that your node is synced.
原因
ganache-cli起動時にデータ永続化の --db を指定しているため、それが影響している(と思われる。未検証)。
$ yarn ganache-cli --db ./db/ --mnemonic "xxx" --networkId 5777
対策
暫定対応として、--dbの引数を外して起動する。
$ yarn ganache-cli --mnemonic "xxx" --networkId 5777