From f06d7edfdd2a04ac2c14cd0e291e1bde733c819d Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Wed, 12 Aug 2020 11:18:33 -0500 Subject: [PATCH] contrib: Support env var in simnet setup script. This modifies the dcr_tmux_simnet_setup.sh script to set the root of all of the nodes to the environment variable DCR_SIMNET_ROOT when it is set and fallback to the existing path when it is not. It also updates contrib/README.md and docs/simnet_environment.mediawiki to document the new capability. --- contrib/README.md | 4 ++++ contrib/dcr_tmux_simnet_setup.sh | 2 +- docs/simnet_environment.mediawiki | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/contrib/README.md b/contrib/README.md index 92b0b039..387c6e43 100644 --- a/contrib/README.md +++ b/contrib/README.md @@ -32,5 +32,9 @@ network where the developer has full control since the difficulty levels are low enough to generate blocks on demand and the developer owns all of the tickets and votes on the private network. +The environment will be housed in the `$HOME/dcrdsimnetnodes` directory by +default. This can be overridden with the `DCR_SIMNET_ROOT` environment variable +if desired. + See the full [Simulation Network Reference](../docs/simnet_environment.mediawiki) for more details. diff --git a/contrib/dcr_tmux_simnet_setup.sh b/contrib/dcr_tmux_simnet_setup.sh index 257442de..16c3be8c 100755 --- a/contrib/dcr_tmux_simnet_setup.sh +++ b/contrib/dcr_tmux_simnet_setup.sh @@ -25,7 +25,7 @@ set -e SESSION="dcrd-simnet-nodes" -NODES_ROOT=~/dcrdsimnetnodes +NODES_ROOT=${DCR_SIMNET_ROOT:-${HOME}/dcrdsimnetnodes} RPCUSER="USER" RPCPASS="PASS" WALLET_SEED="b280922d2cffda44648346412c5ec97f429938105003730414f10b01e1402eac" diff --git a/docs/simnet_environment.mediawiki b/docs/simnet_environment.mediawiki index eefc2b70..131cdf48 100644 --- a/docs/simnet_environment.mediawiki +++ b/docs/simnet_environment.mediawiki @@ -48,6 +48,10 @@ typically readily available on Unix and Linux platforms, to setup a self-contained environment with several terminal-based windows and panes with dcrd and dcrwallet already configured. +The environment will be housed in the $HOME/dcrdsimnetnodes +directory by default. This can be overridden with the +DCR_SIMNET_ROOT environment variable if desired. + ===2.1 Preconfigured Environment Overview=== The following provides an overview of how the environment that is automatically