I am trying to deploy a simple contract to the Ropsten network using Truffle and Infura. I have set up the Ropsten network in the truffle-confug.js
file but it seems truffle always uses the development
network.
When I try to migrate the contract using truffle migrate --network ropsten
I see the following error:
> [email protected] truffle /home/kuzdogan/Desktop/repos/simple-eth-server
> truffle "migrate" "ropsten"
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Could not connect to your Ethereum client with the following parameters:
- host > 127.0.0.1
- port > 7545
- network_id > 5777
Please check that your Ethereum client:
- is running
- is accepting RPC connections (i.e., "--rpc" option is used in geth)
- is accessible over the network
- is properly configured in your Truffle configuration file (truffle-config.js)
Truffle v5.0.25 (core: 5.0.25)
Node v10.16.0
Here is my truffle-config.js
const config = require("./config.js")
const HDWalletProvider = require("truffle-hdwallet-provider");
module.exports = {
networks: {
ropsten: {
provider: function() {
return new HDWalletProvider(config.mnemonic, "https://ropsten.infura.io/v3/" + config.infuraKey)
},
network_id: 3
}
},
}
What I've tried so far:
- Rename
truffle-config.js
totruffle.js
- Adding a development network. Then the URLs and parameters become the same as in
truffle-config.js
file - Renaming
ropsten
network config todevelopment
. In this case themigrate
command finishes execution silently, afterEverything is up to date, there is nothing to compile.
I somehow have the feeling that the issue is with my Infura config. How can I debug this?
development
network? You don't even have this network in your Truffle configuration file, and in addition to that, even the error printout tells you that it usesropsten
.