mirror of
https://github.com/aljazceru/cyphernode.git
synced 2026-01-19 20:44:21 +01:00
Cleanups, fix pid1 in containers, use proxy_ready monitor
This commit is contained in:
@@ -76,7 +76,7 @@ main() {
|
||||
case "${cmd}" in
|
||||
helloworld)
|
||||
# GET http://192.168.111.152:8080/helloworld
|
||||
response="Hello, world!"
|
||||
response='{"hello":"world"}'
|
||||
returncode=0
|
||||
# response_to_client "Hello, world!" 0
|
||||
# break
|
||||
@@ -774,11 +774,6 @@ main() {
|
||||
return 0
|
||||
}
|
||||
|
||||
export NODE_RPC_URL=$BTC_NODE_RPC_URL
|
||||
export TRACING
|
||||
export DB_PATH
|
||||
export DB_FILE
|
||||
|
||||
main
|
||||
trace "[requesthandler] exiting"
|
||||
exit $?
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
send_to_watcher_node() {
|
||||
trace "Entering send_to_watcher_node()..."
|
||||
local node_payload
|
||||
node_payload="$(send_to_bitcoin_node ${WATCHER_NODE_RPC_URL}/${WATCHER_BTC_NODE_DEFAULT_WALLET} ${WATCHER_NODE_RPC_CFG} $@)"
|
||||
node_payload="$(send_to_bitcoin_node ${WATCHER_BTC_NODE_RPC_URL}/${WATCHER_BTC_NODE_DEFAULT_WALLET} ${WATCHER_BTC_NODE_RPC_CFG} $@)"
|
||||
local returncode=$?
|
||||
trace_rc ${returncode}
|
||||
if [ "${returncode}" -ne 0 ]; then
|
||||
@@ -22,7 +22,7 @@ send_to_watcher_node() {
|
||||
send_to_xpub_watcher_wallet() {
|
||||
trace "Entering send_to_xpub_watcher_wallet()..."
|
||||
|
||||
send_to_bitcoin_node ${WATCHER_NODE_RPC_URL}/${WATCHER_BTC_NODE_XPUB_WALLET} ${WATCHER_NODE_RPC_CFG} $@
|
||||
send_to_bitcoin_node ${WATCHER_BTC_NODE_RPC_URL}/${WATCHER_BTC_NODE_XPUB_WALLET} ${WATCHER_BTC_NODE_RPC_CFG} $@
|
||||
local returncode=$?
|
||||
trace_rc ${returncode}
|
||||
return ${returncode}
|
||||
@@ -33,7 +33,7 @@ send_to_watcher_node_wallet() {
|
||||
local walletname=$1
|
||||
shift
|
||||
trace "[send_to_watcher_node_wallet] walletname=${walletname}"
|
||||
send_to_bitcoin_node ${WATCHER_NODE_RPC_URL}/${walletname} ${WATCHER_NODE_RPC_CFG} $@
|
||||
send_to_bitcoin_node ${WATCHER_BTC_NODE_RPC_URL}/${walletname} ${WATCHER_BTC_NODE_RPC_CFG} $@
|
||||
local returncode=$?
|
||||
trace_rc ${returncode}
|
||||
return ${returncode}
|
||||
@@ -42,7 +42,7 @@ send_to_watcher_node_wallet() {
|
||||
send_to_spender_node()
|
||||
{
|
||||
trace "Entering send_to_spender_node()..."
|
||||
send_to_bitcoin_node ${SPENDER_NODE_RPC_URL}/${SPENDER_BTC_NODE_DEFAULT_WALLET} ${SPENDER_NODE_RPC_CFG} $@
|
||||
send_to_bitcoin_node ${SPENDER_BTC_NODE_RPC_URL}/${SPENDER_BTC_NODE_DEFAULT_WALLET} ${SPENDER_BTC_NODE_RPC_CFG} $@
|
||||
local returncode=$?
|
||||
trace_rc ${returncode}
|
||||
return ${returncode}
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
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:]]*$//'
|
||||
}
|
||||
@@ -51,4 +42,4 @@ if [ "${FEATURE_LIGHTNING}" = "true" ]; then
|
||||
./waitanyinvoice.sh &
|
||||
fi
|
||||
|
||||
nc -vlkp${PROXY_LISTENING_PORT} -e ./requesthandler.sh
|
||||
exec nc -vlkp${PROXY_LISTENING_PORT} -e ./requesthandler.sh
|
||||
|
||||
Reference in New Issue
Block a user