trufflesuite / truffle-hdwallet-provider

HD Wallet-enabled Web3 provider
MIT License
399 stars 167 forks source link

Always get "Insufficient funds" error, when deploy contract to kovan testnet. #56

Open micli opened 6 years ago

micli commented 6 years ago

I only have 3 kovan ethers. I just want to publish my contract to kovan testnet. But It seems I don't have enough fund to do this: $ truffle migrate --reset --network kovan Using network 'kovan'.

Running migration: 1_initial_migration.js Deploying Migrations... Error encountered, bailing. Network state unknown. Review successful transactions manually. Insufficient funds. The account you tried to send transaction from does not have enough funds. Required 672197500000000000 and got: 0.

Below is my kovan net configuration: var MNEMONIC = "XXX XXX XXX XXX";

const HDWalletProvider = require('truffle-hdwallet-provider');

const providerWithMnemonic = (mnemonic, rpcEndpoint) => new HDWalletProvider(mnemonic, rpcEndpoint);

const infuraProvider = network => providerWithMnemonic( process.env.MNEMONIC || '', https://${network}.infura.io/${process.env.INFURA_API_KEY} );

module.exports = { networks: { kovan: { provider: infuraProvider('kovan'), //gasPrice: 1000000000, network_id: 42, // eslint-disable-line camelcase }, ......

I don't know how to set my wallet and how to make contract deployment successfully. Thanks!

asoong commented 6 years ago

+1 to this

Edit: you can't deploy it this way. PTAL here on how to set up Parity and deploy via the client.