mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-17 20:55:04 +01:00
First push from Satoshi Portal's own cyphernode
This commit is contained in:
46
proxy_docker/app/script/bitcoin.sh
Normal file
46
proxy_docker/app/script/bitcoin.sh
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
|
||||
. ./trace.sh
|
||||
. ./utils.sh
|
||||
|
||||
deriveindex()
|
||||
{
|
||||
trace "Entering 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")
|
||||
# pub32=$(grep "derivation.pub32" config.properties | cut -d'=' -f2)
|
||||
# path=$(grep "derivation.path" config.properties | cut -d'=' -f2 | sed -En "s/n/${index}/p")
|
||||
|
||||
local data="{\"pub32\":\"${pub32}\",\"path\":\"${path}\"}"
|
||||
trace "[deriveindex] data=${data}"
|
||||
|
||||
send_to_pycoin "${data}"
|
||||
return $?
|
||||
}
|
||||
|
||||
send_to_pycoin()
|
||||
{
|
||||
trace "Entering send_to_pycoin()..."
|
||||
|
||||
local data=${1}
|
||||
local result
|
||||
local returncode
|
||||
|
||||
trace "[send_to_pycoin] curl -s -H \"Content-Type: application/json\" -d \"${data}\" ${PYCOIN_CONTAINER}/derive"
|
||||
|
||||
result=$(curl -s -H "Content-Type: application/json" -d "${data}" ${PYCOIN_CONTAINER}/derive)
|
||||
returncode=$?
|
||||
trace_rc ${returncode}
|
||||
trace "[send_to_pycoin] result=${result}"
|
||||
|
||||
# Output response to stdout before exiting with return code
|
||||
echo "${result}"
|
||||
|
||||
trace_rc ${returncode}
|
||||
return ${returncode}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user