Lot of changes ...

This commit is contained in:
poka 2020-03-14 22:57:43 +01:00
parent 663919c075
commit 12ea277178
2 changed files with 132 additions and 0 deletions

131
install.sh Executable file
View File

@ -0,0 +1,131 @@
#!/bin/bash
################################################################################
# Authors:
# [@cel](@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519)
# [@Fred](@9BbJwPDjcyIqrOUPNn0nJZBduWdIrpMk3Cjz5MP361s=.ed25519)
# [@Boris](@l5nYExWYIgDLV6BYHOJPoI97jIUyTdSm8CTLpQ0XeOg=.ed25519)
# [@poka]()
# Version: 1.0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
###########################################################################################
# ADD G1 Layer 10 LOVE to message writer you like !
# INSTALL silkaj sbotc
# PREVENT DOUBLE PAYEMENT
############################################################################################
# INSTALL requirements
[[ ! $(which base58) ]] && sudo apt install build-essential base58 -y
# INSTALL Cargo
if [[ ! $(which cargo) ]]; then
curl https://sh.rustup.rs -sSf | sh
PATH=$PATH:~/.cargo/env
source $HOME/.cargo/env
fi
# INSTALL silkaj
if [[ ! $(which silkaj) ]]; then
echo "INSTALL silkaj"
sudo apt update || true
sudo apt install python3-pip python3-setuptools python3-wheel -y && pip3 install silkaj --user
echo 'PATH=$PATH:.local/bin' >> ~/.bashrc && source ~/.bashrc
fi
# INSTALL sbotc
if [[ ! $(which sbotc) ]]; then
sudo apt install libsodium-dev jq -y
git clone https://git.scuttlebot.io/%25133ulDgs%2FoC1DXjoK04vDFy6DgVBB%2FZok15YJmuhD5Q%3D.sha256 sbotc
cd sbotc
make
sudo make install
fi
###########################################################################################
####################### G1 SSB ACCOUNT MANAGER ############################################
###########################################################################################
# Install DUP-Mnemonic
if [[ ! $(which dup-mnemonic) ]]; then
cd /tmp
git clone https://git.duniter.org/tools/dup-mnemonic-rs
cd dup-mnemonic-rs
cargo build --release
sudo cp target/release/dup-mnemonic /usr/local/bin
fi
# CHECK SSB ~/.ssb/secret
if [[ ! -f ~/.ssb/secret ]]; then
mkdir -p ~/.ssb
echo "WELCOME CREATING YOUR G1 SSB ACCOUNT !!!"
echo "CHOOSE YOU LOGIN or LEAVE BLANK & HIT ENTER FOR AUTO GENERATION"
read salt
[[ $salt != "" ]] && echo "PASSWORD?" && read pepper && [[ $pepper == "" ]] && exit
# GENERATE MNEMONIC KEY: 9 MOTS
if [[ $salt == "" ]]; then
declare -a makeyarray
makeyarray=($(dup-mnemonic -l $lang))
# LOGIN (=SALT) 6 MOTS
salt="${makeyarray[0]} ${makeyarray[1]} ${makeyarray[2]} ${makeyarray[3]} ${makeyarray[4]} ${makeyarray[5]}"
# PASS (=PEPPER) 3 MOTS
pepper="${makeyarray[6]} ${makeyarray[7]} ${makeyarray[8]}"
fi
echo "........."
echo "CREDENTIAL: $salt / $pepper"
# CREATE ~/.ssb/secret.dunikey
python3 ./key_create_dunikey.py "$salt" "$pepper"
mv ./.secret.dunikey ~/.ssb/secret.dunikey
# CREATE
pub=$(cat ~/.ssb/secret.dunikey | grep "pub" | cut -d ' ' -f 2)
priv=$(cat ~/.ssb/secret.dunikey | grep "sec" | cut -d ' ' -f 2)
ssbpub=$(echo $pub | base58 -d | base64)
ssbpriv=$(echo $priv | base58 -d | base64)
cat > ~/.ssb/secret <<EOF
# This secret is related to your G1Wallet - https://cesium.app
# silkaj balance $pub
# ID (salt): $salt / Pass: $pepper
# THIS KEY IS YOURS! REMIND IT AND KEEP IT SAFE AS A REAL WALLET
# chmod 400 ~/.zen/secret
{
"curve": "ed25519",
"public": "$ssbpub.ed25519",
"private": "$ssbpriv.ed25519",
"id": "@$ssbpub.ed25519"
}
# WARNING! It's vital that you DO NOT edit OR share your secret name
# instead, share your public name
# your SSB public name: @$ssbpub.ed25519
EOF
else
# CREATE ~/.ssb/secret.dunikey
ssbpub=$(cat ~/.ssb/secret | grep public\" | cut -d ' ' -f 4 | cut -d '.' -f 1 | sed s/\"//g)
ssbpriv=$(cat ~/.ssb/secret | grep private\" | cut -d ' ' -f 4 | cut -d '.' -f 1 | sed s/\"//g)
g1pub=$(echo $ssbpub | base64 -d | base58)
g1priv=$(echo $ssbpriv | base64 -d | base58)
cat > ~/.ssb/secret.dunikey <<EOF
Type: PubSec
Version: 1
pub: $g1pub
sec: $g1priv
EOF
fi
echo -e "Installation complete"
exit 0

1
sbotc Submodule

@ -0,0 +1 @@
Subproject commit f1337fffb2467ae35d1e694221cd0fd9ba97923f