Skip to content

Commit 2b5b20e

Browse files
committed
contrib: automatically copy config from contrib/ in start_revaultd
Signed-off-by: Antoine Poinsot <[email protected]>
1 parent b4601a8 commit 2b5b20e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

contrib/regtest_manager.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,16 @@ stop_regtest () {
145145

146146
# Start a single revault wallet daemon
147147
start_revaultd () {
148-
# FIXME: write the config to the PREFIX_DIR ourselves..
149-
if [ -z "$REVAULTD_CONFIG_PATH" ];then REVAULTD_CONFIG_PATH="./config_regtest.toml";fi
150-
cargo run --bin revaultd -- --conf "$REVAULTD_CONFIG_PATH";
148+
if [ -z "$PREFIX_DIR" ]; then PREFIX_DIR="$PWD/regtest";fi
149+
150+
if [ -z "$REVAULTD_CONFIG_PATH" ];then
151+
REVAULTD_CONFIG_PATH="./config_regtest.toml"
152+
cp contrib/config_regtest.toml $REVAULTD_CONFIG_PATH || echo "start_revaultd must be used at the root of the repo"; return 1
153+
sed -i "s|/path/to/your/datadir/revault|$PREFIX_DIR/revaultd|g" $REVAULTD_CONFIG_PATH
154+
sed -i "s|/path/to/your/cookie/path/.cookie|$PREFIX_DIR/bcdir1/regtest/.cookie|g" $REVAULTD_CONFIG_PATH
155+
fi
156+
157+
cargo run --bin revaultd -- --conf $REVAULTD_CONFIG_PATH;
151158
alias re="cargo run --bin revault-cli -- --conf $REVAULTD_CONFIG_PATH";
152159
}
153160

0 commit comments

Comments
 (0)