Hi there!
Previous version of truffle if it was necessary to deploy a renewed contract the option -f number (for example: truffle migrate -f 5 --network ropsten) worked without any problem. Now when I run this command it only calculates a price of a theoretical renewal of the contracts but doesn't deploy them at all. It seems that the truffle does not see changes in the contracts though they definitely are.
It only works when I use --reset option and deploy all contracts.
Create several contracts relate one from other. Make changes in code of contract which has to be deployed the last. Try to deploy the last contract only.
Expected a deployment of the last contract.
If I run "truffle migrate -f 5 --network ropsten" than I see that (snippet):
`
...
Replacing 'MyUpdatedContract'
account: 0xC5a3d56e05c39A18D6342B5F27c08c64a424dF00
balance: 12.03198699881262
gas used: 6010351
gas price: 8 gwei
value sent: 0 ETH
total cost: 0.048082808 ETH
Total cost: 0.048082808 ETH
Summary
Total deployments: 9
Final cost: 0.31108508 ETH
`
And that's it. No any deployment.
truffle version): v.5.0.2node --version): v.11.8.0npm --version): v.6.7.0I'm having this same issue as well. @ImmuneGit have you been able to find a solution? I'm using the same truffle version as you.
@bweick I've not been found no any solution. I've tried to delete temporary some unnecessary migration files from the migration folder but it seems that a contract works weird after deployment. For example I see 2 transactions upon a transfer token from one wallet to another (like it performs twice from both contracts - old one and a new one).
I had similar issue sometime ago and I was able to fix it adding two parameters to my network configuration.
confirmations: 2, // # of confs to wait between deployments. (default: 0)
skipDryRun: true
@robertmagier It's really works. Thank you very much!
Are both of those parameters necessary @robertmagier?
We can look into this. Thanks all!
It seems this issue came back again and those parameters do not influent at all now.
Truffle v5.0.13 (core: 5.0.13)
Solidity v0.5.0 (solc-js)
Node v11.14.0
Web3.js v1.0.0-beta.37
Did anyone stumble across this issue as well?
@robertmagier any thoughts?
@ImmuneGit , what version of truffle-hdwallet-provider are you using to deploy?
@CruzMolina
"truffle-hdwallet-provider": "^1.0.7"
@ImmuneGit Ah, there's a bug in 1.0.7, give 1.0.6 a shot 🤞
@CruzMolina Thanks a lot! It works now. 👍
@ImmuneGit Just fyi, truffle-hdwallet-provider 1.0.8 is out and it should have that bug fixed, so feel free to upgrade.
@eggplantzzz thanks... it works now with truffle-hdwallet-provider 1.0.8
I had similar issue sometime ago and I was able to fix it adding two parameters to my network configuration.
confirmations: 2, // # of confs to wait between deployments. (default: 0) skipDryRun: true(even though I am using truffle-hdwallet-provider 1.0.8 it wasn't working for me.)
I was searching so long for this, thank you! Now it works as expected.
@spazzyt you were probably seeing nasty migrations bug in a couple recent versions of truffle. give the latest release a try! (5.0.17)
I am currently using version 1.0.9 of truffle-hdwallet-provider. I also experienced the same problems that @ImmuneGit raised. I was able to solve the problem with the solution provided by @robertmagier. I hope the bug is resolved in 1.0.9 as soon as possible.
@CruzMolina
Truffle v5.0.15 (core: 5.0.15)
Solidity v0.5.0 (solc-js)
Node v11.6.0
Web3.js v1.0.0-beta.37
The environment I am using is as follows.
The same issue is occurring now.
@ethdevss to clarify my recent comment, this is a known bug in truffle 5.0.14 & 5.0.15. I believe the latest release resolved this issue. Let us know if it's still there! 🤞
@CruzMolina
I confirmed that it was successfully deployed in the release version of truffle. Thank you
Hi,
I'm trying to deploy on Ropsten truffle migrate --network ropsten and my contracts aren't deploying. Only compiling.
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.`
Truffle v5.0.24
Solidity v0.5.0
Node v11.0.0
truffle-hdwallet-provider v1.0.11
const HDWalletProvider = require('truffle-hdwallet-provider');
const fs = require('fs');
let secrets;
if (fs.existsSync('secrets.json')) {
secrets = JSON.parse(fs.readFileSync('secrets.json', 'utf8'));
}
module.exports = {
/**
* Networks define how you connect to your ethereum client and let you set the
* defaults web3 uses to send transactions. If you don't specify one truffle
* will spin up a development blockchain for you on port 9545 when you
* run `develop` or `test`. You can ask a truffle command to use a specific
* network from the command line, e.g
*
* $ truffle test --network <network-name>
*/
networks: {
// Useful for testing. The `development` name is special - truffle uses it by default
// if it's defined here and no other network is specified at the command line.
// You should run a client (like ganache-cli, geth or parity) in a separate terminal
// tab if you use this network and you must also set the `host`, `port` and `network_id`
// options below to some value.
//
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
},
// Another network with more advanced options...
// advanced: {
// port: 8777, // Custom port
// network_id: 1342, // Custom network
// gas: 8500000, // Gas sent with each transaction (default: ~6700000)
// gasPrice: 20000000000, // 20 gwei (in wei) (default: 100 gwei)
// from: <address>, // Account to send txs from (default: accounts[0])
// websockets: true // Enable EventEmitter interface for web3 (default: false)
// },
// Useful for deploying to a public network.
// NB: It's important to wrap the provider as a function.
ropsten: {
provider: () => new HDWalletProvider(secrets.mnemonic, `https://ropsten.infura.io/v3/${secrets.infuraApiKey}`),
network_id: 3, // Ropsten's id
gas: 5500000, // Ropsten has a lower block limit than mainnet
// confirmations: 2, // # of confs to wait between deployments. (default: 0)
// timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
// skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
},
// Useful for private networks
// private: {
// provider: () => new HDWalletProvider(mnemonic, `https://network.io`),
// network_id: 2111, // This network is yours, in the cloud.
// production: true // Treats this network as if it was a public net. (default: false)
// }
},
// 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: false,
// runs: 200
// },
// evmVersion: "byzantium"
// }
}
}
}
Hey @kseniya292 ! Looking into this right now 🧐
Hey @kseniya292 ! Looking into this right now 🧐
Thank you! I've been on this for a couple hours and can't figure out if I'm doing something wrong or if it's bug.
Hmm, @kseniya292 using the metacoin box (truffle unbox metacoin), and your truffle config (w/ my own mnemonic & api key), I'm able to deploy to ropsten.
Maybe there's something malformed in your secrets.json file?
@kseniya292 I'm facing the same problem. Did you resolve it?
@kseniya292 Hello. i recommended you try this method
first, delete all the contents of the build folder.
second, use this command "truffle migrate --reset --compile-all --network ropsten"
@ethdevss I tried it and, again, it wasn't deployed.
I unpacked metacoin and just added my truffle config:
require('dotenv/config')
const HDWalletProvider = require('truffle-hdwallet-provider');
module.exports = {
networks: {
rinkeby: {
provider: function () {
return new HDWalletProvider(process.env.MNEMONIC, process.env.PROVIDER);
},
network_id: 4,
gas: 4500000,
gasPrice: 10000000000,
confirmations: 2, // # of confs to wait between deployments. (default: 0)
skipDryRun: true
}
},
// Set default mocha options here, use special reporters etc.
mocha: {
// timeout: 100000
},
compilers: {
solc: {
settings: { // See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: true,
runs: 200
},
}
}
}
}
This is the terminal output:
truffle migrate --reset --compile-all --network rinkeby
Compiling your contracts...
===========================
> Compiling ./contracts/ConvertLib.sol
> Compiling ./contracts/MetaCoin.sol
> Compiling ./contracts/Migrations.sol
> Artifacts written to /Users/dominikdragicevic/projects/metacoin/build/contracts
> Compiled successfully using:
- solc: 0.5.8+commit.23d335f2.Emscripten.clang
Also, env variables are set ok. My provider is PROVIDER=https://rinkeby.infura.io/v3/myApiKey and MNEMONIC is a twelve-word list exported from Metamask
EDIT: FIXED!
I made a mistake on Infura settings page.
Under WHITELIST USER AGENTS and WHITELIST ORIGINS, I added * value. After it was removed, deploy started working.
Would be great if truffle could print some error message in that case.
Check your infura and be sure to copy the "Project ID" not the "Project Secret" since they look almost the same and you may have clicked the wrong copy button when getting the infura key. Try deleting your infura project and create a new one from the page.
I resolved the timeout by:
1) Deleting and creating the Infura project again as @merlox mentioned
2) Copying across the new Infura Project ID
3) Checking that was using the correct address (i.e. if I'm using HTTPS then the address should be https:// and shouldn't have /ws/ in it. I also checked that in the .env file, I had only the Infura Project ID for INFURA_API_KEY, instead of the whole url.
"ropsten": {
provider: () => new HDWalletProvider(process.env.MNENOMIC, "https://ropsten.infura.io/v3/" + process.env.INFURA_API_KEY),
network_id: 3,
gas: 5500000, // Ropsten has a lower block limit than mainnet
gasPrice: 10000000000,
confirmations: 2, // # of confs to wait between deployments. (default: 0)
skipDryRun: true,
networkCheckTimeout: "100000",
websockets: false
},
Hi All,
I hav the following issue while deploying.
Thank you for the help.
Everything is up to date, there is nothing to compile.
Warning: Both truffle-config.js and truffle.js were found. Using truffle-config.js.
Network name: 'development'
Network id: 1602788662894
Block gas limit: 6721975 (0x6691b7)
Deploying 'Migrations'
transaction hash: 0x39684f59b2eb70d2d60a00ceac25acf960924fa54dfe1c0ac5165e97fde5078e
Blocks: 0 Seconds: 0
contract address: 0x3C55C14778505232832112A77Dd55349Bcf12df3
block number: 9
block timestamp: 1602830423
account: 0x034d8cD3B32ae484362117a4462CAe266960Fc6D
balance: 99.4358679
gas used: 263741 (0x4063d)
gas price: 20 gwei
value sent: 0 ETH
total cost: 0.00527482 ETH
⠹ Saving migration to chain.
Error: Returned error: VM Exception while processing transaction: invalid opcode
at Migration._deploy (C:\Users\lenova\AppData\Roamingnpmnode_modules\trufflebuild\webpack:\packages\migrate\Migration.js:97:1)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at Migration._load (C:\Users\lenova\AppData\Roamingnpmnode_modules\trufflebuild\webpack:\packages\migrate\Migration.js:55:1)
at Migration.run (C:\Users\lenova\AppData\Roamingnpmnode_modules\trufflebuild\webpack:\packages\migrate\Migration.js:171:1)
at Object.runMigrations (C:\Users\lenova\AppData\Roamingnpmnode_modules\trufflebuild\webpack:\packages\migrate\index.js:150:1)
at Object.runFrom (C:\Users\lenova\AppData\Roamingnpmnode_modules\trufflebuild\webpack:\packages\migrate\index.js:110:1)
at Object.runAll (C:\Users\lenova\AppData\Roamingnpmnode_modules\trufflebuild\webpack:\packages\migrate\index.js:114:1)
at Object.run (C:\Users\lenova\AppData\Roamingnpmnode_modules\trufflebuild\webpack:\packages\migrate\index.js:79:1)
at runMigrations (C:\Users\lenova\AppData\Roamingnpmnode_modules\trufflebuild\webpack:\packages\core\lib\commands\migrate.js:269:1)
at C:\Users\lenova\AppData\Roamingnpmnode_modules\trufflebuild\webpack:\packages\core\lib\commands\migrate.js:231:1
Truffle v5.1.48 (core: 5.1.48)
Node v12.19.0
Most helpful comment
I had similar issue sometime ago and I was able to fix it adding two parameters to my network configuration.