How come accounts doesn't persist between runs

Every time I run


any account I created previously is gone.

I’ll need to do account create to get back any existing account.

Why is it like this?

1 Like

Hi yadakhov, please check the following post My First Transaction

1 Like

@yadakhov, you can save the accounts via the save sub-command under the account command of the CLI and then load them via the load sub-command

1 Like

Hi @yadakhov, the behavior of libra-cli may be some strange in term of wallet, behind the scene account create use /client.mnemonic that persist in your environment and use key_factory to generate your address (address, public key and private key).

You can think account create as pseudo code create_account(mnemonic, '/wallet/0') for first wallet and create_account(mnemonic, '/wallet/1') for second wallet and so on, so that’s deterministic (result is the same everytime). That why you can always get access to your address by account create again without persistence of private keys.

You can check this code for the detail