#!/bin/bash ######################################################################## # Author: Fred (support@qo-op.com) # Version: 2020.03.21 # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) ######################################################################## MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" echo ' ######################################################################## # \\/// # qo-op ############# '$MY_PATH/$ME' ######################################################################## # ex: ./'$ME' # Initialize SSB + G1SSB about + IPFS Node publish ######################################################################## o__ __o __o o__ __o o__ __o o__ __o /v v\ __|> /v v\ /v v\ <| v\ /> <\ | /> <\ /> <\ / \ <\ o/ _\o____ _\o____ \o/ o/ <| _\__o__ | \_\__o__ \_\__o__ |__ _<| \\ | < > \ \ | \ \ / | \ / \ / / o o o o o o o | o <\__ __/> __|>_ <\__ __/> <\__ __/> / \ __/> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # [ASTROPORT](https://astroport.com) ######################################################################## ' ######################################################################## # ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$ipfsnodeid/G1SSB/_info ######################################################################## ipfs_process_owner=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) [[ "$ipfs_process_owner" == "" ]] && echo "ERROR ipfs daemon is not running !!" && exit 1 ipfsnodeid=$(ipfs id -f='\n') [[ $ipfsnodeid == "" ]] && echo "ERROR missing IPFS Node id !! IPFS is not installed !?" && exit 1 ######################################################################## ssbpub=$(sbotc whoami 2>/dev/null | jq -r .id) [[ $ssbpub == "" ]] && echo "ERROR ssb-server NOT running !! Please check it..." && exit 1 ######################################################################## [[ ! -f ~/.ssb/secret.dunikey ]] && $MY_PATH/tools/secret2dunikey.sh g1pub=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) ######################################################################## # IPFS LOCAL REPOSITORY for Node Identity G1 + SSB mkdir -p ~/.zen/ipfs/.$ipfsnodeid/G1SSB ## PUBLISH ABOUT MESSAGE ############################################## # IMAGE of G1 wallet QRCode qrcodefile=~/.zen/ipfs/.$ipfsnodeid/G1SSB/_g1.qrcode.png qrencode -s 5 -o $qrcodefile "$g1pub" # Prepare QRCode File for SSB name=${qrcodefile##*/} id="$(sbotc blobs.add < $qrcodefile)" type="$(file -b --mime-type $qrcodefile)" size="$(wc -c < $qrcodefile)" echo " /\ |_ _ _|_ /--\|_)(_)|_||_ : PUBLISH to SSB feed... $ssbpub -- sbot publish -- " sbot publish --type about --about $ssbpub --description "Welcome to [Astroport](https://astroport.com) G1SSB/IPFS Station [$ipfsnodeid](http://localhost:8080/ipns/$ipfsnodeid)" --name "$USER@$(cat /etc/hostname)" --image "$id" echo " _ _ / \|_) _ _ _| _ \_X| \ (_(_)(_|(/_ $g1pub ~/.zen/ipfs/.$ipfsnodeid/G1SSB/_g1.qrcode.png -- sbotc publish -- " sbotc publish '{"type":"post","text":"[G1SSB_Wallet.png]('"$id"')\nUse https://cesium.app to send payment.\nComment your transaction with '"'Zen'"' to order ZenTag...","mentions":[{"link":"'"$id"'","name":"'"$name"'","size":'"$size"',"type":"'"$type"'"}]}' echo " ___ _ _ __ | |_)|_(_ _. _| _| _|_| | __) (_|(_|(_| ... and ... Node IPNS publish ~/.zen/ipfs ipfs ls /ipns/$NODEIPNS " # COPY NODE G1SSB ID to IPFS echo "$ssbpub" > ~/.zen/ipfs/.$ipfsnodeid/G1SSB/_ssb.whoami echo "$g1pub" > ~/.zen/ipfs/.$ipfsnodeid/G1SSB/_g1.pubkey IWALLETS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1) NODEIPNS=$(ipfs name publish --allow-offline --quieter /ipfs/$IWALLETS) echo " _ _ _ _ _ (_)_ ____ _(_) |_ __ _| |_(_) ___ _ __ | | _ \ \ / / | __/ _| | __| |/ _ \| _ \ | | | | \ V /| | || (_| | |_| | (_) | | | | |_|_| |_|\_/ |_|\__\__|_|\__|_|\___/|_| |_| # This INVITE is to be sent an 'Astroport Station' willing to Join our IPFS Swarm. # see 'ssb_SURVEY_contact.sh' for commands executed... " INVITE=$(sbotc invite.create 1) echo $INVITE # This INVITE is to be sent an "Astroport Station" willing to Join our IPFS Swarm. # sbot_SURVEY.sh is taking care of checking SSB Feed for commands...