Skip to content

Commit

Permalink
Merge pull request #410 from anoma/ian/ledger-staking-misc
Browse files Browse the repository at this point in the history
Ledger staking instructions for Namadillo + misc
  • Loading branch information
brentstone authored Nov 29, 2024
2 parents c354420 + d71a4ce commit 22fa7cb
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ Then, install the remaining dependencies.

{/* TODO: Turn these into code boxes with toggles for OS */}

**Ubuntu:** running the following command should install everything needed:
**Ubuntu 22.x:** Running the following command should install everything needed:

```shell copy
sudo apt-get install -y make git-core libssl-dev pkg-config libclang-12-dev build-essential protobuf-compiler libudev-dev
```

**Ubuntu 24.x:** Same as above, except use `libclang-19-dev` instead:

```shell copy
sudo apt-get install -y make git-core libssl-dev pkg-config libclang-19-dev build-essential protobuf-compiler libudev-dev
```

**Mac:** installing the Xcode command line tools should provide you with almost everything you need:

```shell copy
Expand Down
10 changes: 6 additions & 4 deletions packages/docs/pages/operators/ibc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ And for setting up a testing environment by running two local Namada chains, see

<Steps>
### Installing Hermes
Heliax maintains a fork of the Hermes relayer software. You can download a prebuilt binary or build it from source.
Heliax maintains a fork of the Hermes relayer software. You can download a prebuilt binary or build it from source.

**Note:** In the below instructions, replace the value of `TAG` with the latest tagged release, which can be found on the Hermes repo [releases page](https://github.com/heliaxdev/hermes/releases).

#### From binaries
One can download the latest binary release from our [releases page](https://github.com/heliaxdev/hermes/releases) by choosing the appropriate architecture.

E.g.
```bash copy
export TAG="v1.8.2-namada-beta11" # or the appropriate release for your version of namada
export TAG="v1.10.4-namada-beta17-rc2" # or latest tagged release
export ARCH="x86_64-unknown-linux-gnu" # or "aarch64-apple-darwin"
curl -Lo /tmp/hermes.tar.gz https://github.com/heliaxdev/hermes/releases/download/${TAG}/hermes-${TAG}-${ARCH}.tar.gz
tar -xvzf /tmp/hermes.tar.gz -C /usr/local/bin
Expand All @@ -64,7 +66,7 @@ This is also true for the command `cp ./target/release/hermes /usr/local/bin/` b

#### From source
```bash copy
export TAG="v1.8.2-namada-beta11" # or the appropriate release for your version of namada
export TAG="v1.10.4-namada-beta17-rc2" # or the latest tagged release

git clone https://github.com/heliaxdev/hermes.git
git checkout $TAG
Expand Down Expand Up @@ -426,7 +428,7 @@ First, you will need to export some environment variables:
```bash copy
export NAMADA_DIR="<path-to-namada-source-directory>"
export TAG="v1.8.2-namada-beta11" # or the appropriate hermes version for your namada version
export TAG="v1.10.4-namada-beta17-rc2" # or the latest tagged release
```
```bash copy
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/pages/operators/state-sync.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ their node will need to sync to the tip of the chain. The simplest way to do
this is to replay all blocks of the chain starting from genesis. However,
this is not the most efficient way.

If an operator trusts the chain past a certain block height, they can fetch
If an operator trusts the chain up to a certain block height, they can fetch
snapshots from peers (if they are configured to provide snapshots) and then
only replay the chain from this snapshot onward. This is called __state sync__.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ namadac transparent-transfer --source abc-multisig --target $TARGET \
# Example output:
Transaction serialized to tx_dumps/FC2955C6B252EF6E93B1B54923B2178A7DC47E06D27448A43426487DF4BAD0E3.tx.
```
<Callout type="info">
By default, transactions have an expiration of *1 hour* from the time they're created. This can be changed using the `expiration-date` flag and providing a new
expiration time (in UTC). You can also use the `no-expiration` flag to set no expiry; although this option is discouraged and should be used with caution.

Transactions submitted after expiry will not be accepted on-chain.
</Callout>

### Sign the transaction with two of the three Keys
This command will sign the transaction with Alice's key. Afterwards, repeat the command using Bob's key.
Expand Down
92 changes: 48 additions & 44 deletions packages/docs/pages/users/wallet/hardware-wallet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { Steps } from 'nextra-theme-docs'

# Ledger Hardware Wallet

<Callout type="info">
The Namada Ledger app is not yet updated in the Ledger Live catalogue, so the only way to use one in the meantime is with 1) a Ledger **Nano** device and 2) sideloading as a work-around: [Zondax Hub](https://hub.zondax.ch)
Typically sideloading an unaudited version of the app onto your device is only for testing purposes, but it is effective as a work-around. See the installation instructions below.
<Callout type="info" emoji={"🎉"}>
The Namada Ledger app is now available on the official Ledger Live app catalog! If you had followed the instructions on previous versions of these
docs to install the development version from Zondax Hub, make sure you uninstall any pre-release versions of the app and install the latest
version from Ledger Live before proceeding.
</Callout>

Both the [Namada Keychain](./web-wallet.mdx) browser extension and the Namada CLI are compatible with the [Ledger](https://www.ledger.com/) hardware wallet.
Expand All @@ -18,32 +19,24 @@ In order to use the Ledger with the web wallet, you will need to install the [Na
you will need to [install the latest version](./../../introduction/install.mdx) of Namada.

## Installing the Namada Ledger app
<Callout type="warning">
The Namada Ledger app is still a work in progress. Use at your own risk. At this preliminary stage of development, it is *highly* recommended that you use a device that
does not contain any existing funds.

When installing a Ledger app from any source besides the official app store, you will be shown a warning to that effect and prompted for confirmation. Please make sure you
understand the risks before proceeding. Before installing *any* app from a non-official source, be sure that you trust the authors and the instructions being given. As always, do your own research.
</Callout>
The Namada Ledger app is available on the official Ledger Live app catalog. Follow the instructions below to install the app on your device.

<Steps>
### Connect your device to your computer
The remaining steps assume you have already completed the initial Ledger setup and your device is ready to use.

### Uninstall any existing Namada apps on your device

### Visit the Zondax Hub and prepare your device
In your browser, visit the [Zondax Hub](https://hub.zondax.ch). Click the "Connect Device" button in the top right corner, and confirm the connection in your browser and on your device.
### Open the Ledger Live App Catalog
Open the Ledger Live desktop app and select 'My Device' from the lefthand menu to display the list of available apps.

### Install the Namada app
Scroll down until you find Namada in the list, and select the newest version from the dropdown. Click "Install" and confirm on your device.
Scroll down until you find Namada in the list (or use the search bar), and click the 'Install' button to install the latest version on your device.

</Steps>

## Using a Ledger with Namada Keychain (browser extension)

You can use the Ledger app with the Namada Keychain browser extension to sign transactions in front-end web apps. **Expert mode must be turned off.** See the
[Namada Keychain](./web-wallet.mdx) page for general installation and usage instructions.
You can use the Ledger app with the Namada Keychain browser extension to sign transactions in front-end web apps. See the
[Namada Keychain](./web-wallet.mdx) page for instructions on installing and using the Namada Keychain browser extension.

<Callout>
Disclaimer: this will only work on Chrome-enabled browsers at the moment.
Expand Down Expand Up @@ -73,36 +66,50 @@ Give your account an easy to remember name.
### Display your address/public key
To display your Ledger address/public key, first open Namada Keychain. Find your Ledger account in the list, click the `` icon (three vertical dots) and select 'View keys'.

### Signing a transaction
**Expert mode must be turned off.** To sign a transaction from a front-end app (such as [Namadillo](./../../integrating-with-namada/interface.mdx)), follow these steps:

<Steps>
### Connect your device and open the Namada app

### Set your Ledger as the active account
Open the Namada Keychain and click the checkbox next to your Ledger account to set it as the active account.

### Perform your transaction

### Review transaction
You will be presented with a browser pop-up containing a summary of the transaction. You can click `View data` to see the
details of what will be submitted on-chain. You can also verify the correct public key is listed under `Signer`. When you're
ready to proceed, click `Approve`.
## Staking using the Ledger
You can use the Ledger to sign a transactions from a front-end app (such as [Namadillo](./../../integrating-with-namada/interface.mdx)). The example given below is
for staking with a validator (or validators), but the signing process is essentially the same for any type of transaction you wish to make (transfers, voting on governance, etc.)

You will be reminded again to connect your device and open the Namada app; click `Submit` to send the signing request to the Ledger.
The following assumes you have completed the steps to install the Namada Ledger app, the Namada Keychain browser extension, and completed the initial setup process as described
in [Importing (deriving) your Ledger Address](#importing-deriving-your-ledger-address) above.

### Approve on your device
Review the transaction details on your device and click `Approve` to sign and submit the transaction to the chain.
<Steps>
### Open the web app
In your browser, open [Namadillo](https://interface.namada.tududes.com).

### Connect the browser extension
Click the 'Connect Keychain' button in the top right corner and approve the connection request.

### Navigate to the staking dashboard
From the left panel, select 'Staking' **(1, below)**. You should see your available NAM balance displayed in the top-center, under 'Available NAM to stake' **(2, below)**.
(If your balance is different than expected, check that the correct account is active in the browser extension).
![Step 1](../../../public/images/stake1.png)
*Namadillo Staking dashboard*
### Stake your tokens
Click on 'Stake' **(either button marked 3, above)**; this will open a new dialog in which you can enter the amounts you wish to stake with each validator **(4, below)**.
You can stake with multiple validators in a single action. Click 'Stake' again **(5, below)** when you're ready.
![Step 2](../../../public/images/stake2.png)
*Staking to multiple validators at once*

### Approve the transaction
You will be prompted to approve the transaction in a pop-up. After confirming, you will also be asked to confirm the transaction on your Ledger device.
![Step 3](../../../public/images/stake3.png)

### Wait for confirmation
You will see a grey dialog box in the top right corner of Namadillo notifying that the transaction is being processed. After roughly 10 seconds you will be informed
if your transaction was successful.
![Step 4](../../../public/images/stake4.png)
</Steps>

##### Worth noting:
Whenever you're submitting a transaction of any kind for the first time from an address, you'll also see a 'Reveal PK' (Reveal Public Key) transaction automatically bundled with your other transaction(s) **(6, below)**.
![Step 5](../../../public/images/stake5.png)
*Example of a staking transaction with Reveal PK message*
## Using the Ledger app with the CLI
You can use your Ledger to sign transactions from the Namada CLI.
<Callout type="warning">
Make sure the 'expert mode' toggle is set to disabled in the Namada app; this feature has not yet been implemented and may result in crashes.
</Callout>

### Importing (deriving) your Ledger address
Before any other operations with the Ledger, we will want to derive an address and public key and add them to the [file system wallet](./file-system-wallet.mdx) under an alias for convenience.
Before any other operations with the Ledger, we need to derive an address and public key and add them to the [file system wallet](./file-system-wallet.mdx) under an alias for convenience.
To derive your address using a Ledger:

<Steps>
Expand Down Expand Up @@ -138,8 +145,8 @@ namadac transparent-transfer \
When constructing the transfer, the CLI will check your wallet for the public key given under `$ALIAS`. You will then be prompted on the device to approve the transaction

### Troubleshooting
As written above, the Namada Ledger app is not yet updated in the Ledger Live catalogue, so the only way to use one in the meantime is with 1) a Ledger **Nano** device and 2) sideloading as a work-around: [Zondax Hub](https://hub.zondax.ch)
Typically sideloading an unaudited version of the app onto your device is only for testing purposes, but it is effective as a work-around.
As a first step when troubleshooting Ledger issues, make sure that you've updated your Ledger Live app and Ledger firmware to the latest versions.
Additionally, check in the Ledger Live app catalog to make sure you have the latest version of the Namada app.

Some common errors you may encounter while using the Ledger with the Namada CLI:

Expand All @@ -151,6 +158,3 @@ Make sure you're using the correct versions of both the Ledger app and Namada bi

- The CLI panics with `Message: No signature could be produced for a transaction of type ...`
Make sure the Ledger account has been properly [added to your wallet](#importing-deriving-your-ledger-address-1).

- The CLI panics part-way through signing and the Ledger reboots.
Make sure the `expert mode` toggle in the Ledger app is set to `disabled`.
Binary file added packages/docs/public/images/stake1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/docs/public/images/stake2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/docs/public/images/stake3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/docs/public/images/stake4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/docs/public/images/stake5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 22fa7cb

Please sign in to comment.