MULTICANAL : FRED : Work in Progress ...
This commit is contained in:
parent
206e10582b
commit
3e226ac676
|
@ -19,12 +19,15 @@ cd $GPATH
|
|||
|
||||
if [[ "$USER" != "root" ]]; then echo "Hey, $USER you must at least be admin of your system (sudo $0)"; exit; fi
|
||||
YOU=$(ps aux --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1)
|
||||
if [[ "$YOU" == "" || "$YOU" == "root" ]]; then echo "BAD IPFS. Aucune installation IPFS satisfaisante ici... Ciao $YOU !"; exit; fi
|
||||
IPFSNODEID=$(su $YOU -c "ipfs id -f='<id>\n'")
|
||||
# UIDNA NODE
|
||||
[[ -f ./wallets/.$IPFSNODEID/$IPFSNODEID.uidna ]] && UIDNA=$(cat ./wallets/.$IPFSNODEID/$IPFSNODEID.uidna) || UIDNA="ssh"
|
||||
su $YOU -c "ipfs p2p close --all"
|
||||
su $YOU -c "ipfs p2p listen /x/$UIDNA /ip4/127.0.0.1/tcp/22"
|
||||
su $YOU -c "ipfs p2p listen /x/$IPFSNODEID /ip4/127.0.0.1/tcp/80"
|
||||
echo $(su $YOU -c "ipfs p2p ls")
|
||||
|
||||
su $YOU -c "ipfs p2p close --all"
|
||||
su $YOU -c "ipfs p2p listen /x/ssh /ip4/127.0.0.1/tcp/22"
|
||||
su $YOU -c "ipfs p2p listen /x/http /ip4/127.0.0.1/tcp/80"
|
||||
su $YOU -c "ipfs p2p listen /x/https /ip4/127.0.0.1/tcp/443"
|
||||
$(su $YOU -c "ipfs p2p ls")
|
||||
|
||||
echo "==================================
|
||||
CONNECT TO XPORT = ssh, http, https
|
||||
XPORT=ssh
|
||||
LOCALPORT=$((10000 + RANDOM % 64000))
|
||||
ipfs p2p forward /x/$XPORT /ip4/127.0.0.1/tcp/$LOCALPORT /ipfs/$IPFSNODEID"
|
||||
|
|
|
@ -42,7 +42,7 @@ while read line
|
|||
|
||||
sms_INIT_ACCOUNT "$PHONE" "NOSMS"
|
||||
# echo -salt="$PHONE" -password="$PIN" --amount="$VIR" --output="$DESTRIB" --comment="[G1sms+] VIR $REF / $NB"
|
||||
PAY=$(./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$VIR" --output="$DESTRIB" --comment="[G1sms+] VIR $REF / $NB" -y)
|
||||
PAY=$(./silkaj/silkaj transaction --auth-scrypt -salt="$UIDNA" -password="$PIN" --amount="$VIR" --output="$DESTRIB" --comment="[G1sms+] VIR $REF / $NB" -y)
|
||||
if [[ "$(echo $PAY | cut -d '|' -f 1)" == "KO" ]]; then
|
||||
new=$(./shell/checknodes.sh "BAN")
|
||||
sms_ERROR "$PHONE" "Il est survenu un problème avec votre virement. Retour silkaj: $PAY ... $new";
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
duniter.dethegeek.eu.org:443
|
||||
duniter.moul.re:443
|
||||
g1.duniter.fr:443
|
||||
g1.duniter.org:443
|
||||
g1.le-sou.org:443
|
||||
|
|
|
@ -4,8 +4,22 @@
|
|||
# Version: 0.1
|
||||
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
||||
################################################################################
|
||||
source ./shell/init.sh
|
||||
source ./shell/functions.sh
|
||||
MY_PATH="`dirname \"$0\"`" # relative
|
||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||
if [[ -f $MY_PATH/.profile ]]; then
|
||||
source $MY_PATH/.profile
|
||||
elif [[ -f $MY_PATH/../.profile ]]; then
|
||||
source $MY_PATH/../.profile
|
||||
else
|
||||
echo -e "${c_red}Le .profile n'existe pas$c_"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#source $GPATH/shell/tata.sh || echo "pas trouvé"
|
||||
|
||||
source $GPATH/shell/init.sh
|
||||
source $GPATH/shell/functions.sh
|
||||
[[ $1 == "chat" ]] && echo "Bonjours chat" && exit 0
|
||||
log "X sms_AIDE.sh ($1=phone)"
|
||||
|
||||
sms_INIT_ACCOUNT "$1" "NOSMS"
|
||||
|
|
|
@ -101,7 +101,7 @@ then
|
|||
log_history $PHONE "G1BILLET, $TRANSAC, $BILLETPUBKEY"
|
||||
sleep 3
|
||||
# Fill BILLET with TRANSAC amount
|
||||
PAY=$(./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$TRANSAC" --output="$BILLETPUBKEY" --comment="G1Billet $NUMBER" -y)
|
||||
PAY=$(./silkaj/silkaj transaction --auth-scrypt -salt="$UIDNA" -password="$PIN" --amount="$TRANSAC" --output="$BILLETPUBKEY" --comment="G1Billet $NUMBER" -y)
|
||||
if [[ "$(echo $PAY | cut -d '|' -f 1)" != "KO" ]]; then
|
||||
# NOTES ARE FILES STORED IN DICEWARE COMPOSED SUBDIR
|
||||
echo "$(date +%Y%m%d)" > "./billets/$bpath/note.creationdate"
|
||||
|
@ -136,7 +136,7 @@ then
|
|||
|
||||
# + G1SMS Commission
|
||||
sleep 2
|
||||
COM=$(./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$BILLCOM" --output="$NODE_G1PUBKEY" --comment="[G1sms+] Achat G1Billets" -y)
|
||||
COM=$(./silkaj/silkaj transaction --auth-scrypt -salt="$UIDNA" -password="$PIN" --amount="$BILLCOM" --output="$NODE_G1PUBKEY" --comment="[G1sms+] Achat G1Billets" -y)
|
||||
|
||||
# POUR IMPRIMER LES BILLETS! Brancher votre imprimante, configurer cups, activer code lp ;)
|
||||
num=$(date +%Y%m%d)
|
||||
|
|
|
@ -12,10 +12,10 @@ PHONE="$1"
|
|||
MEMBERUID="$2"
|
||||
TODAY=$(date '+%Y%m%d')
|
||||
|
||||
if [[ -f "./wallets/$PHONE/VIREMENTS" ]]; then
|
||||
if [[ -f "./wallets/PHONE/$PHONE/VIREMENTS" ]]; then
|
||||
# CHECK IF ALL DONE.
|
||||
log "__SUB:sms_DESTROY.sh: FOUND "./wallets/$PHONE/VIREMENTS" decrypting with Node key"
|
||||
echo "${GPGPASS}" | gpg -d -q --output "/tmp/VIREMENTS.$PHONE" --yes --pinentry-mode loopback --passphrase-fd 0 "./wallets/$PHONE/VIREMENTS.gpg"
|
||||
log "__SUB:sms_DESTROY.sh: FOUND "./wallets/PHONE/$PHONE/VIREMENTS" decrypting with Node key"
|
||||
echo "${GPGPASS}" | gpg -d -q --output "/tmp/VIREMENTS.$PHONE" --yes --pinentry-mode loopback --passphrase-fd 0 "./wallets/PHONE/$PHONE/VIREMENTS.gpg"
|
||||
for next in $(cat /tmp/VIREMENTS.$PHONE | cut -d ' ' -f 1); do
|
||||
if [[ $next -ge $TODAY ]]; then
|
||||
log "__SUB:sms_DESTROY.sh: VIREMENT $next >= $TODAY"
|
||||
|
@ -36,9 +36,9 @@ if [[ "$MEMBERUID" == "DON" || "$MEMBERUID" == "" || "$MEMBERUID" == "$MEMBER" ]
|
|||
|
||||
AMOUNTG1=$(./silkaj/silkaj amount "$PUBKEY")
|
||||
GETLIMIT=$(bc <<< "$AMOUNTG1 - $LIMIT")
|
||||
PAY=$(./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$GETLIMIT" --output="$MEMRIB" --comment="[G1sms+] Wallet DESTROY $MEMBER $MEMBERUID" -y)
|
||||
PAY=$(./silkaj/silkaj transaction --auth-scrypt -salt="$UIDNA" -password="$PIN" --amount="$GETLIMIT" --output="$MEMRIB" --comment="[G1sms+] Wallet DESTROY $MEMBER $MEMBERUID" -y)
|
||||
sleep 5
|
||||
back=$(./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$LIMIT" --output="$NODEPUB" --comment="[G1sms+] Wallet DESTROY Send $LIMIT To NODE" -y)
|
||||
back=$(./silkaj/silkaj transaction --auth-scrypt -salt="$UIDNA" -password="$PIN" --amount="$LIMIT" --output="$NODEPUB" --comment="[G1sms+] Wallet DESTROY Send $LIMIT To NODE" -y)
|
||||
|
||||
if [[ "$(echo $PAY | cut -d '|' -f 1)" != "KO" && "$PAY" != "" && "$(echo $back | cut -d '|' -f 1)" != "KO" ]]; then
|
||||
# DESTROY FILESYSTEM AND G1sms WALLET SWARM REFERENCE
|
||||
|
@ -54,8 +54,8 @@ $ADMINPSEUDO @ $NODEUIDNA
|
|||
$back"
|
||||
sms_SEND "$PHONE" "$mess"
|
||||
|
||||
rm -Rf ./wallets/$PHONE;
|
||||
rm -Rf ./wallets_swarm/$PHONE;
|
||||
rm -Rf ./wallets/PHONE/$PHONE;
|
||||
rm -Rf ./wallets_swarm/PHONE/$HASHLINK;
|
||||
cents=$(echo $(bc -l <<< "scale=0; $GETLIMIT * 100") | cut -d '.' -f 1)
|
||||
move_g1cents "$PHONE" "$MEMRIB" "$cents"
|
||||
cents=$(echo $(bc -l <<< "scale=0; $LIMIT * 100") | cut -d '.' -f 1)
|
||||
|
|
|
@ -16,7 +16,7 @@ log "__SUB:sms_EMAIL.sh.sh: START ($1=phone, $2=mail)"
|
|||
phone="$1"
|
||||
mail="$2"
|
||||
|
||||
MAILFILE="./wallets/$phone/$phone.email" # Contains the member EMAIL (Send BILLET)
|
||||
MAILFILE="./wallets/PHONE/$phone/_email" # Contains the member EMAIL (Send BILLET)
|
||||
|
||||
# Initialise PHONE, PIN, PUBKEY, UNIT ...
|
||||
sms_INIT_ACCOUNT "$phone" "NOSMS"
|
||||
|
@ -27,7 +27,10 @@ Envoyez N suivi de votre pseudo membre (en respectant Majuscule et minuscule)."
|
|||
fi
|
||||
|
||||
if [[ "$mail" != "" ]]; then
|
||||
# STORE EMAIL AND NODE CYPHER IT BEFORE PUSH TO IPFS
|
||||
echo "$mail" > "$MAILFILE"
|
||||
./shell/natools.py encrypt -p $NODE_G1PUBKEY -i "$MAILFILE" -o "$MAILFILE.node.crypt"
|
||||
echo "" > "$MAILFILE"
|
||||
log "__SUB:sms_EMAIL.sh.sh: EMAIL $MEMBER ($PHONE) NOUVEAU: $mail... Publishing to IPFS"
|
||||
ipfs_node_wallets_add
|
||||
else
|
||||
|
|
|
@ -79,8 +79,8 @@ fi
|
|||
|
||||
##### IS G1DAB NODE?
|
||||
if [[ ! $PASSENGER && ! $G1DAB ]]; then
|
||||
if [[ -f ./wallets/$PHONE/ipfsid.G1TAGNODE ]]; then
|
||||
DABnode=$(cat ./wallets/$PHONE/ipfsid.G1TAGNODE)
|
||||
if [[ -f ./wallets/PHONE/$PHONE/MASTERPHONE.ipfsid ]]; then
|
||||
DABnode=$(cat ./wallets/PHONE/$PHONE/MASTERPHONE.ipfsid)
|
||||
if [[ "$DABnode" == "$IPFSNODEID" ]]; then
|
||||
sms_ERROR "$PHONE" "IMPRIMANTE G1Tag non détectée!! Choisissez un autre G1Dab... $spot"
|
||||
log "__SUB:sms_G1TAG.sh: IMPRIMANTE G1Tag non détectée!!"
|
||||
|
@ -100,7 +100,7 @@ fi
|
|||
###########################################
|
||||
# PAY VIR + PERCENT G1
|
||||
ML=$(bc -l <<< "scale=2; $VIR + $PERCENT")
|
||||
PAY=$(./shell/timeout.sh -t 29 ./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$ML" --output="$NODE_G1PUBKEY" --comment="[G1sms+] ACHAT $3 G1Tag(s) - $2 $UNIT" -y)
|
||||
PAY=$(./shell/timeout.sh -t 29 ./silkaj/silkaj transaction --auth-scrypt -salt="$UIDNA" -password="$PIN" --amount="$ML" --output="$NODE_G1PUBKEY" --comment="[G1sms+] ACHAT $3 G1Tag(s) - $2 $UNIT" -y)
|
||||
if [[ "$PAY" == "" || "$(echo $PAY | cut -d '|' -f 1)" == "KO" ]]; then
|
||||
new=$(./shell/checknodes.sh "BAN")
|
||||
sms_ERROR "$PHONE" "Il est survenu un problème lors de votre virement: $PAY / Silkaj: $new";
|
||||
|
@ -217,8 +217,8 @@ TAGCHAIN="./TAG/${RR}/TAG_chain" # contains IPFS current ipfs hash
|
|||
composite -compose Over -resize 133% -gravity West "./TAG/${RR}/TAG_READ.png" "./shell/g1tag.png" "./TAG/${RR}/${RR}.png"
|
||||
composite -compose Over -gravity SouthEast "./TAG/${RR}/TAG_WRITE.png" "./TAG/${RR}/${RR}.png" "./TAG/${RR}/${RR}.png"
|
||||
# ADD Avatar in the Center
|
||||
# if [[ $(file "./wallets/$PHONE/$PHONE.avatar.png" | grep 'PNG') ]]; then
|
||||
# composite -compose Over -resize 150% -gravity Center "./wallets/$PHONE/$PHONE.avatar.png" "./TAG/${RR}/${RR}.png" "./TAG/${RR}/${RR}.png"
|
||||
# if [[ $(file "./wallets/PHONE/$PHONE/_avatar.png" | grep 'PNG') ]]; then
|
||||
# composite -compose Over -resize 150% -gravity Center "./wallets/PHONE/$PHONE/_avatar.png" "./TAG/${RR}/${RR}.png" "./TAG/${RR}/${RR}.png"
|
||||
# else
|
||||
# composite -compose Over -resize 100% -gravity Center "./shell/G1Anar.png" "./TAG/${RR}/${RR}.png" "./TAG/${RR}/${RR}.png"
|
||||
# fi
|
||||
|
@ -234,22 +234,23 @@ TAGCHAIN="./TAG/${RR}/TAG_chain" # contains IPFS current ipfs hash
|
|||
# ROTATION (FIXE AVATAR & CHIFFRE)?
|
||||
# convert "./TAG/${RR}/${RR}.png" -rotate -180 "./TAG/${RR}/${RR}.png"
|
||||
# QL-700 PRINT PREPARE
|
||||
if [[ -f "./wallets/$PHONE/ipfsid.G1TAGNODE" ]]; then
|
||||
destnode=$(cat "./wallets/$PHONE/ipfsid.G1TAGNODE")
|
||||
if [[ -f "./wallets/PHONE/$PHONE/MASTERPHONE.ipfsid" ]]; then
|
||||
destnode=$(cat "./wallets/PHONE/$PHONE/MASTERPHONE.ipfsid")
|
||||
if [[ "$destnode" == "" || "$destnode" == "$IPFSNODEID" ]]; then
|
||||
log "__SUB:sms_G1TAG.sh: Local PRINT ${RR} # ipfs ls /ipns/${J}"
|
||||
brother_ql_create --model QL-700 "./TAG/${RR}/${RR}.png" --label-size 62 > "./TAG/${RR}/${RR}.bin"
|
||||
brother_ql_print "./TAG/${RR}/${RR}.bin" /dev/usb/lp0
|
||||
else
|
||||
# PRINT ON ANOTHER G1Dab. Send files to G1Tag Printer TODO: Could use DESTNODEPUB instead of NODE_G1PUBKEY ?
|
||||
log "__SUB:sms_G1TAG.sh: Remote PRINT :: ./wallets/.$destnode/PRINT/${RR}.bin "
|
||||
# PRINT ON ANOTHER G1Dab. Send files to G1Tag Printer Use .$destnode/_pub CRYPTINGKEY ?
|
||||
CRYPTINGKEY=$(cat ./wallets_swarm/.$destnode/_pub)
|
||||
log "__SUB:sms_G1TAG.sh: Remote PRINT :: ./wallets/.$destnode/PRINT/${RR}.png.node.crypt ($CRYPTINGKEY)"
|
||||
mkdir -p "./wallets/.$destnode/PRINT/"
|
||||
./shell/natools.py encrypt -p $NODE_G1PUBKEY -i "./TAG/${RR}/${RR}.png" -o "./wallets/.$destnode/PRINT/${RR}.bin"
|
||||
./shell/natools.py encrypt -p $CRYPTINGKEY -i "./TAG/${RR}/${RR}.png" -o "./wallets/.$destnode/PRINT/${RR}.png.node.crypt"
|
||||
fi
|
||||
else
|
||||
#
|
||||
log "__SUB:sms_G1TAG.sh: Becoming default PRINTER :: $IPFSNODEID"
|
||||
echo "$IPFSNODEID" > "./wallets/$PHONE/ipfsid.G1TAGNODE"
|
||||
echo "$IPFSNODEID" > "./wallets/PHONE/$PHONE/ipfsid.G1TAGNODE"
|
||||
brother_ql_create --model QL-700 "./TAG/${RR}/${RR}.png" --label-size 62 > "./TAG/${RR}/${RR}.bin"
|
||||
brother_ql_print "./TAG/${RR}/${RR}.bin" /dev/usb/lp0
|
||||
destnode="$IPFSNODEID"
|
||||
|
@ -259,14 +260,14 @@ done
|
|||
|
||||
if [[ "$destnode" == "" || "$destnode" == "$IPFSNODEID" ]]; then
|
||||
# PRINT $PHONE WALLET PUBKEY
|
||||
qrencode -s 5 -o "/tmp/G1PubQR.$PHONE.png" "$(cat ./wallets/$PHONE/$PHONE.pub)"
|
||||
qrencode -s 5 -o "/tmp/G1PubQR.$PHONE.png" "$(cat ./wallets/PHONE/$PHONE/_pub)"
|
||||
composite -compose Over -gravity West "/tmp/G1PubQR.$PHONE.png" "./shell/g1tag.png" "/tmp/G1PubQR.$PHONE.png"
|
||||
|
||||
if [[ $(file "./wallets/$PHONE/$PHONE.avatar.png" | grep 'PNG') ]]; then
|
||||
composite -compose Over -gravity Center "./wallets/$PHONE/$PHONE.avatar.png" "/tmp/G1PubQR.$PHONE.png" "/tmp/G1PubQR.$PHONE.png"
|
||||
if [[ $(file "./wallets/PHONE/$PHONE/_avatar.png" | grep 'PNG') ]]; then
|
||||
composite -compose Over -gravity Center "./wallets/PHONE/$PHONE/_avatar.png" "/tmp/G1PubQR.$PHONE.png" "/tmp/G1PubQR.$PHONE.png"
|
||||
fi
|
||||
if [[ -f ./wallets/$PHONE/$PHONE.uidrib ]]; then
|
||||
qrencode -s 6 -o "/tmp/G1MemQR.$PHONE.png" "$(cat ./wallets/$PHONE/$PHONE.uidrib)";
|
||||
if [[ -f ./wallets/PHONE/$PHONE/_uidrib ]]; then
|
||||
qrencode -s 6 -o "/tmp/G1MemQR.$PHONE.png" "$(cat ./wallets/PHONE/$PHONE/_uidrib)";
|
||||
composite -compose Over -gravity SouthEast "/tmp/G1MemQR.$PHONE.png" "/tmp/G1PubQR.$PHONE.png" "/tmp/G1PubQR.$PHONE.png" && rm /tmp/G1MemQR.$PHONE.png
|
||||
fi
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ PHONEDEST="$2"
|
|||
# Initialise PHONE, PIN, PUBKEY, UNIT
|
||||
sms_INIT_ACCOUNT "$phone" "NOSMS"
|
||||
pin=$PIN
|
||||
uidna=$UIDNA
|
||||
if [[ $UNKNOWN == "unknown" ]]; then
|
||||
sms_ERROR "$phone" "Porte-monnaie inconnu. Envoyez N (suivi de votre Pseudo membre) pour le créer."
|
||||
exit
|
||||
|
@ -36,12 +37,13 @@ fi
|
|||
|
||||
# Add COUNTRY code to PHONEDEST + PHONEDEST INIT
|
||||
PHONEDEST="$COUNTRY${PHONEDEST:1:10}"
|
||||
HASHLINKDEST=$(echo -n $PHONEDEST | sha256sum | cut -d ' ' -f 1)
|
||||
|
||||
# CHECK if PHONEDEST have an account in IPFS G1sms+ SWARM
|
||||
if [[ -f "./wallets_swarm/$PHONEDEST/$PHONEDEST.pub" ]]
|
||||
if [[ -f "./wallets_swarm/PHONE/$HASHLINKDEST/_pub" ]]
|
||||
then
|
||||
PUBKEYDEST=$(cat "./wallets_swarm/$PHONEDEST/$PHONEDEST.pub")
|
||||
UNITDEST=$(cat "./wallets_swarm/$PHONEDEST/$PHONEDEST.unit")
|
||||
PUBKEYDEST=$(cat "./wallets_swarm/PHONE/$HASHLINKDEST/_pub")
|
||||
UNITDEST=$(cat "./wallets_swarm/PHONE/$HASHLINKDEST/_unit")
|
||||
log "__SUB:sms_PAY.sh: PUBKEYDEST found in swarn... $PUBKEYDEST"
|
||||
else
|
||||
# NO, then create NEW Wallet
|
||||
|
@ -53,8 +55,8 @@ else
|
|||
fi
|
||||
|
||||
# Payement
|
||||
log "./silkaj/silkaj transaction --auth-scrypt -salt="$phone" -password="$pin" --amount="$VIR" --output="$PUBKEYDEST""
|
||||
PAY=$(./shell/timeout.sh -t 30 ./silkaj/silkaj transaction --auth-scrypt -salt="$phone" -password="$pin" --amount="$VIR" --output="$PUBKEYDEST" --comment="[G1sms+] PAY $AMOUNT $UNIT" -y)
|
||||
log "./silkaj/silkaj transaction --auth-scrypt -salt="$uidna" -password="$pin" --amount="$VIR" --output="$PUBKEYDEST""
|
||||
PAY=$(./shell/timeout.sh -t 30 ./silkaj/silkaj transaction --auth-scrypt -salt="$uidna" -password="$pin" --amount="$VIR" --output="$PUBKEYDEST" --comment="[G1sms+] PAY $AMOUNT $UNIT" -y)
|
||||
if [[ "$(echo $PAY | cut -d '|' -f 1)" == "KO" || "$PAY" == "" ]]; then
|
||||
sms_ERROR "$phone" "PIN : $PAY ? Voyez vous votre code secret: $pin?
|
||||
NON, Reinitaliser Compte. Envoyer: RAZ
|
||||
|
@ -70,8 +72,8 @@ fi
|
|||
sleep 2
|
||||
|
||||
# + G1SMS Commission
|
||||
log "./silkaj/silkaj transaction --auth-scrypt -salt="$phone" -password="$pin" --amount="$PERCENT" --output="$NODE_G1PUBKEY""
|
||||
COM=$(./shell/timeout.sh -t 30 ./silkaj/silkaj transaction --auth-scrypt -salt="$phone" -password="$pin" --amount="$PERCENT" --output="$NODE_G1PUBKEY" --comment="[G1sms+] P Commission" -y)
|
||||
log "./silkaj/silkaj transaction --auth-scrypt -salt="$uidna" -password="$pin" --amount="$PERCENT" --output="$NODE_G1PUBKEY""
|
||||
COM=$(./shell/timeout.sh -t 30 ./silkaj/silkaj transaction --auth-scrypt -salt="$uidna" -password="$pin" --amount="$PERCENT" --output="$NODE_G1PUBKEY" --comment="[G1sms+] P Commission" -y)
|
||||
if [[ "$(echo $COM | cut -d '|' -f 1)" == "KO" || "$COM" == "" ]]; then
|
||||
sms_ERROR "$phone" "Problème de bourrage blockchain : $COM";
|
||||
log "__SUB:sms_PAY.sh: Problème de payement avec silkaj : $COM"
|
||||
|
|
|
@ -41,7 +41,7 @@ esac
|
|||
###########################################################
|
||||
# Initialise PHONE, PIN, PUBKEY, UNIT
|
||||
sms_INIT_ACCOUNT "$PHONE" "NOSMS"
|
||||
if [[ $MEMBER == "" ]]; then MEMBER=$UIDNA; fi
|
||||
[[ $MEMBER == "" ]] && MEMBER=$UIDNA # Wallet self UIDNA??
|
||||
###########################################################
|
||||
# CHECK FOR ERRORS
|
||||
if [[ $UNKNOWN == "unknown" ]]; then
|
||||
|
@ -79,20 +79,20 @@ else
|
|||
log "__SUB:sms_REC.sh: SEARCH $VIRDEST related wallet!!! $DESTRIB "
|
||||
DESTMEM="$VIRDEST"
|
||||
# SEARCH IN WALLETS
|
||||
LOCAL=$(grep -Rwl "$DESTMEM" ./wallets/*/*.uidname | tail -n 1 | cut -f 3 -d '/')
|
||||
if [[ "$LOCAL" == "" ]]; then LOCAL=$(grep -Rwl "$DESTMEM" ./wallets/*/*.uidna | tail -n 1 | cut -f 3 -d '/'); fi
|
||||
if [[ "$LOCAL" != "" ]]; then
|
||||
# LOCAL G1sms account
|
||||
DESTRIB=$(cat ./wallets/$LOCAL/$LOCAL.pub)
|
||||
DESTPHONE=$LOCAL
|
||||
log "__SUB:sms_REC.sh: FOUND LOCAL ($MASTERPHONE) G1sms+ wallet: $DESTRIB ($LOCAL)"
|
||||
LOCALPHONE=$(grep -Rwl "$DESTMEM" ./wallets/PHONE/*/_uidname | tail -n 1 | cut -f 4 -d '/')
|
||||
[[ ! $LOCALPHONE ]] && LOCALPHONE=$(grep -Rwl "$DESTMEM" ./wallets/PHONE/*/_uidna | tail -n 1 | cut -f 4 -d '/')
|
||||
if [[ "$LOCALPHONE" != "" ]]; then
|
||||
# LOCALPHONE G1sms account
|
||||
DESTRIB=$(cat ./wallets/PHONE/$LOCALPHONE/_pub)
|
||||
DESTPHONE=$LOCALPHONE
|
||||
log "__SUB:sms_REC.sh: FOUND LOCALPHONE ($MASTERPHONE) G1sms+ wallet: $DESTRIB ($LOCALPHONE)"
|
||||
else
|
||||
# SEARCH IN WALLETS SWARM (MEMBER THEN UIDNA)
|
||||
INSWARM=$(grep -Rwl "$DESTMEM" ./wallets_swarm/*/*.uidname | tail -n 1 | cut -f 3 -d '/')
|
||||
if [[ "$INSWARM" == "" ]]; then INSWARM=$(grep -Rwl "$DESTMEM" ./wallets_swarm/*/*.uidna | tail -n 1 | cut -f 3 -d '/'); fi
|
||||
INSWARMHASH=$(grep -Rwl "$DESTMEM" ./wallets_swarm/PHONE/*/_uidname | tail -n 1 | cut -f 4 -d '/')
|
||||
[[ ! $INSWARMHASH ]] && INSWARMHASH=$(grep -Rwl "$DESTMEM" ./wallets_swarm/PHONE/*/_uidna | tail -n 1 | cut -f 4 -d '/')
|
||||
if [[ "$INSWARM" != "" ]]; then
|
||||
REMOTENODE=$(cat ./wallets_swarm/$INSWARM/MASTERPHONE.sms)
|
||||
DESTRIB=$(cat ./wallets_swarm/$INSWARM/$INSWARM.pub)
|
||||
REMOTENODE=$(cat ./wallets_swarm/PHONE/$INSWARM/MASTERPHONE.sms)
|
||||
DESTRIB=$(cat ./wallets_swarm/PHONE/$INSWARM/_pub)
|
||||
DESTPHONE=$INSWARM
|
||||
log "__SUB:sms_REC.sh: FOUND SWARM ($REMOTENODE) G1sms+ wallet: $DESTRIB ($INSWARM)"
|
||||
else
|
||||
|
@ -106,7 +106,7 @@ fi
|
|||
# ADD DATES TO VIREMENTS
|
||||
if [[ "$DESTRIB" != "" ]]; then
|
||||
log "__SUB:sms_REC.sh: TRAITEMENT DU VIREMENT DE $AMOUNT $UNIT = 1ER VIREMENT de $VIR G1 vers $VIRDEST ($DESTRIB) $TIME FOIS. OK..."
|
||||
PAY=$(./shell/timeout.sh -t 20 ./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$VIR" --output="$DESTRIB" --comment="[G1sms+] REC 1/$TIME ($PERIOD)" -y)
|
||||
PAY=$(./shell/timeout.sh -t 20 ./silkaj/silkaj transaction --auth-scrypt -salt="$UIDNA" -password="$PIN" --amount="$VIR" --output="$DESTRIB" --comment="[G1sms+] REC 1/$TIME ($PERIOD)" -y)
|
||||
if [[ "$(echo $PAY | cut -d '|' -f 1)" == "KO" || "$PAY" == "" ]]; then
|
||||
new=$(./shell/checknodes.sh "BAN")
|
||||
sms_ERROR "$PHONE" "Problème de payement avec silkaj (changement de serveur $new): $PAY";
|
||||
|
|
|
@ -73,7 +73,7 @@ else
|
|||
fi
|
||||
|
||||
if [[ "$DESTRIB" != "" ]]; then
|
||||
PAY=$(./shell/timeout.sh -t 30 ./silkaj/silkaj transaction --auth-scrypt -salt="$PHONE" -password="$PIN" --amount="$VIR" --output="$DESTRIB" --comment="[G1sms+] VIR $VIR G1" -y)
|
||||
PAY=$(./shell/timeout.sh -t 30 ./silkaj/silkaj transaction --auth-scrypt -salt="$UIDNA" -password="$PIN" --amount="$VIR" --output="$DESTRIB" --comment="[G1sms+] VIR $VIR G1" -y)
|
||||
if [[ "$(echo $PAY | cut -d '|' -f 1)" != "KO" && "$PAY" != "" ]]; then
|
||||
log "__SUB:sms_VIR.sh: VIREMENT VERS $DESTMEM OK"
|
||||
mess="[G1sms+] $MEMBER
|
||||
|
|
|
@ -21,19 +21,19 @@ Envoyez N pour créer votre portefeuille G1sms"
|
|||
fi
|
||||
|
||||
if [[ "$askeduidna" == "" ]]; then #SELF
|
||||
if [[ -f "./wallets/.$IPFSNODEID/$IPFSNODEID.uidna" ]]; then
|
||||
nodeuidnafile="./wallets/.$IPFSNODEID/$IPFSNODEID.uidna"
|
||||
if [[ -f "./wallets/.$IPFSNODEID/_uidna" ]]; then
|
||||
nodeuidnafile="./wallets/.$IPFSNODEID/_uidna"
|
||||
uidna=$(cat $nodeuidnafile)
|
||||
fi
|
||||
else
|
||||
nodeuidnafile=$(grep -Rwl "$askeduidna" ./wallets_swarm/.*/*.uidna)
|
||||
nodeuidnafile=$(grep -Rwl "$askeduidna" ./wallets_swarm/.Qm*/_uidna | tail -n 1)
|
||||
uidna=$(cat $nodeuidnafile)
|
||||
fi
|
||||
|
||||
if [[ -f $nodeuidnafile && "$uidna" != "" ]]; then
|
||||
ipfsnodeid=$(echo $nodeuidnafile | cut -d '/' -f 3 | cut -d '.' -f 2 )
|
||||
echo $uidna > ./wallets/$PHONE/uidna.G1TAGNODE
|
||||
echo $ipfsnodeid > ./wallets/$PHONE/ipfsid.G1TAGNODE
|
||||
echo $uidna > ./wallets/PHONE/$PHONE/uidna.G1TAGNODE
|
||||
echo $ipfsnodeid > ./wallets/PHONE/$PHONE/ipfsid.G1TAGNODE
|
||||
log "__SUB:sms_WHERE.sh: Distributeur de G1Tag $uidna : $ipfsnodeid "
|
||||
I=$(ipfs_node_wallets_add)
|
||||
log_history $PHONE "G1TagNode, $uidna, $ipfsnodeid"
|
||||
|
@ -47,7 +47,7 @@ fi
|
|||
mess="[G1sms+] $MEMBER
|
||||
Votre distributeur de G1Tag par défaut est
|
||||
$uidna ($ipfsnodeid), situé:
|
||||
$(cat ./wallets_swarm/.$ipfsnodeid/$ipfsnodeid.where)"
|
||||
$(cat ./wallets_swarm/.$ipfsnodeid/_where)"
|
||||
|
||||
sms_SEND "$PHONE" "$mess"
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo yoyoyo
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
MY_PATH="`dirname \"$0\"`" # relative
|
||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||
pwd=$(pwd)
|
||||
|
||||
if [[ -f $MY_PATH/.profile ]]; then
|
||||
source $MY_PATH/.profile
|
||||
elif [[ -f $MY_PATH/../.profile ]]; then
|
||||
source $MY_PATH/../.profile
|
||||
else
|
||||
echo -e "${c_red}Le .profile n'existe pas$c_"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source $GPATH/shell/tata.sh || echo "pas trouvé"
|
||||
|
||||
echo "je suis là: $GPATH/shell !"
|
||||
|
||||
#$GPATH/shell/sms_AIDE.sh $1
|
||||
|
||||
exit 0
|
|
@ -2,4 +2,4 @@ SILKAJ_VERSION = "silkaj 0.5.0"
|
|||
NO_MATCHING_ID = "No matching identity"
|
||||
G1_SYMBOL = "Ğ1"
|
||||
GTEST_SYMBOL = "ĞTest"
|
||||
G1_DEFAULT_ENDPOINT = "duniter.moul.re", "443"
|
||||
G1_DEFAULT_ENDPOINT = "duniter-g1.p2p.legal", "443"
|
||||
|
|
Loading…
Reference in New Issue