ask for credentials, or run diceware to make a Cesium secret.dunikey, SSB secret and IPFS node ID

This commit is contained in:
qo-op 2020-11-16 23:09:57 +01:00
parent a8859ce293
commit 21dbdaf9cf
1 changed files with 15 additions and 6 deletions

View File

@ -60,12 +60,19 @@ ZENID=\"$salt\"
ZENPWD=\"$pepper\" IS :
"
g1pub=$(cat ~/.zen/secret.dunikey | grep "pub" | cut -d ' ' -f 2)
echo "G1PUB=\"$g1pub\"" >> ~/.zen/secret.astroport.key
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 <<EOF
{
"curve": "ed25519",
"public": "${ssbpub}.ed25519",
"private": "${ssbpriv}.ed25519",
"id": "@${ssbpub}.ed25519"
}
EOF
# MODIFY ~/.ipfs/config
[[ ! -f ~/.zen/astroport/zen/tools/crypto_pb2.py ]] \
@ -77,8 +84,10 @@ ssbpriv=$(echo $g1priv | base58 -d | base64 | tr -d "\n" )
&& curl -s https://git.p2p.legal/axiom-team/astroport/raw/master/zen/tools/create_ipfsnodeid_from_tmp_secret.dunikey.py -o ~/.zen/astroport/zen/tools/create_ipfsnodeid_from_tmp_secret.dunikey.py \
&& chmod +x ~/.zen/astroport/zen/tools/create_ipfsnodeid_from_tmp_secret.dunikey.py
echo "execute python3 ~/.zen/astroport/zen/tools/create_ipfsnodeid_from_tmp_secret.dunikey.py"
# jq '.Identity.PeerID="$PeerID"' ~/.ipfs/config
# jq '.Identity.PrivKey="$PrivKey"' ~/.ipfs/config
# rm -f /tmp/secret.dunikey
python3 ~/.zen/astroport/zen/tools/create_ipfsnodeid_from_tmp_secret.dunikey.py
echo "copy the lines and apply that jq commands new ID to your IPFS node"
echo "jq '.Identity.PeerID=\"$PeerID\"' ~/.ipfs/config"
ech "jq '.Identity.PrivKey=\"$PrivKey\"' ~/.ipfs/config"
rm -f /tmp/secret.dunikey
}