Skip to content

Commit

Permalink
Merge pull request #90 from anoma/bengt/testnet-environment
Browse files Browse the repository at this point in the history
prettier steps
  • Loading branch information
bengtlofgren authored Aug 1, 2023
2 parents aa67e84 + 3dd2647 commit 0d7d2b1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 20 deletions.
30 changes: 19 additions & 11 deletions packages/docs/pages/introduction/testnets/environment-setup.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {Steps} from 'nextra-theme-docs'

# Environment setup

> If you don't want to build Namada from source you can [install Namada from binaries](../user-guide/install/from-binary.md).
Expand All @@ -10,17 +12,18 @@ export NAMADA_TAG=v0.20.1


## Installing Namada
0. Install all pre-requisites
<Steps>
### Install all pre-requisites
- [Rust](https://www.rust-lang.org/tools/install)
- [CometBFT](../installing-cometbft.md)
- [Protobuf](../install/source/pre-requisites.md)

1. Clone namada repository and checkout the correct versions
### Clone namada repository and checkout the correct versions

```shell copy
git clone https://github.com/anoma/namada && cd namada && git checkout $NAMADA_TAG
```
2. Build binaries
### Build binaries
```bash copy
make build-release
```
Expand All @@ -30,30 +33,35 @@ sudo apt-get update -y
sudo apt-get install build-essential make pkg-config libssl-dev libclang-dev -y
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

</Steps>
## Installing CometBFT
1. See the installing CometBFT section [here](../installing-cometbft.md) for instructions on how to install CometBFT.
2. Copy both the namada and CometBFT binaries to somewhere on $PATH (or use the relative paths). This step may or may not be necessary.
<Steps>
### See the installing CometBFT section [here](../installing-cometbft.md) for instructions on how to install CometBFT.
### Copy both the namada and CometBFT binaries to somewhere on $PATH (or use the relative paths). This step may or may not be necessary.

- namada binaries can be found in `/target/release`
- CometBFT is likely in `$HOME/Downloads/cometbft`

</Steps>
## Check ports
1. Open ports on your machine:
<Steps>
### Open ports on your machine:
- 26656
- 26657
2. To check if ports are open you can setup a simple server and curl the port from another host
### To check if ports are open you can setup a simple server and curl the port from another host

- Inside the namada folder, run
``` bash
{ printf 'HTTP/1.0 200 OK\r\nContent-Length: %d\r\n\r\n' "$(wc -c < namada)"; cat namada; } | nc -l $PORT`
{ printf 'HTTP/1.0 200 OK\r\nContent-Length: %d\r\n\r\n' "$(wc -c < namada)"; cat namada; } | nc -l $PORT
```

- From another host run one of the two commands:
- `nmap $IP -p$PORT`
- `curl $IP:$PORT >/dev/null`

## Verifying your installation
### Verifying your installation
- 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.20.1`

</Steps>
19 changes: 10 additions & 9 deletions packages/docs/pages/introduction/testnets/migrating-testnets.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Callout } from 'nextra-theme-docs'
import { Callout, Steps } from 'nextra-theme-docs'

# Steps for migrating testnets

Expand Down Expand Up @@ -35,40 +35,41 @@ Technically, the correct directory will be the one assigned to `$XDG_DATA_HOME`,
but if you haven't set that variable, it will default to the one given above.
</Callout>


### 1. IMPORTANT! Save your `pre-genesis` folder in the ledger base directory
<Steps>
### IMPORTANT! Save your `pre-genesis` folder in the ledger base directory

Before we delete any folders, we want to make sure we save our `pre-genesis` folder. This folder contains your validator keys, and we want to make sure we don't lose them.

```bash copy
mkdir $HOME/backup-pregenesis && cp -r $BASE_DIR/pre-genesis $HOME/backup-pregenesis/
```

### 2. **Ensure keys are saved**
### **Ensure keys are saved**

`ls backup-pregenesis` should output a saved `wallet.toml`.

### 3. Delete the base directory
### Delete the base directory

```bash copy
rm -rf $BASE_DIR/*
```

### 4. Check that namada and cometbft binaries are correct.
### Check that namada and cometbft binaries are correct.

`namada --version` should yield `v0.15.3` and `cometbft version` should output `0.37.2`



### 5. Create a pre-genesis directory
### Create a pre-genesis directory

```bash copy
mkdir $BASE_DIR/pre-genesis
```

### 6. Copy the backuped file back to `$BASE_DIR/pre-genesis` folder
### Copy the backuped file back to `$BASE_DIR/pre-genesis` folder
```bash copy
cp -r backup-pregenesis/* $BASE_DIR/pre-genesis/
```
</Steps>

You should now be ready to go!
**You should now be ready to go!**

0 comments on commit 0d7d2b1

Please sign in to comment.