Testnet CLI usage questions

Using the ./scripts/cli/start_cli_testnet.sh Libra commands:

  1. So it seems client.mnemonic is the wallet and created/saved automatically only for the first account created. Is this correct? When I go back in to the CLI, I need to reload the client.mnemonic.

  2. If I lose the client.mnemonic file, but know the account addresses, is there a way to get them back into a wallet? or are the accounts permanently lost? Is there a way to recover them using say a private key?

  3. How can I see all the transactions received by an account. It seems only the send accounts increment their sequence numbers. So if I send Libra from Alice to Bob, the transaction sequence gets incremented for Alice, but not for Bob. Why is that?

1 Like

Hi @wyattbiker, answers below:

  1. client.mnemonic essentially contains the seeds for account generation. So if you start up using the same client.mnemonic as previous runs of the client, then when you do “account create”, you’ll get the same accounts in the same order. So if you created 5 accounts on one run, kill the client, then create 5 accounts again, you’ll get the same 5 accounts in the same order on the second time.

  2. If you knew the private key, you could in theory load it back, but the current client code doesn’t support this

  3. To see transactions received by an account, you’ll want to query for events on the account. So for example:

libra% q ev 1 received 0 true 10

Getting events by account and event type.
EventWithProof {
transaction_version: 278704,
event_index: 1,
…

You can see the transaction versions from this query and then query the transactions you are interested in.

1 Like