proto zen contracts in zenMake

This commit is contained in:
qo-op 2020-04-18 16:43:57 +02:00
parent f9fc6148aa
commit 7c9e0182d3
1 changed files with 5 additions and 15 deletions

View File

@ -249,26 +249,16 @@ ipfs get -o /tmp \"/ipfs/$IPASSENGER/$PASSENGERNAME\" && vlc \"/tmp/$PASSENGERNA
cat > ~/.zen/tag/${AAH}/_passenger.contract.sh <<EOF
#!/bin/bash
# THIS CODE EXECUTE CONTRACT AND DECODE IPFS LINK.
BB="$1"
[[ "$BB" == "" ]] && echo "ERRROR You need a BB Key to decode your ipfs link to $PASSENGERNAME" && exit 1
# TODO ADD ZEN PAYMENT and Init P2P contract...
openssl aes-256-cbc -pbkdf2 -k \"$BB\" -d -salt -in ~/.zen/tag/\"${AAH}\"/_passenger.ipfs.BB.aes -out /tmp/_passenger.ipfs
ipfs get -o /tmp \"/ipfs/$IPASSENGER/$PASSENGERNAME\" && vlc \"/tmp/$PASSENGERNAME\" 2>/dev/null
# THIS CODE INITIATE A CONTRACT
# ASK to "_ipfs.node.creator" to create a "_passenger.ipfs.NodeN.crypt"
# ADD NodeN as a consumer (first are partners)
# By one
#
exit 0
EOF
fi
########################################################################
# if [[ -d $PASSENGER ]]; then # NO FILE BY FILE IS BETTER...?!
########################################################################
# TODO # tar.gz and encrypt a whole directory #
# tar -zcf - directory | openssl aes-128-cbc -pbkdf2 -k "$BB" -salt -out directory.tar.gz.aes # Encrypt
# openssl aes-128-cbc -pbkdf2 -k "$BB" -d -salt -in directory.tar.gz.aes | tar -xz -f - # Decrypt
########################################################################
###########################################################
# Copy TAG into IPFS + ipfs name publish -k ${AA}.key
###########################################################