3

rinkeby にコントラクトをデプロイしようとしています。次のコマンドを使用しています。

$ truffle migrate --networks rinkeby

Compiling your contracts...
===========================
> Compiling ./contracts/Migrations.sol
> Compiling ./contracts/Voting.sol
> Artifacts written to ./public/contracts/build/
> Compiled successfully using:
   - solc: 0.5.8+commit.23d335f2.Emscripten.clang

Unknown network "ganache". See your Truffle configuration file for available networks.
Truffle v5.0.22 (core: 5.0.22)
Node v11.6.0

上記の結果に示されているように、エラーが発生するため、魔法使いganache-cliは機能しますが、rinkebyでは機能しません。Unknown network "ganache". See your Truffle configuration file for available networks

これは私のtruffle-config.jsです:

module.exports = {
  // See <http://truffleframework.com/docs/advanced/configuration>
  // to customize your Truffle configuration!
  contracts_build_directory: path.join(__dirname, "./public/contracts/build/"),
  networks: {
    development: {
      host: "127.0.0.1",
      port: 8545,
      network_id: 1000,
      gas: 4612388,
      gasPrice: 25000000000,
      total_accounts: 20,
      mnemonic
    },
    rinkeby: {
      provider: () => new HDWalletProvider(mnemonic, infuraURL),
      network_id: 4,
      gas: 4612388,
      gasPrice: 25000000000,
    },
  },
  solc: {
    optimizer: {
        enabled: true,
        runs: 200
    }
  }
};
4

1 に答える 1