0

There are multiple developers on the team and it seems as though we all want to be working on a specific test network with specific public and private keys with a specific number of users who all have a prespecified balance. We have chosen to work with Ganache.

Now I am aware of https://github.com/trufflesuite/ganache-cli options with --account=. This does not allow for the specification of the public key of each user. What is the standard when recreating a network? Am I missing out on something fundamental to this process? What are my options?

3
  • This does not allow for the specification of the public key of each user - no, but it allows for the specification of the private key of each user, and the public key derives from that in a (pretty much) one-to-one way. Commented Jul 24, 2020 at 13:20
  • pretty one to one way? Is that 100% correct? Do I need to modify the pneumonic to comply with this one to one mapping?
    – SDG
    Commented Jul 24, 2020 at 15:09
  • What???? Ganache creates unique accounts according to unique private keys that you provide using the --account option. What more do you want??? Commented Jul 24, 2020 at 15:42

1 Answer 1

1

Using ganache-cli, you can provide a mnemonic using the flag below, in order to produce the same pre-funded addresses and public keys every time you start ganache. The accounts flag just defines the number of accounts that you will create.

-m or --mnemonic: Use a bip39 mnemonic phrase for generating a PRNG seed, which is in turn used for hierarchical deterministic (HD) account generation.

Per the comments - the addresses and private keys generated will be one to one regardless of the mnemonic.

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.