moved configs into environment (#17)

* moved configs into environment

* fixed copy pasta

* changed proxyuser to proxy in data paths

* fixed typo
This commit is contained in:
Markus Wolf
2018-10-12 20:10:31 +03:00
committed by kexkey
parent 74e4fc9fbf
commit e1ee367430
8 changed files with 38 additions and 15 deletions

View File

@@ -1,7 +1,6 @@
#!/bin/sh
. ./trace.sh
. ./utils.sh
deriveindex()
{
@@ -10,8 +9,8 @@ deriveindex()
local index=${1}
trace "[deriveindex] index=${index}"
local pub32=$(get_prop "derivation.pub32")
local path=$(get_prop "derivation.path" | sed -En "s/n/${index}/p")
local pub32=$DERIVATION_PUB32
local path=$(echo -e $DERIVATION_PATH | sed -En "s/n/${index}/p")
# pub32=$(grep "derivation.pub32" config.properties | cut -d'=' -f2)
# path=$(grep "derivation.path" config.properties | cut -d'=' -f2 | sed -En "s/n/${index}/p")
@@ -43,4 +42,4 @@ send_to_pycoin()
trace_rc ${returncode}
return ${returncode}
}
}

View File

@@ -7,7 +7,7 @@
compute_fees()
{
local pruned=$(get_prop "watchingnode.pruned")
local pruned=${WATCHER_BTC_NODE_PRUNED}
if [ "${pruned}" = "true" ]; then
trace "[compute_fees] pruned=${pruned}"
# We want null instead of 0.00000000 in this case.

View File

@@ -3,13 +3,39 @@
export PROXY_LISTENING_PORT
export WATCHER_NODE_RPC_URL=$WATCHER_BTC_NODE_RPC_URL
export SPENDER_NODE_RPC_URL=$SPENDER_BTC_NODE_RPC_URL
export WATCHER_NODE_RPC_CFG=$WATCHER_BTC_NODE_RPC_CFG
export SPENDER_NODE_RPC_CFG=$SPENDER_BTC_NODE_RPC_CFG
export TRACING
export DB_PATH
export DB_FILE
trim() {
echo -e $1 | sed -e 's/^[[:space:]]*//' | sed -e 's/[[:space:]]*$//'
}
createCurlConfig() {
if [[ ''$1 == '' ]]; then
echo "Missing file name: Check you *_BTC_NODE_RPC_CFG"
return
fi
if [[ ''$2 == '' ]]; then
echo "Missing content: Check you *_BTC_NODE_RPC_USER"
return
fi
local user=$( trim $2 )
echo "user=${user}" > ${1}
}
if [ ! -e ${DB_FILE} ]; then
echo "DB not found, creating..." > /dev/stderr
cat watching.sql | sqlite3 $DB_FILE
fi
createCurlConfig ${WATCHER_BTC_NODE_RPC_CFG} ${WATCHER_BTC_NODE_RPC_USER}
createCurlConfig ${SPENDER_BTC_NODE_RPC_CFG} ${SPENDER_BTC_NODE_RPC_USER}
nc -vlkp${PROXY_LISTENING_PORT} -e ./requesthandler.sh