touch ~/.zen/key/send => spread stargate keys to my friends

This commit is contained in:
qo-op 2021-03-19 04:02:05 +01:00
parent 582e02dc99
commit d5dbf20d94
1 changed files with 11 additions and 4 deletions

View File

@ -56,10 +56,17 @@ do
echo "AM I FRIEND WITH MY FRIEND FRIEND $whoisg1 ?"
friend_of_mine=$(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey stars -p $whoisg1 | jq -r '.yours.pseudo'); # must contains my XZUID
if [[ "$friend_of_mine" != "null" ]]; then
echo "YEAH IT IS ALSO MY FRIEND !!!"
# SHOULD WE CHECK ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$whoisg1/tryme.addr ?
stars=$(cat ~/.zen/ipfs/.${ipfsnodeid}/FRIENDS/$friend_of_mine/stars.level)
echo "STARGATE_$stars !!! "
if [[ -f ~/.zen/key/send ]]; then
echo "sending new stars..." && rm -f ~/.zen/ipfs/.${ipfsnodeid}/FRIENDS/$friend_of_mine/$stars.encrypt
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey send -d $friend_of_mine -t "stargate_$stars" -m $(cat ~/.zen/key/$stars/key_* | base58)
$MY_PATH/tools/natools.py encrypt -p $friend_of_mine -i ~/.zen/key/$stars/key_* -o ~/.zen/ipfs/.${ipfsnodeid}/FRIENDS/$friend_of_mine/$stars.encrypt
rm -f ~/.zen/key/send
fi
# COUNT UNIQ FRIENDS
if [[ ! $(grep "$peerline" ~/.zen/A_my_swarm.txt) ]]
then