Skip to content

Commit

Permalink
Merge pull request #1364 from anoma/bengt/base-dir-docs
Browse files Browse the repository at this point in the history
changed the base dir where i could find it
  • Loading branch information
bengtlofgren authored May 12, 2023
2 parents 3ccbf10 + 7dcc9b1 commit 8e830ef
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 14 deletions.
10 changes: 7 additions & 3 deletions documentation/docs/src/testnets/pre-genesis-validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ namada client utils init-genesis-validator --alias $ALIAS \
--max-commission-rate-change 0.01 --commission-rate 0.05 \
--net-address $PUBLIC_IP:26656
```
2. Expect the message `Pre-genesis TOML written to .namada/pre-genesis/[your-alias]/validator.toml`
2. Expect the message:
- Linux: `Pre-genesis TOML written to /home/[your-username]/.config/namada/pre-genesis/[your-alias]/validator.toml`
- MacOS: `Pre-genesis TOML written to /Users/[your-username]/Library/Application Support/com.heliax.namada/pre-genesis/[your-alias]/validator.toml`

This will generate a folder inside `namada/.namada`.
This will generate a folder inside `$HOME/.config/namada` or `$HOME/Library/Application\ Support/com.heliax.namada` depending on the operating system (OS). The former is based on a linux OS and the latter is based on a MacOS.

3. You can print the validator.toml by running:

`cat namada/.namada/pre-genesis/$ALIAS/validator.toml`
- Linux `cat $HOME/.config/namada/pre-genesis/$ALIAS/validator.toml`
- MacOS `cat $HOME/Library/Application\ Support/com.heliax.namada/pre-genesis/$ALIAS/validator.toml`


## 2.1) 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 validator.toml file to the relevant directory (e.g. `namada-public-testnet-2` for the second public testnet), renaming it to `$alias.toml`.
Expand Down
27 changes: 20 additions & 7 deletions documentation/docs/src/testnets/run-your-genesis-validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,31 @@ mkdir backup-pregenesis && cp -r .namada/pre-genesis backup-pregenesis/
*(WARNING: THIS WILL ALSO DELETE YOUR VALIDATOR KEYS, DO NOT RUN UNLESS YOU'VE BACKED IT UP)*

3. Delete ledger base directory

- Linux: `rm -rf $HOME/.config/namada`
- MacOS: `rm -rf $HOME/Library/Application\ Support/com.heliax.namada`

4. Check that namada and tendermint binaries are correct (see step 1)
5. Create a base directory for the ledger
- Linux: `mkdir $HOME/.config/namada`
- MacOS: `mkdir $HOME/Library/Application\ Support/com.heliax.namada`

Save the base directory path to a variable
- Linux:
```bash
rm -rf .namada
export BASE_DIR=$HOME/.config/namada
```
4. Check that namada and tendermint binaries are correct (see step 1)
5. Create a `.namada` folder
- MacOS:
```bash
mkdir .namada
mkdir .namada/pre-genesis
export BASE_DIR=$HOME/Library/Application\ Support/com.heliax.namada
```
6. Copy the backuped file back to `.namada/pre-genesis` folder
6. Create a pre-genesis directory
- Linux: `mkdir $HOME/.config/namada/pre-genesis`
- MacOS: `mkdir $HOME/Library/Application\ Support/com.heliax.namada/pre-genesis`

7. Copy the backuped file back to `$BASE_DIR/pre-genesis` folder
```bash
cp -r backup-pregenesis/* .namada/pre-genesis/
cp -r backup-pregenesis/* $BASE_DIR/pre-genesis/
```

## 3.1) Run your node as a genesis validator
Expand Down
20 changes: 18 additions & 2 deletions documentation/docs/src/user-guide/genesis-validator-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,24 @@ namada client utils init-genesis-validator \

After generating your keys, the command will print something like this:

- Linux
```shell
Pre-genesis TOML written to .namada/pre-genesis/1337-validator/validator.toml
Pre-genesis TOML written to /home/$USER/.config/com.heliax.namada
```
- MacOS
```shell
Pre-genesis TOML written to /Users/$USER/Library/Application\ Support/com.heliax.namada
```

Save this directory as an environment variable for later use:

- Linux
```shell
export BASE_DIR="/home/$USER/.config/com.heliax.namada"
```
- MacOS
```shell
export BASE_DIR="/Users/$USER/Library/Application\ Support/com.heliax.namada"
```

This file is the public configuration of your validator. You can safely share this file with the network's organizer, who is responsible for setting up and publishing the finalized genesis file and Namada configuration for the chain.
Expand All @@ -48,7 +64,7 @@ If you run this command in the same directory that you ran `namada client utils
```shell
namada client utils join-network \
--chain-id $CHAIN_ID \
--pre-genesis-path workspace/.namada/pre-genesis/$ALIAS
--pre-genesis-path $BASE_DIR/pre-genesis/$ALIAS
```

Once setup, you can start the ledger as usual with e.g.:
Expand Down
13 changes: 11 additions & 2 deletions documentation/docs/src/user-guide/ledger.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,20 @@ namada ledger
The node will attempt to connect to the persistent validator nodes and other peers in the network, and synchronize to the latest block.

By default, the ledger will store its configuration and state in either `$HOME/.config/namada` or `$HOME/Library/Application\ Support/com.heliax.namada`. You can use the `--base-dir` CLI global argument or `NAMADA_BASE_DIR` environment variable to change it.
By default, the ledger will store its configuration and state in either `$HOME/.config/namada` or `$HOME/Library/Application\ Support/com.heliax.namada`. You can use the `--base-dir` CLI global argument or `BASE_DIR` environment variable to change it.

- Linux:
```bash
export BASE_DIR=$HOME/.config/namada
```
- MacOS:
```bash
export BASE_DIR=$HOME/Library/Application\ Support/com.heliax.namada
```

The ledger also needs access to the built WASM files that are used in the genesis block. These files are included in release and shouldn't be modified, otherwise your node will fail with a consensus error on the genesis block. By default, these are expected to be in the `wasm` directory inside the chain directory that's in the base directory. This can also be set with the `--wasm-dir` CLI global argument, `NAMADA_WASM_DIR` environment variable or the configuration file.

The ledger configuration is stored in `.namada/{chain_id}/config.toml` (with
The ledger configuration is stored in `$BASE_DIR/{chain_id}/config.toml` (with
default `--base-dir`). It is created when you join the network. You can modify
that file to change the configuration of your node. All values can also be set
via environment variables. Names of the recognized environment variables are
Expand Down

0 comments on commit 8e830ef

Please sign in to comment.