Skip to content

Commit

Permalink
Update the README for the hardware wallet based genesis templates.
Browse files Browse the repository at this point in the history
  • Loading branch information
murisi committed Jul 31, 2024
1 parent b3ad310 commit b254911
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions genesis/hardware/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
# Localnet genesis templates
# Localnet genesis templates using hardware wallet keys

This directory contains genesis templates for a local network with a single validator. The `src` directory contains generated pre-genesis wallet pre-loaded with unencrypted keys and a single validator `validator-0` wallet that are being used in the templates.
This directory contains genesis templates for a local network with a single validator. The `src` directory contains generated pre-genesis wallet pre-loaded with public keys, derivation paths, and a single validator `validator-0` wallet that are being used in the templates. Most of the keys for this network are derived from a hardware wallet configured with a specific seed phrase.

If you're modifying any of the files here, you can run this to ensure that the changes are valid:

```shell
cargo watch -x "test test_validate_localnet_genesis_templates"
```

## Reproducibility
To ensure that the key generated by the hardware wallet for a given derivation path is always the same, the hardware wallet must be configured to use a known test mnemonic. Specifically, these genesis templates were generated using the following test mnemonic: `equip will roof matter pink blind book anxiety banner elbow sun young`. Instructions on how to configure the hardware wallet with this mnemonic can be found in the `Set a test mnemonic` section of https://github.com/Zondax/ledger-namada?tab=readme-ov-file#how-to-prepare-your-development-device .
## E2E and Integration Tests
The E2E and integration tests can be made to use these hardware wallet based genesis templates by setting the environment variable `NAMADA_E2E_USE_DEVICE` to `true` when running `make test ...`. In order to ensure the success of these tests, please ensure that the following requirements are met:
* The hardware wallet is connected and the Ledger app is open for the duration of the E2E tests
* Transactions are promptly manually approved on the hardware wallet before the E2E test timeouts ellapse
* The hardware wallet is configured with the same test mnemonic used to generate these genesis templates. See [reproducibility](#reproducibility).
## pre-genesis/wallet.toml
The pre-genesis balances wallet is located at [pre-genesis/wallet.toml](pre-genesis/wallet.toml) and can be re-generated from the repo's root dir with:

```shell
cargo run --bin namadaw -- --base-dir "genesis/localnet/src" gen \
--alias albert-key --unsafe-dont-encrypt --pre-genesis
cargo run --bin namadaw -- --base-dir "genesis/localnet/src" gen \
--alias bertha-key --unsafe-dont-encrypt --pre-genesis
cargo run --bin namadaw -- --base-dir "genesis/localnet/src" gen \
--alias christel --unsafe-dont-encrypt --pre-genesis
cargo run --bin namadaw -- --base-dir "genesis/localnet/src" gen \
--alias daewon --unsafe-dont-encrypt --pre-genesis
cargo run --bin namadaw -- --base-dir "genesis/localnet/src" gen \
--alias validator-0-account-key --unsafe-dont-encrypt --pre-genesis
cargo run --bin namadaw -- --base-dir "genesis/localnet/src" gen \
cargo run --bin namadaw -- --base-dir "genesis/hardware/src" derive \
--alias albert-key --pre-genesis --use-device --hd-path "m/44'/877'/0'/0'/0'"
cargo run --bin namadaw -- --base-dir "genesis/hardware/src" derive \
--alias bertha-key --pre-genesis --use-device --hd-path "m/44'/877'/0'/0'/1'"
cargo run --bin namadaw -- --base-dir "genesis/hardware/src" derive \
--alias christel --pre-genesis --use-device --hd-path "m/44'/877'/0'/0'/2'"
cargo run --bin namadaw -- --base-dir "genesis/hardware/src" derive \
--alias daewon --pre-genesis --use-device --hd-path "m/44'/877'/0'/0'/3'"
cargo run --bin namadaw -- --base-dir "genesis/hardware/src" derive \
--alias validator-0-account-key --pre-genesis --use-device --hd-path "m/44'/877'/0'/0'/5'"
cargo run --bin namadaw -- --base-dir "genesis/hardware/src" gen \
--alias faucet-key --unsafe-dont-encrypt --pre-genesis
```

Expand Down

0 comments on commit b254911

Please sign in to comment.