1

While trying to deploy/migrate a dapp to Ropsten I get the following error:

C:\CrowdBank-master\CrowdBank-master>truffle.cmd migrate --reset --network ropsten
Using network 'ropsten'.

Running migration: 1_initial_migration.js
  Deploying Migrations...
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Unknown address - unable to sign transaction for this address: "0x94e1E6DbEf0936d494B7B23C47F80dfA195e28Fa"

I have created the above address (0x94e1E6DbEf0936d494B7B23C47F80dfA195e28Fa) on Metamask, it has a balance of 1 ether.

Here is how my truffle.js file looks like:

// Allows us to use ES6 in our migrations and tests.
var HDWalletProvider = require("truffle-hdwallet-provider");

var infura_apikey = "...";
var mnemonic = "...";
var address = "0x94e1E6DbEf0936d494B7B23C47F80dfA195e28Fa"

module.exports = {
   networks: {
      development: {
        host: 'localhost',
        port: 8545,
        network_id: '*' // Match any network id
      },
      ropsten: {
        provider: function() {
           return new HDWalletProvider(mnemonic, "https://ropsten.infura.io/v3/...")
           },
        network_id: 3,
        from: address,
        gas: 4000000
      }
    }
  }

Below is a link to the project, its designed for localhost, I modified the truffle.js file to deploy it on ropsten. What else do I have to do?

https://github.com/anshulshah96/LoanDe-centralised

Please help me out on this one.

  • 2
    Hey Deb, welcome to StackExchange! Although empty, it's not good practice to publish the mnemonic to your Ethereum accounts. Also, the reason Infura generates API keys is to avoid DoS attacks. You shouldn't make that public. – Paul Berg Sep 24 '18 at 10:14
  • Does the mnemonic correspond to the address? Can you try your address in all lower case? – Ismael Sep 26 '18 at 21:01
2

Well first of all, I think if you are using windows, you should be using `truffle-config.js.

If that doesn't work, try deleting the contracts in build/contracts and recompiling?

Also, in the mneomic you are including does that correspond to the correct account?

I think your address might belong to a different wallet.

When I deploy via infura, I don't include the address because I think infura will assume it is the first address in the wallet, account[0]

 rinkeby: {
  provider: new HDWalletProvider(menomic, "https://rinkeby.infura.io/" + process.env.INFURA_API_KEY),
  network_id: 4
  //gas: 7600000,
  //gasPrice: 100000000000
},
kovan: {
  provider: new HDWalletProvider(menomic, "https://kovan.infura.io/" + process.env.INFURA_API_KEY),
  network_id: 42
  //gas: 7600000,
  //gasPrice: 100000000000
},

Are you following instructions from https://truffleframework.com/tutorials/using-infura-custom-provider?

  • 1
    The issue was with the address, I removed it from the truffle.js file and added some ethers to the first account in the metamask wallet. It worked. – Deb Sep 27 '18 at 12:11
  • Good to hear :) – GrandFleet Sep 27 '18 at 18:05
  • Also if that worked, I would appreciate if you upvoted my answer, so if other people have the same problem they know to remove their address from their truffle config. – GrandFleet Sep 27 '18 at 22:51
  • 1
    My reputation is enough yet to upvote someone. sorry! – Deb Sep 28 '18 at 19:14
  • lol, upvoted you three times, well best of luck with your dapp development :) – GrandFleet Sep 29 '18 at 3:03
1

If you use Infura, you do not need Geth. By the way the issue is resolved now.

Here is the github link: https://github.com/dmajumder4292/crowdp2plending

Deployed it on Digital Ocean, here is the URL: http://139.59.20.121:8080/

0

Have you synced ropsten to your local machine? Is the address in question unlocked?

You should use probably use geth to deploy contracts to ropsten / mainnet. Can Truffle even do that? I've only ever used it to deploy to Ganache.

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.