trufflesuite / ganache

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
2.62k stars 682 forks source link

Set initial balance for public key #4468

Open matthiasgeihs opened 1 year ago

matthiasgeihs commented 1 year ago

As far as I can see, there is currently no way to set an initial balance for a given public key (not secret key). It would be great to have that option. (Otherwise we need to copy around secret keys which even for testing is not good practice, if it can be avoided.)

Any thoughts?

davidmurdoch commented 1 year ago

https://ganache.dev/#evm_setAccountBalance does that do what you want?

matthiasgeihs commented 1 year ago

Yes, it does. I forgot to mention that I would ideally want this as a command line argument.

Is there a command line argument corresponding to setAccountBalance, so that I can bootstrap a Ganache chain with a given balance for a given public key?