# SEND COINS TO UMAPG1PUB - ẐEN VIRTUAL BANK - EVERY 800 METERS - ;)

This commit is contained in:
fred 2023-12-05 13:56:36 +01:00
parent f5c1911773
commit d92aa2d88d
3 changed files with 23 additions and 16 deletions

View File

@ -58,18 +58,6 @@ LAT=${THIS}
LON=${WHAT}
[[ -z $LON ]] && LON=0.00
function makecoord() {
local input="$1"
if [[ ${input} =~ ^-?[0-9]+\.[0-9]$ ]]; then
input="${input}0"
elif [[ ${input} =~ ^-?[0-9]+$ ]]; then
input="${input}.00"
fi
echo "${input}"
}
# PREPARE HTTP RESPONSE (application/json)
echo "${HTTPCORS}" > ~/.zen/tmp/${MOATS}.http
sed -i "s~text/html~application/json~g" ~/.zen/tmp/${MOATS}.http

View File

@ -34,14 +34,21 @@ mkdir -p ~/.zen/tmp/${MOATS}
echo "LAT=${LAT}; LON=${LON}; UMAPNS=${TWMAPNS}"
rm ~/.zen/tmp/${MOATS}/GPS.json
## COULD TRANSERT TO my_swarm G1PUB (IPFSNODEID/MACHINE RELATED KEY)
#~ SWARMG1PUB=$(cat ~/.zen/game/myswarm_secret.dunikey | grep "pub:" | cut -d ' ' -f 2)
########## SEND COINS TO UMAPG1PUB - ẐEN VIRTUAL BANK - EVERY 800 METERS - ;)
LAT=$(makecoord $LAT)
LON=$(makecoord $LON)
UMAPG1PUB=$(${MY_PATH}/keygen -t duniter "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}")
[[ ! ${UMAPG1PUB} ]] && echo "ERROR generating UMAP WALLET ${UPLANETNAME}${LAT}/${UPLANETNAME}${LON}" && exit 1
COINS=$($MY_PATH/../tools/COINScheck.sh ${UMAPG1PUB} | tail -n 1)
echo "TRANSFERING TO UMAP (${COINS} G1) WALLET : ${UMAPG1PUB}"
## TRANSERT PLAYER WALLET TO my_swarm G1PUB (IPFSNODEID/MACHINE RELATED KEY)
SWARMG1PUB=$(cat ~/.zen/game/myswarm_secret.dunikey | grep "pub:" | cut -d ' ' -f 2)
[[ ! -z ${SWARMG1PUB} ]] \
[[ ! -z ${UMAPG1PUB} ]] \
&& ALL="ALL" \
&& [[ $ONE == "ONE" ]] && ALL=1 \
&& echo "ZEN:${ALL} WALLET MOVE" \
&& ./PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${ALL}" "${SWARMG1PUB}" "ZEN:${ALL}"
&& ./PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${ALL}" "${UMAPG1PUB}" "ZEN:${ALL}"
## REMOVING PLAYER from ASTROPORT
ipfs key rm ${PLAYER}; ipfs key rm ${PLAYER}_feed; ipfs key rm ${G1PUB};

View File

@ -412,6 +412,18 @@ myAstroTube() {
[ -n "$myAstroTube" ] && echo "$myAstroTube"
}
function makecoord() {
local input="$1"
if [[ ${input} =~ ^-?[0-9]+\.[0-9]$ ]]; then
input="${input}0"
elif [[ ${input} =~ ^-?[0-9]+$ ]]; then
input="${input}.00"
fi
echo "${input}"
}
IPFSNODEID="$(myIpfsPeerId)"
[[ ! $MOATS ]] && MOATS="$(myDate)"
isLAN="$(isLan)"