trufflesuite / truffle

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
14.02k stars 2.31k forks source link

Truffle migrate --network kovan hangs #2084

Closed Harkiran1251 closed 5 years ago

Harkiran1251 commented 5 years ago

Issue

when i try to migrate my smart contracts to test network kovan ,it just hangs with initial dry run.

Steps to Reproduce

truffle migrate --network kovan

Expected Behavior

it should deploy the smart contracts to the test network

Actual Results

I used truffle-hdwallet-provider-privkey n truffle-config.js file. -----------truffle-config.js---------------- require('babel-register'); require('babel-polyfill'); require('dotenv').config(); const HDWalletProvider=require('truffle-hdwallet-provider-privkey'); const privateKeys=process.env.PRIVATE_KEYS || ""

// const HDWalletProvider = require('truffle-hdwallet-provider'); // const infuraKey = "fj4jll3k....."; // // const fs = require('fs'); // const mnemonic = fs.readFileSync(".secret").toString().trim();

module.exports = {

networks: {

 development: {
host: "127.0.0.1",     // Localhost (default: none)
  port: 7545,            // Standard Ethereum port (default: none)
  network_id: "*",       // Any network (default: none)
},
kovan:{
      provider:function(){
        return new HDWalletProvider(
          //private key
          privateKeys.split(','),`https://kovan.infura.io/v3/${process.env.INFURA_API_KEY}`
          )
      },
      gas:5000000,
      gasPrice:25000000000,
      network_id:42,
}

}, contracts_directory:'./src/contracts/', contracts_build_directory:'./src/abis/',

// Set default mocha options here, use special reporters etc. mocha: { // timeout: 100000 },

// Configure your compilers compilers: { solc: { // version: "0.5.1", // Fetch exact version from solc-bin (default: truffle's version) // docker: true, // Use "0.5.1" you've installed locally with docker (default: false) // settings: { // See the solidity docs for advice about optimization and evmVersion optimizer: { enabled: true, runs: 200 // }, // evmVersion: "byzantium" // } } } } }

it just hangs till eternity.----the outpu ton my console appears like this!!! Compiling .\src\contracts\Token.sol... Writing artifacts to .\src\abis

⚠️ Important ⚠️ If you're using an HDWalletProvider, it must be Web3 1.0 enabled or your migration will hang.

Migrations dry-run (simulation)

Network name: 'kovan-fork' Network id: 42 Block gas limit: 8000000

1_initial_migration.js

Deploying 'Migrations'

account: 0x3b1ec43669dC9427115b1FcC27481faccf383De0 balance: 2.9932523 gas used: 269908 gas price: 25 gwei value sent: 0 ETH total cost: 0.0067477 ETH


Total cost: 0.0067477 ETH

2_deploy_contracts.js

Deploying 'Token'

account: 0x3b1ec43669dC9427115b1FcC27481faccf383De0 balance: 2.97053045 gas used: 908874 gas price: 25 gwei value sent: 0 ETH total cost: 0.02272185 ETH

Deploying 'Exchange'

account: 0x3b1ec43669dC9427115b1FcC27481faccf383De0 balance: 2.910281725 gas used: 2409949 gas price: 25 gwei value sent: 0 ETH total cost: 0.060248725 ETH


Total cost: 0.082970575 ETH

Summary

Total deployments: 3 Final cost: 0.089718275 ETH

Environment

eggplantzzz commented 5 years ago

Hey @Harkiran1251, could you upgrade your version of Truffle to the latest (v.5.0.21)? Also, could you try using truffle-hdwallet-provider? I've had people have some problems with the package you are using in the past (it is not ours) and I'm not too familiar with how it works. truffle-hdwallet-provider does allow you to pass in your private keys as the first argument when instantiating it. You can find the docs here.

Harkiran1251 commented 5 years ago

Hey @Harkiran1251, could you upgrade your version of Truffle to the latest (v.5.0.21)? Also, could you try using truffle-hdwallet-provider? I've had people have some problems with the package you are using in the past (it is not ours) and I'm not too familiar with how it works. truffle-hdwallet-provider does allow you to pass in your private keys as the first argument when instantiating it. You can find the docs here.

hello @eggplant!! before i could try doing anything,my screen prompts me to install scrypt. and this throws big time errors .i can't install scrypt@3.0.6 and it has issues like "TRACKER : error TRK0005: Failed to locate: "CL.exe" . The system cannot find the file specified. [C:\Users..\blockcha in-developer\node_modules\scrypt\build\copied_files.vcxproj]"

eggplantzzz commented 5 years ago

@Harkiran1251 Can you give me some more details about what you did when you received that error? And you are still using the versions specified in your original post?

eggplantzzz commented 5 years ago

@Harkiran1251 Are you still having trouble with this?

Harkiran1251 commented 5 years ago

Yes.My truffle version is already 5.Still facing same issues.

On Wed 28 Aug, 2019, 11:44 PM tyler feickert, notifications@github.com wrote:

@Harkiran1251 https://github.com/Harkiran1251 Are you still having trouble with this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/trufflesuite/truffle/issues/2084?email_source=notifications&email_token=AMGFJOE6AL36U2IMKTI66ULQG26BTA5CNFSM4HVP2P52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5MAFIY#issuecomment-525861539, or mute the thread https://github.com/notifications/unsubscribe-auth/AMGFJOAIBCYS4XY6ZLIG3ITQG26BTANCNFSM4HVP2P5Q .

eggplantzzz commented 5 years ago

Ok then I'm assuming you are stuck having problems installing truffle-hdwallet-provider? Like I said, don't use truffle-hdwallet-provider-privkey as I have encountered a lot of people having issues with it.

Harkiran1251 commented 5 years ago

No.truffle hd wallet provider is also installed properly.i am not able to figure out what is going wrong .

On Thu 29 Aug, 2019, 9:49 PM tyler feickert, notifications@github.com wrote:

Ok then I'm assuming you are stuck having problems installing truffle-hdwallet-provider? Like I said, don't use truffle-hdwallet-provider-privkey as I have encountered a lot of people having issues with it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/trufflesuite/truffle/issues/2084?email_source=notifications&email_token=AMGFJOCG6KCP7RDIZWKE3XTQG7ZHZA5CNFSM4HVP2P52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5PBJAI#issuecomment-526259329, or mute the thread https://github.com/notifications/unsubscribe-auth/AMGFJOFTTE6CWM4AOM5BUGTQG7ZHZANCNFSM4HVP2P5Q .

eggplantzzz commented 5 years ago

Can you describe the error and precisely what you are doing to get the error?

eggplantzzz commented 5 years ago

Closing for issue maintenance. Please let us know if you want us to re-open it and troubleshoot further! Thanks!