1

Here is my truffle-config.js

networks: {
 ropsten: {
  network_id: 3,
  host: '127.0.0.1',
  port: 8545,
  gas: 4000000,
  from: "address_in_metamask"
},

I ran a geth node using the command:

geth --cache=1048 --testnet --unlock "address_in_metamask" --rpc --rpcapi "eth,net,web3" --rpccorsdomain '*' --rpcaddr localhost --rpcport 8545

After this in another tab, I ran the command

truffle migrate --network ropsten

I expected the smart contract to be deployed. But then I get the message as

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.


Migrations dry-run (simulation)
===============================
> Network name:    'ropsten-fork'
> Network id:      3
> Block gas limit: 0x1e8480


1_initial_migration.js
======================

Deploying 'Migrations'
----------------------
Error: Error: Error:  *** Deployment Failed ***

"Migrations" -- sender account not recognized.

at Object.run 
(/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle- 
migrate/index.js:84:1)
at process._tickCallback (internal/process/next_tick.js:68:7)
Truffle v5.0.18 (core: 5.0.18)
Node v10.16.0

I have given the correct account address from Metamask which has enough ethers, yet it's not working. Please help.

Thank you.

1

3 Answers 3

0

In many cases I've found that the truffle-hdwallet-provider version causes various issues.

You can try updating your version to [email protected].

Do npm install [email protected]. It might be due to various dependency conflict issues.

3
  • i want to do it without hdwallet Jul 21, 2019 at 17:01
  • truffle-hdwallet is a provider. You need some sort of provider to connect with the eth node. You can use the WebSocketProvider.
    – Tirtha
    Jul 22, 2019 at 3:50
  • I am trying to deploy the same way as it is given here - (ethereum.stackexchange.com/questions/26365/…). @Tirtha can you please tell where is the catch? I am new to this. Thank you. Jul 24, 2019 at 1:57
0

It may not be what you're hoping but Truffle Teams can deploy your contract to any Ethereum network without needing to install truffle-hdwallet-provider. Truffle Teams will interact with your Metamask account.

0

There is a simple workaround to deploy a smart contract on Kovan or on the Ropsten network with the help of remix and metamask.

First, go to metamask and choose Ropsten network or Kovan network.

Second, Write your smart contract on remix, and go to the run tab and deploy it with the ropsten network.

Third, Copy the transaction hash and contract address from the console of Remix. As shown in the below image.

https://i.stack.imgur.com/geyh3.png

Forth, Go to your build/contracts/file.json and paste this under the networks

"networks": {
"3": {
  "events": {},
  "links": {},
  "address": "PASTE CONTRACT HASH",
  "transactionHash": "PASTE TRANSACTION HASH"
}   },

Note: Every time you make any change to smart contract, You will have to follow the same process again.

If you don't have the JSON file in build/contracts then first create it by "truffle migrate"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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