Skip to content

Commit

Permalink
Merge pull request #234 from anoma/bengt/new-wallet
Browse files Browse the repository at this point in the history
changed most namadaw functions
  • Loading branch information
bengtlofgren authored Jan 12, 2024
2 parents 258df84 + 199912c commit ab623f9
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 32 deletions.
4 changes: 2 additions & 2 deletions packages/docs/pages/introduction/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ This should sync your node to the ledger and will take a while (depending on you
First you will need an implicit account in order to receive tokens. You can generate one with:

```shell copy
namadaw address gen --alias <your-go-to-alias>
namadaw gen --alias <your-go-to-alias>
```

For the remainder of this introduction, let's assume your go-to alias is `stanley`.

This will generate a new account and store it in the default keychain. You can see the account with:

```shell copy
namadaw address list
namadaw list --addr
```

{/* #TODO: ADD some output */}
Expand Down
10 changes: 10 additions & 0 deletions packages/docs/pages/networks/testnets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ For more context read:

[Announcing Namada Public Testnets](https://blog.namada.net/announcing-namada-public-testnets/)

## Shielded expedition

The `balances.toml` file is located at `https://github.com/anoma/namada-shielded-expedition`.

- Namada Shielded expedition 1:
- From date: `TBD`
- Namada protocol version: `TBD`
- Cometbft version: `0.37.2`
- CHAIN_ID: `TBD`

## Latest Testnet
- Namada public testnet 15:
- From date: 18th of December 2023 17:00 UTC
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/pages/networks/testnets/environment-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Note that building from source can be a difficult process and is not recommended
Export the following variables:

```bash copy
export NAMADA_TAG=v0.23.1
export NAMADA_TAG=v0.29.0
```


Expand Down Expand Up @@ -66,6 +66,6 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Make sure you are using the correct CometBFT version
- `cometbft version` should output `0.37.2`
- Make sure you are using the correct Namada version
- `namada --version` should output `Namada v0.23.1`
- `namada --version` should output `Namada v0.29.0`

</Steps>
13 changes: 10 additions & 3 deletions packages/docs/pages/networks/testnets/genesis-validator-apply.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ Before a testnet launches, you can apply to be a genesis validator.
Follow [this guide](../../operators/validators/validator-setup.mdx#pre-genesis) on how to generate your "pre-genesis" validator files.

<Callout>
All pre-genesis validators are expected to bond `1000000` NAM tokens. At least that many tokens will be allocated to the pre-genesis validator key
For the shielded expedition, the `balances.toml` file has been published at the [namada-shieled-expedition repository](https://github.com/anoma/namada-shielded-expedition).
Amounts bonded in the bonding transactions must be less than or equal to the amounts specified in the `balances.toml` file.
It is recommended to leave at least 1000 `NAAN` unbonded for transaction fees.
</Callout>

After this, you'll have a signed `transactions.toml` file, the contents of which will look something like the following:
After this, you will have a signed `transactions.toml` file, the contents of which will look something like the following:

```toml
[[established_account]]
Expand Down Expand Up @@ -66,7 +68,12 @@ This file contains only public information and is safe to share publicly.


### Submitting the config
If you want to be a genesis validator for the testnet, please make a pull request to https://github.com/anoma/namada-testnets adding your signed `transactions.toml` file to the relevant directory (e.g. `namada-public-testnet-2` for the second public testnet), renaming it to `$alias.toml`.

<Callout>
For the shielded expedition, use the repository `https://github.com/anoma/namada-shielded-expedition` instead of `https://github.com/anoma/namda-testnets`.
</Callout>

If you want to be a genesis validator for the testnet, please make a pull request to `https://github.com/anoma/namada-testnets` (`https://github.com/anoma/namada-shielded-expedition` for the Shielded expedition) adding your **signed** `transactions.toml` file to the relevant directory (e.g. `namada-public-testnet-2` for the second public testnet), renaming it to `"<your-alias>"".toml`.
E.g. if you chose your alias to be "bertha", submit the file with the name `bertha.toml`. You can see what an example PR looks like [here](https://github.com/anoma/namada-testnets/pull/2616).

### Wait for the `CHAIN_ID`
Expand Down
11 changes: 11 additions & 0 deletions packages/docs/pages/networks/testnets/joining-the-testnet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Depending on whether you are a genesis validator, you can join the latest testne
## Joining as a genesis validator

In order to join the network as a genesis validator, you will need to have been selected in the genesis ceremony. If you have not been selected, you can still join as a full node.

<Callout>
For the shielded expedition, only the top 114 pilots have been selected as genesis validators. If you were not selected, you can still bond to one of the genesis validators or become a post-genesis validator.
</Callout>

If you have been selected. You must run the following command:

```bash
Expand All @@ -32,6 +37,12 @@ Running the node of a pre-genesis validator is identical to that of a mainnet va

For this reason, please refer to [these docs](../../operators/validators/validator-setup.mdx#start-validating) for running the node.

## Submitting bonding transactions as a non-genesis validator
If your public key has been allocated `NAM` (`NAAN` for the shielded expedition), you can bond to a genesis validator as a pre-genesis transaction.
Please follw the steps [here](../../operators/networks/genesis-flow/participants.mdx#bond-to-a-pre-genesis-validator-account) in order to submit these transactions.

Remember to sign these transactions as well.

## Joining as a full node
If you are not a genesis validator, please follow the steps for [joining as a full node](../../operators/ledger/running-a-full-node.mdx).

Expand Down
8 changes: 8 additions & 0 deletions packages/docs/pages/networks/testnets/testnet-history.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ This page covers all installation steps required by various upgrades to testnets

No upgrades are currently scheduled.

## Shielded expedition

- Namada Shielded expedition 1:
- From date: `TBD`
- Namada protocol version: `TBD`
- Cometbft version: `0.37.2`
- CHAIN_ID: `TBD`

## Latest Testnet

- Namada public testnet 15:
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/pages/operators/ibc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ cp ./target/release/hermes /usr/local/bin/
### Create the relayer account
On each chain, there must be a `relayer` account. The alias should be the same as `chains.key_name` in the config. On a namada chain, this can be done by running
```bash copy
namadaw key gen --alias relayer
namadaw gen key --alias relayer
```

This will generate a key for the relayer account. The key will be stored in the `wallet.toml` that is found in the [base directory](./ledger/base-directory.mdx) of the node, inside the `chain-id` folder. For example, if the `chain-id` is `namada-test.0a4c6786dbda39f786`, the `wallet.toml` will be found in `$HOME/.local/share/namada/namada-test.0a4c6786dbda39f786/wallet.toml` (on a ubuntu machine where `base-dir` has not been set up properly).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This can be done through the namada cli:

```bash
ALIAS="<your-key-alias>"
namadaw --pre-genesis key gen --alias $ALIAS
namadaw --pre-genesis gen --alias $ALIAS
```

After the user has entered their passwords and written down their mnemonic phrase, the namada cli will save the keys to the `pre-genesis` folder inside the [base directory](../../ledger/base-directory.mdx).
Expand Down Expand Up @@ -145,7 +145,7 @@ Once the pre-genesis network participants have generated respective pre-genesis

EMAIL="<your-email>"
DISCORD_HANDLE="<your-discord-handle>" # This is optional
SELF_BOND_AMOUNT=1000000 # Set this to the amount of NAM you want to self-bond
SELF_BOND_AMOUNT=1000000 # Set this to the amount of NAM you want to self-bond. This must be less than or equal to the amount of NAM allocated to the pre-genesis keys in the `balances.toml` that was published by the network coordinator.
VALIDATOR_ALIAS="<your-validator-alias>"
IP_ADDRESS="<your-public-IP-address>"
namadac utils init-genesis-validator \
Expand Down Expand Up @@ -188,6 +188,21 @@ Successful execution will output the new validator address:
Validator account address: tnam1q8lsztqqhpjxdwzw88mqqc2mun7dvpxvas3v2dxk
```

#### Bond to a pre-genesis validator account
If your public key has been allocated `NAM` (`NAAN` for the shielded expedition), you can bond to a genesis validator as a pre-genesis transaction.
Please follow the below steps:

```bash copy
namadac utils genesis-bond \
--validator "<your-validator-alias>" \ # Validator address.
--amount "<amount>" \ # Amount of tokens to stake in a bond.
--source "<your-tpknam-in-balances.toml>" \ # Source address for delegations. For self-bonds, the validator is also the source.
--path "<filename-for-your-tx.toml>" \ # Output toml file to write transactions to.
```

After this step is completed, sign the transaction


### Signing transactions

Once the `transactions.toml` file has been generated, the pre-genesis network participants must sign the transactions. This can be done through the namada cli:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The user must first generate a key pair for their validator account.

```bash copy
KEY_ALIAS="aliace"
namada wallet key gen --alias $KEY_ALIAS
namada wallet gen --alias $KEY_ALIAS
```

Now choose a name for your validator:
Expand Down
22 changes: 9 additions & 13 deletions packages/docs/pages/users/transparent-accounts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ Note the use of the placeholder `keysha` for the key parameter. This is a compl

```shell copy
KEY_ALIAS="keysha"
namada wallet key gen --alias $KEY_ALIAS
namada wallet gen --alias $KEY_ALIAS
```

<Callout type="info">
The derived implicit address shares the same `keysha` alias. The previous command has the same effect as `namada wallet address gen --alias keysha`.
The derived implicit address shares the same `keysha` alias. The previous command has the same effect as `namada wallet gen --alias keysha`.
</Callout>

By default, the keys are stored encrypted.
Expand All @@ -43,7 +43,7 @@ Namada wallet supports keypair generation using a [mnemonic code](https://github
To generate a keypair for a default path use
```shell copy
KEY_ALIAS="keysha"
namada wallet key gen --alias $KEY_ALIAS --hd-path default
namada wallet gen --alias $KEY_ALIAS --hd-path default
```

<Callout type="info">
Expand All @@ -67,7 +67,7 @@ namada wallet key restore --alias keysha --hd-path default
### List all known keys

```shell copy
namada wallet key list
namada wallet list --keys
```

## Manage addresses
Expand All @@ -76,32 +76,28 @@ namada wallet key list
To manage addresses, similar to keys, various sub-commands are available:

```shell copy
namada wallet address
namada wallet --help
```

### Generate an implicit address

Let's call the implicit address `accountant`:
```shell copy
namada wallet address gen --alias accountant
namada wallet gen --alias accountant
```

<Callout type="info">
Note that this will also generate and save a key from which the address was derived and save it under the same `accountant` alias. Thus, this command has the same effect as `namada wallet key gen --alias accountant`.
</Callout>

```shell copy
namada wallet address gen --alias keysha --hd-path default
namada wallet gen --alias keysha --hd-path default
```
generates an address using a [mnemonic code](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) and [HD derivation path](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki).

### Restore the address

```shell copy
namada wallet address restore --alias keysha --hd-path default
namada wallet derive --alias keysha --hd-path default
```
### List all known addresses

```shell copy
namada wallet address list
namada wallet list --addr
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,15 @@ Before creating an account, a user must generate at least one cryptographic `key

The following method will generate such a key:
```shell
namadaw key gen \
namadaw gen \
--alias my-key1
```
A second key can be generated as well (which will be useful for multisigs):
```shell
namadaw key gen \
namadaw gen \
--alias my-key2
```

An implicit address can also be generated:
```shell
namadaw address gen \
--alias my-address
```

Accounts on Namada are initialised through the following method:

**Non-multisig account (single signer)**
Expand Down

0 comments on commit ab623f9

Please sign in to comment.