0

I work with Truffle and Ganache along side Windows Powershell. Here, Truffle's default account is account[0]. I deploy my contract with that. After a while, i need to interact with the contract with account[1]. So, i should switch Truffle's default account from account[0] to account[1]. Please guide me to do that .Please note that there is no app.js or Nodejs and i need do that in Powershell. Thank you so much.

2

First of all, you can always specify the account with which you want to interact with the contract, using the from keyword, e.g., instance.someFunction({from: accounts[0]}).
Second, you can edit the default address in the truffle-config.js file at networks.advanced.from, which equals to accounts[0] per default.

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.