infuraに登録する
https://infura.io/
プロジェクトのエンドポイントをコピー
セキュリティとプライバーシーでMETAMASKのMNEMONICを取得する
$ export MNEMONIC=””
$ export INFURA_PROJECT_ID=””
$ npm install truffle-hdwallet-provider –save-dev
tuffle-config.js
L ネットワーク設定
const HDWalletProvider = require('truffle-hdwallet-provider'); rinkeby: { provider: () => { const mnemonic = process.env["MNEMONIC"] const project_id = process.env["INFURA_PROJECT_ID"] return new HDWalletProvider( mnemonic, `https://rinkeby.infura.io/v3/${project_id}` ); }, network_id: "*" }
$ truffle migrate –network rinkeby
Compiling your contracts…
===========================
> Everything is up to date, there is nothing to compile.
Network up to date.
Error: err: insufficient funds for gas * price + value: address 0x71c9f1D5bE00173ae7B774bDBE2112cdD03C5C92 have 0 want 134439500000000000 (supplied gas 6721975)
gasがないとダメって書かれてるな..
まあ なんとなく仕組みはわかった