Skip to content

Commit

Permalink
Merge pull request #53 from anoma/bengt/fix-build-network
Browse files Browse the repository at this point in the history
newer, better, local network script
  • Loading branch information
bengtlofgren committed Jun 22, 2023
2 parents 1353420 + fa90fb2 commit 51bc84b
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions packages/docs/pages/experimental/local-network.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,8 @@ There is a script that has been written specifically for this purpose, which can

The script has some dependencies that must be installed in order to run it successfully:

1. `trash` must be installed.
2. python3 must be installed.
3. toml Python pip library https://pypi.org/project/toml/ must be installed.

`trash` can be installed via:

```shell copy
# Linux
sudo apt install trash-cli
```

```shell copy
# MacOS
brew install trash
```
1. python3 must be installed.
2. toml Python pip library https://pypi.org/project/toml/ must be installed.

The script will require a genesis configuration file, which is a TOML file that specifies the parameters of the network. Examples of such files can be found in the [anoma-network-config repo](https://github.com/heliaxdev/anoma-network-config) in the `templates` directory.

Expand All @@ -49,19 +36,26 @@ make build-wasm-scripts
The script is called `build_network.sh` and can be run with the following command:

```shell copy
./scripts/build_network.sh <config_toml> <base_dir> <namada_dir>
# Ensure you are in the root of the namada repository directory
./scripts/build_network.sh <config_toml> <namada_dir> <OPTIONAL: base_dir>
```

More specifically, the script takes three arguments:

1. `config_toml`: the path to the (validator-free) genesis configuration file.
2. `base_dir`: the path to the BASE_DIR directory, where all chain-data is stored. For linux, this is usually `$HOME/.local/share/namada`, and for MacOS, this is usually `"$HOME/Library/Application Support/Namada"`.
3. `namada_dir`: the path to the namada BINARIES directory. If the binaries were build using `make build-release` this would imply the `namada/target/release` directory.
2. `namada_dir`: the path to the namada BINARIES directory.
If the binaries were build using `make build-release` this would imply the `namada/target/release` directory.
Otherwise, if they were built using `make build` it would be the `namada/target/debug` directory.
3. `base_dir`: OPTIONAL ARGUMENT.
You can specify the path to the BASE_DIR directory, where all chain-data is stored.
This is only necessary if the BASE_DIR is not the default given by `namadac utils default-base-dir` command.

For example, a MacOS user would run something along the lines of:

```shell copy
./scripts/build_network.sh ~/anoma-network-config/templates/edited_genesis_config.toml "$HOME/Library/Application Support/Namada" ./target/release
./scripts/build_network.sh \
~/anoma-network-config/templates/edited_genesis_config.toml \
./target/release # Assuming the binaries were built using `make build-release`
```

## Running the ledger
Expand All @@ -70,7 +64,7 @@ After the script has been run, a python process will have started in the backgro
The ledger can be run through the familiar command:

```shell copy
target/release/namada ledger
target/release/namada ledger #Assuming the binaries were built using `make build-release`
```

## Cleaning up
Expand Down

0 comments on commit 51bc84b

Please sign in to comment.