mirror of
https://github.com/joinmarket-webui/jam.git
synced 2026-08-17 13:07:34 +02:00
* dev: update regtest config for JM v0.9.6 in dev setup * dev: use jam's 'default' cj_max fee settings in dev setup * dev: update secondary dev container config * dev: start directory node in dev setup dev: start instance 1 with access local directory node dev: connect primary and secondary instances to local directory node dev: ability to specify jm branch in primary container dev: remove symlink for tor in directory-node as #1271 is fixed upstream dev: inject hs dir in directory-node instance dev: add script to create onion addresses for regtest setup dev: add prepare-setup.sh script to write .env.generated file dev: cleanup directory-node setup and scripts * cleanup: clarify hs directory handling * cleanup: fix typos and remove unneeded commands in prepare setup script * dev: revert changes to regtest fee settings * dev: use example env file for all other commands than 'up' * dev: fix directory node setup on restarts * dev: adapt permissions of hs directory in regtest directory node * dev: ability to follow logs of directory node via npm script * fix: directory node scripts compatibility * Update docker/regtest/dockerfile-deps/joinmarket/directory_node/README.md Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com> * Update docker/regtest/.gitignore Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com> * Update docker/regtest/dockerfile-deps/joinmarket/directory_node/README.md Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com> * review: fix newlines and typos Co-authored-by: Daniel <10026790+dnlggr@users.noreply.github.com>
51 lines
1.2 KiB
Bash
Executable file
51 lines
1.2 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
###
|
|
#
|
|
# This script prepares the regtest environment.
|
|
#
|
|
# The output of this script is a ".env.generated" file
|
|
# to be used in when running docker-compose.
|
|
# e.g.
|
|
# ```
|
|
# docker-compose --env-file .env.generated --file docker-compose.yml up
|
|
# ```
|
|
#
|
|
###
|
|
|
|
set -Eeuo pipefail
|
|
|
|
die() {
|
|
local code=${2-1} # default exit status 1
|
|
echo >&2 -e "${1-}"
|
|
exit "$code"
|
|
}
|
|
|
|
if ! command -v cat &> /dev/null; then
|
|
die "This script needs 'cat' to run. Consider installing it."
|
|
fi
|
|
|
|
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
|
|
|
|
OUTPUT_FILE="$SCRIPT_DIR/.env.generated"
|
|
|
|
# generate an onion address
|
|
HS_SCRIPT_TARGET_DIR="${SCRIPT_DIR}/out/hidden_service_dir"
|
|
HS_SCRIPT_WORK_DIR="${SCRIPT_DIR}/.tmp/generate-onion-address-work"
|
|
. "$SCRIPT_DIR/generate-onion-address.sh" "${HS_SCRIPT_TARGET_DIR}" "${HS_SCRIPT_WORK_DIR}"
|
|
|
|
|
|
ONION_ADDRESS=`cat ${HS_SCRIPT_TARGET_DIR}/hostname`
|
|
|
|
if ! [[ "${ONION_ADDRESS}" == *.onion ]]; then
|
|
die "Invalid argument: Could not find onion address in ${HS_SCRIPT_TARGET_DIR}/hostname"
|
|
fi
|
|
|
|
ONION_ADDRESS_WITH_PORT="${ONION_ADDRESS}:5222"
|
|
|
|
cat <<EOF > "${OUTPUT_FILE}"
|
|
JM_DIRECTORY_NODES=${ONION_ADDRESS_WITH_PORT}
|
|
|
|
EOF
|
|
|
|
echo "Successfully written to ${OUTPUT_FILE}"
|