mirror of
https://github.com/AskDavis/cyphernode.git
synced 2025-12-31 20:25:57 -08:00
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:
@@ -16,9 +16,6 @@ COPY app/script/requesthandler.sh ${HOME}/requesthandler.sh
|
||||
COPY app/script/watchrequest.sh ${HOME}/watchrequest.sh
|
||||
COPY app/script/walletoperations.sh ${HOME}/walletoperations.sh
|
||||
COPY app/script/confirmation.sh ${HOME}/confirmation.sh
|
||||
COPY app/config/watcher_btcnode_curlcfg.properties ${HOME}/watcher_btcnode_curlcfg.properties
|
||||
COPY app/config/spender_btcnode_curlcfg.properties ${HOME}/spender_btcnode_curlcfg.properties
|
||||
COPY app/config/config.properties ${HOME}/config.properties
|
||||
COPY app/script/startproxy.sh ${HOME}/startproxy.sh
|
||||
COPY app/script/trace.sh ${HOME}/trace.sh
|
||||
COPY app/script/sendtobitcoinnode.sh ${HOME}/sendtobitcoinnode.sh
|
||||
@@ -29,7 +26,6 @@ COPY app/data/watching.sql ${HOME}/watching.sql
|
||||
COPY app/script/computefees.sh ${HOME}/computefees.sh
|
||||
COPY app/script/unwatchrequest.sh ${HOME}/unwatchrequest.sh
|
||||
COPY app/script/getactivewatches.sh ${HOME}/getactivewatches.sh
|
||||
COPY app/script/utils.sh ${HOME}/utils.sh
|
||||
COPY app/script/manage_missed_conf.sh ${HOME}/manage_missed_conf.sh
|
||||
COPY app/script/tests.sh ${HOME}/tests.sh
|
||||
COPY app/script/tests-cb.sh ${HOME}/tests-cb.sh
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
derivation.pub32=upub5GtUcgGed1aGH4HKQ3vMYrsmLXwmHhS1AeX33ZvDgZiyvkGhNTvGd2TA5Lr4v239Fzjj4ZY48t6wTtXUy2yRgapf37QHgt6KWEZ6bgsCLpb
|
||||
derivation.path=0/n
|
||||
watchingnode.pruned=false
|
||||
@@ -1 +0,0 @@
|
||||
user=rpc_username:rpc_password
|
||||
@@ -1 +0,0 @@
|
||||
user=rpc_username:rpc_password
|
||||
@@ -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}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
TRACING=1
|
||||
WATCHER_BTC_NODE_RPC_URL=btcnode:18332/wallet/watching01.dat
|
||||
WATCHER_BTC_NODE_RPC_USER=rpc_username:rpc_password
|
||||
WATCHER_BTC_NODE_RPC_CFG=/proxy/watcher_btcnode_curlcfg.properties
|
||||
SPENDER_BTC_NODE_RPC_URL=btcnode:18332/wallet/spending01.dat
|
||||
SPENDER_BTC_NODE_RPC_USER=rpc_username:rpc_password
|
||||
SPENDER_BTC_NODE_RPC_CFG=/proxy/spender_btcnode_curlcfg.properties
|
||||
PROXY_LISTENING_PORT=8888
|
||||
# Variable substitutions don't work
|
||||
HOME=/proxy
|
||||
DB_PATH=/proxy/db
|
||||
DB_FILE=/proxy/db/proxydb
|
||||
# Pycoin container
|
||||
PYCOIN_CONTAINER=pycoinnode:7777
|
||||
# OTS container
|
||||
OTS_CONTAINER=otsnode:6666
|
||||
|
||||
DERIVATION_PUB32=upub5GtUcgGed1aGH4HKQ3vMYrsmLXwmHhS1AeX33ZvDgZiyvkGhNTvGd2TA5Lr4v239Fzjj4ZY48t6wTtXUy2yRgapf37QHgt6KWEZ6bgsCLpb
|
||||
DERIVATION_PATH=0/n
|
||||
WATCHER_BTC_NODE_PRUNED=false
|
||||
|
||||
Reference in New Issue
Block a user