~/.zen/tag/${AAH}/CONTRACT.sh

This commit is contained in:
qo-op 2020-05-08 05:57:50 +02:00
parent 959852e046
commit 51e31038e5
1 changed files with 23 additions and 16 deletions

View File

@ -216,9 +216,12 @@ echo "
&& echo "$ZENSOURCE ALREADY COPIED IN IPFS SWARM. CANCEL" && exit 1 && echo "$ZENSOURCE ALREADY COPIED IN IPFS SWARM. CANCEL" && exit 1
# NO DUPLICATE # NO DUPLICATE
# ADD PASSENGER TO IPFS echo "ADDING TO IPFS................."
IPASSENGER=$(ipfs add -q "$PASSENGER" -w | tail -n 1) # ADD PASSENGER TO IPFS # COULD BE SUPER LONG !!!
IPASSENGER=$(ipfs add -q "$PASSENGER" -w | tail -n 1)*
# TODO COMPARE DISK WRITING SPEED AND AVAILABLE SPACE TO CHOOSE BEST IN SWARM
echo "......................... YES /ipfs/$IPASSENGER"
echo "$IPASSENGER" > ~/.zen/tag/${AAH}/_passenger.ipfs echo "$IPASSENGER" > ~/.zen/tag/${AAH}/_passenger.ipfs
# GET FILE NAME # GET FILE NAME
PASSENGERNAME=$(basename -- "$PASSENGER") PASSENGERNAME=$(basename -- "$PASSENGER")
@ -256,25 +259,29 @@ ipfs get -o /tmp \"/ipfs/$IPASSENGER/$PASSENGERNAME\" && vlc \"/tmp/$PASSENGERNA
" "
cat > ~/.zen/tag/${AAH}/_passenger.contract.sh <<EOF cat > ~/.zen/tag/${AAH}/CONTRACT.sh <<EOF
#!/bin/bash #!/bin/bash
# THIS CODE INITIATE A CONTRACT # Version 0.0
# ASK to "_ipfs.node.creator" (send ZenTag or G1TX) {
echo "New Contract (hit ENTER)" echo
read '# THIS CODE INITIATE A CONTRACT
# Established by/with _ipfs.node.creator
# Gives Access SSB friend + IPFS Swarm allowance to read ipfs link
echo "To get access to file : $PASSENGERNAME #In order io get access file : $PASSENGERNAME
- Send $READ Zen to $ipfsnodeid with $PASSENGERNAME in comment #You must execute that code.
Once payment received. You will get a SSB message containing your key" # ..... TODO ......
# It is bash or javascript or python
# or any language code with connection with g1, ipfs or ssb
# so it create a "_passenger.ipfs.NodeN.crypt" # or Send $READ Zen to $g1pub with $PASSENGERNAME in comment
# ADD NodeN as a consumer (each new listener is a relative partners) # .... TODO ....
# Each day File will pay each BB key owners
# By one
#
# Once contract is validated
# NodeN will be able to decrypt _passenger.ipfs.NodeN.crypt'
exit 0 exit 0
}
EOF EOF
fi fi