This question already has an answer here:

When I enter truffle console and start interacting with the deployed contract truffle uses the first address, how to change the address for testing ?

user@user:~/workspace/smart-contract$ truffle console 

truffle(ganache)> setAddress("0x0000000....); // how to set the addres ? 

marked as duplicate by Ismael, Briomkez, Richard Horrocks, shane, Rosco Kalis Jan 18 at 15:38

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Edit the truffle.js file for truffle to use some address other than the default address which just happens to be the first address in your Ganache blockchain. You can do that by assigning any available ganache address to the from property in the file.

  • do you actually mean truffle-config.js ? here is the configuration and it doesn't work: advanced: {port: 7545, network_id: 5777,gas: 8500000,sent with each transaction (default: ~6700000) gasPrice: 20000000000, // 20 gwei (in wei) (default: 100 gwei) from: "0xf1174C51Bf83fD36fB2E6Eec4A469Db879A6aa94", // Account to send txs from (default: accounts[0]) websockets: true // Enable EventEmitter interface for web3 (default: false) } – Adelin Jan 17 at 11:44

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