#!/bin/bash { ######################################################################## MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" echo '>>>>>>> METAVERSE KEY CREATION <<<<<<<< __ __ ____ __/ // /_______ ______ __________ ___ / __ \ /_ _ __/ ___/ | /| / / __ `/ ___/ __ `__ \/ / / / /_ _ __(__ )| |/ |/ / /_/ / / / / / / / / /_/ / /_//_/ /____/ |__/|__/\__,_/_/ /_/ /_/ /_/\____/ CESIUM KEY CHOOSE YOU LOGIN (min 8 car. best is more than 6 words!!)... or LEAVE BLANK and HIT ENTER FOR diceware AUTO GENERATION ' read salt [[ $salt == "" ]] && echo "Hit ENTER again to continue" && read salt [[ $salt != "" ]] && echo "CHOOSE PASSWORD?" && read pepper && [[ $pepper == "" ]] && echo "AARRRRGGG why no pepper? exiting" && exit 1 if [[ "$salt" == "" && "$pepper" == "" ]]; then echo ' ._ _ ._ _ ._ _ _ ._ o _ | | | | | (/_ | | | (_) | | | (_ diceware passphrase generator...' # INSTALL diceware files ## TODO REPLACE WITH ipfs links [[ ! -f ~/.zen/astroport/zen/tools/diceware.sh ]] \ && mkdir -p ~/.zen/astroport/zen/tools/ \ && curl -s https://git.p2p.legal/axiom-team/astroport/raw/master/zen/tools/diceware.sh -o ~/.zen/astroport/zen/tools/diceware.sh \ && chmod +x ~/.zen/astroport/zen/tools/diceware.sh [[ ! -f ~/.zen/astroport/zen/tools/diceware-wordlist.txt ]] \ && curl -s https://git.p2p.legal/axiom-team/astroport/raw/master/zen/tools/diceware-wordlist.txt -o ~/.zen/astroport/zen/tools/diceware-wordlist.txt # LOGIN (=SALT) salt="$(~/.zen/astroport/zen/tools/diceware.sh 6 | xargs)" # PASS (=PEPPER) pepper="$(~/.zen/astroport/zen/tools/diceware.sh 4 | xargs)" fi echo "........." # CREATE /tmp/secret.dunikey [[ ! -f ~/.zen/astroport/zen/tools/key_create_dunikey.py ]] \ && mkdir -p ~/.zen/astroport/zen/tools/ \ && curl -s https://git.p2p.legal/axiom-team/astroport/raw/master/zen/tools/key_create_dunikey.py -o ~/.zen/astroport/zen/tools/key_create_dunikey.py \ && chmod +x ~/.zen/astroport/zen/tools/key_create_dunikey.py python3 ~/.zen/astroport/zen/tools/key_create_dunikey.py "$salt" "$pepper" sleep 1 [[ ! -f /tmp/secret.dunikey ]] && echo "AARRRRGGG problem happens making your secret.dunikey exiting" && exit 1 [[ -f /tmp/secret.dunikey ]] && cp -f /tmp/secret.dunikey ~/.zen/ echo "#YOUR CESIUM SWARM0 IDENTITY ZENID=\"$salt\" ZENPWD=\"$pepper\" IS : " g1pub=$(cat ~/.zen/secret.dunikey | grep "pub" | cut -d ' ' -f 2) g1priv=$(cat ~/.zen/secret.dunikey | grep "sec" | cut -d ' ' -f 2) # make ScutlleButt secret key ssbpub=$(echo $g1pub | base58 -d | base64) ssbpriv=$(echo $g1priv | base58 -d | base64 | tr -d "\n" ) cat > ~/.zen/secret <