2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

truffle migrateを実行したら、insufficient fundsエラーが発生

Last updated at Posted at 2021-11-27

P84

truffle migrate --network goerliを実行して、ガス代不足でデプロイ失敗。

$ truffle migrate --network goerli

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.



Migrations dry-run (simulation)
===============================
> Network name:    'goerli-fork'
> Network id:      5
> Block gas limit: 8000000 (0x7a1200)


1_initial_migration.js
======================

   Replacing 'Migrations'
   ----------------------

Error:  *** Deployment Failed ***

"Migrations" could not deploy due to insufficient funds
   * Account:  0x357D5b3B1527f642Da8765b98b4717e907a930eC
   * Balance:  0 wei
   * Message:  sender doesn't have enough funds to send tx. The upfront cost is: 584634000000000 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.

MetaMaskを確認したら、確かにETHが入っている。やっぱり、設定などの間違いか。。。

スクリーンショット 2021-11-27 21.19.38.png

truffle-config.jsを調べたら、やっぱり、デプロイ先をローカルのGanache (http://127.0.0.1:8545) に向いている。

    goerli: {
      provider: () => {
        const mnemonic = process.env["MNEMONIC"]
        return new HDWallterProvider(mnemonic, "http://127.0.0.1:8545");
      },
      network_id: "*",
    },

MetaMaskのネットワーク設定を開き、goerliテストネットワークのRPCのURLをコピーして、GanacheのURLを置き換える。
スクリーンショット 2021-11-27 21.27.01.png

    goerli: {
      provider: () => {
        const mnemonic = process.env["MNEMONIC"]
        return new HDWallterProvider(mnemonic, "https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161");
      },
      network_id: "*",
    },

truffle migrate --network goerliを再実行、デプロイは上手くいった。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?