I made four accounts and lost the passwords to the first three. I am trying to run truffle migrate, but I am worried that truffle is trying to use the first address that I created rather than the latest one for which I still have the password. How can I either:

A) Delete the first 3 addresses without the passwords


B) Set the default address to the latest one?

References to errors:

Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: authentication needed: password or unlock

You can specify the account address in truffle.js file as below:

staging: {
  host: "localhost", // Connect to geth on the specified
  port: 8545,
  from: "0x04136750a3df9f3cd19e06f60af25f596c74aa0c", // default address to use for any transaction Truffle makes during migrations
  network_id: 15,
  gas: 4700000 // Gas limit used for deploys
| improve this answer | |

As far as I know, Truffle always uses the coinbase account. You can try setting it to another account, in your case web3.miner.setEtherBase(web3.eth.accounts[3]) please report if that worked.

| improve this answer | |

You need to configure the truffle.js for giving the account to use - account will be mentioned in from paramter

networks: {
development: {
 host: "localhost",
 port: 8545,
 network_id: "*" // match any network
 live: {
 host: "", // Random IP for example purposes (do not use)
 port: 80,
 network_id: 1,        // Ethereum public network
// optional config values:
// gas
// gasPrice
// from - default address to use for any transaction Truffle makes 
              during migrations
// provider - web3 provider instance Truffle should use to talk to the 
              Ethereum network.
//          - if specified, host and port are ignored.

For each network, if unspecified, transaction options will default to the following values:

gas: Gas limit used for deploys. Default is 4712388.

gasPrice: Gas price used for deploys.Default is 100000000000 (100 Shannon).

from: From address used during migrations. Defaults to the first available account provided by your Ethereum client.

provider: Default web3 provider using host and port options: new - Web3.providers.HttpProvider("http://:")


| improve this answer | |

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.