49 lines
1.8 KiB
Bash
49 lines
1.8 KiB
Bash
. aux/bdbg/bdbg.sh
|
|
. setup_path.sh
|
|
|
|
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
|
|
default_openethereum_config=$HOME/.config/io.parity.ethereum/bloxberg
|
|
export OPENETHEREUM_RUN=${OPENETHEREUM_RUN:-$default_openethereum_run}
|
|
export OPENETHEREUM_CONFIG=${OPENETHEREUM_CONFIG:-$default_openethereum_config}
|
|
|
|
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
|
|
cp -v $t/target/release/parity $HOME/.local/bin/
|
|
export OPENETHEREUM_PATH=$HOME/.local/bin/parity
|
|
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
|
|
mkdir -vp $OPENETHEREUM_CONFIG
|
|
touch $OPENETHEREUM_CONFIG/bootnode.pwd
|
|
dd status=xfer if=/dev/urandom bs=32 count=1 2> /dev/null | hexdump -v -n 32 -e '1/1 "%02x"' > $OPENETHEREUM_CONFIG/bootnode.pwd
|
|
chmod -v 400 $OPENETHEREUM_CONFIG/bootnode.pwd
|
|
./aux/bash-templater/templater.sh var/bloxberg/bootnode.toml > $OPENETHEREUM_CONFIG/bootnode.toml
|
|
cp -v var/bloxberg/bloxberg.json $OPENETHEREUM_CONFIG/
|
|
cp -v var/bloxberg/bootnodes.txt $OPENETHEREUM_CONFIG/
|
|
cp -v systemd/bloxberg.service $HOME/.config/systemd/user/
|
|
./aux/bash-templater/templater.sh systemd/env/01-bloxberg.conf > $HOME/.config/environment.d/01-bloxberg.conf
|
|
systemctl --user daemon-reload
|
|
fi
|
|
|
|
update_path $openethereum_dir
|
|
|
|
if [ ! -z "$install_env" ]; then
|
|
popd
|
|
fi
|