truffleからgoerliへの接続が出来ない2
解決したのでメモ。
原因
各ソフトウェアのバージョンが古かった
指定していたニーモニックがテスト用アカウントのものではなかった
時系列
バージョンについては何となく以下に変えたらメッセージが変わった。Dockerを使っているのでFROMのイメージを変えただけ。
/work/greeter_app # truffle version
Truffle v5.4.32 (core: 5.4.32)
Solidity v0.5.16 (solc-js)
Node v15.9.0
Web3.js v1.5.3
改めてmigrateするとメッセージが変わる。
/work/greeter_app # truffle migrate --network infura
This version of µWS is not compatible with your Node.js build:
Error: node-loader:
Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /usr/local/lib/node_modules/truffle/node_modules/ganache/dist/node/20v96yRA.node)
Falling back to a NodeJS implementation; performance may be degraded.
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
WARNING: Ganache forking only supports EIP-1193-compliant providers. Legacy support for send is currently enabled, but will be removed in a future version _without_ a breaking change. To remove this warning, switch to an EIP-1193 provider. This error is probably caused by an old version of Web3's HttpProvider (or ganache < v7)
Migrations dry-run (simulation)
===============================
> Network name: 'infura-fork'
> Network id: 5
> Block gas limit: 29941438 (0x1c8debe)
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
*** Deployment Failed ***
"Migrations" could not deploy due to insufficient funds
* Account: 0x89Eff96a233eE8e39c520447a183f3403A3842cD
* Balance: 0 wei
* Message: insufficient funds for gas * price + value
* Try:
+ Using an adequately funded account
+ If you are using a local Geth node, verify that your node is synced.
〜〜略〜〜
insufficientと出ているものの6.25ETH持っているはず。よく見るとAccountのハッシュ値が想定と違う。もしやニーモニックの指定が間違っているのではないかと思ってMetaMaskで払い出し直したものをセット。
/work/greeter_app # truffle migrate --network infura
This version of µWS is not compatible with your Node.js build:
Error: node-loader:
Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /usr/local/lib/node_modules/truffle/node_modules/ganache/dist/node/20v96yRA.node)
Falling back to a NodeJS implementation; performance may be degraded.
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
WARNING: Ganache forking only supports EIP-1193-compliant providers. Legacy support for send is currently enabled, but will be removed in a future version _without_ a breaking change. To remove this warning, switch to an EIP-1193 provider. This error is probably caused by an old version of Web3's HttpProvider (or ganache < v7)
Migrations dry-run (simulation)
===============================
> Network name: 'infura-fork'
> Network id: 5
> Block gas limit: 30000000 (0x1c9c380)
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
undefined
> block number: 6330644
> block timestamp: 1644136688
> account: 0xc40057b29e74919e05864F8356caDc45ceFcb7b5
> balance: 6.249374644998249006
> gas used: 250142 (0x3d11e)
> gas price: 2.500000007 gwei
> value sent: 0 ETH
> total cost: 0.000625355001750994 ETH
-------------------------------------
> Total cost: 0.000625355001750994 ETH
〜〜略〜〜
プライベートのFullノード経由でも実行できることを確認済み。長かった。
コード
使った環境構築のコードは以下。
この記事が気に入ったらサポートをしてみませんか?