TransWikia.com

Reproducing a Ganache Server across multiple computers

Ethereum Asked by SDG on December 30, 2021

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?

One Answer

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.

Answered by Steven V on December 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP