cic-staff-installer/setup_bloxberg.sh

38 lines
1.3 KiB
Bash

GIT_OPENETHEREUM=${GIT_OPENETHEREUM:-https://github.com/openethereum/openethereum}
OPENETHEREUM_PATH=${OPENETHEREUM_PATH:-$HOME/.local/bin/parity}
openethereum_dir=`realpath $(dirname $OPENETHEREUM_PATH)`
default_openethereum_run=$HOME/.local/share/io.parity.ethereum/bloxberg
OPENETHEREUM_RUN=${OPENETHEREUM_RUN:-$default_openethereum_run}
install_env=
if [ ! -f $OPENETHEREUM_PATH ]; then
dbg $dbg_debug "downloading bloxberg node"
t=`mktemp -d`
pushd $t
install_env=1
git clone $GIT_OPENETHEREUM
cd openethereum
git checkout 2662d1925ec794f3ad7c5759b2412ff5128d259b
rustup install 1.47.0
cargo build --release --features final
else
dbg $dbg_info "found bloxberg node executable in $OPENETHEREUM_PATH"
fi
#OPENETHEREUM_RUN=$HOME/.local/share/bloxberg
if [ ! -d $OPENETHEREUM_RUN ]; then
mkdir -vp $OPENETHEREUM_RUN/bootnode
touch $OPENETHEREUM_RUN/bootnode.pwd
dd if=/dev/urandom bs=32 count=1 2> /dev/null | hexdump -v -n 32 -e '1/1 "%02x"' > $OPENETHEREUM_RUN/bootnode.pwd
chmod 400 $OPENETHEREUM_RUN/bootnode.pwd
./aux/bash-templater/templater.sh var/bloxberg/bootnode.toml > $OPENETHEREUM_RUN/bootnode.toml
cp -v var/bloxberg/bloxberg.json $OPENETHEREUM_RUN/
cp -v var/bloxberg/bootnodes.txt $OPENETHEREUM_RUN/
fi
update_path $openethereum_dir
if [ ! -z "$install_env" ]; then
popd
fi