Add bloxberg systemd installer

This commit is contained in:
nolash 2021-11-12 05:33:46 +01:00
parent e75d135a2b
commit 8f5297eb97
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
6 changed files with 40 additions and 32 deletions

View File

@ -7,7 +7,7 @@ Services installer temporarily for internal use by GE.
The os-level dependencies below must be met both at install and run time.
The version numbers are the version numbers used at implmentation time. It may very well work with earlier versions of the components, as long as they are not too old.
The version numbers are the version numbers used at implmentation time. It may very well work with earlier versions of the components, as long as they are not too old. An internet connection will be needed if the python dependencies cannot be resolved locally, either through a local repository or an existing package cache.
- systemd (249)
- gcc (11.1.0)
@ -80,12 +80,11 @@ systemctl --user status cic-cache-tracker
systemctl --user status cic-cache-server
```
Please note that although installing the bloxberg node is an optional feature of the installer, there is currently no supporting files for running the bloxberg node.
To run the bloxberg node manually:
The bloxberg node, if installed, runs in the same manner:
```
/home/lash/.local/bin/parity -c /home/cic/.local/share/io.parity.ethereum/bloxberg/bootnode.toml
systemctl --user start bloxberg
systemctl --user status bloxberg
```
@ -111,10 +110,12 @@ All paths relative to `$HOME`
| `.config/cic/staff-client/user.asc` | gnupg public key used by cicada for authentication | no |
| `.config/cic/staff-client/.gnupg` | gnupg homedir used by cicada for authentication | no |
| `.config/systemd/user/cic-cache-*.service` | systemd user service definition file for `cic-cache-*` services | yes, with `systemctl --user edit <service>` |
| `.config/systemd/user/bloxberg.service` | systemd user service definition file for bloxberg | yes, with `systemctl --user edit <service>` |
| `.config/environment.d/01-cic-cache-*.conf` | environment variables for systemd user services | yes |
| `.local/share/cic/.gnupg` | gnupg homedir for holding trust keys for global cic configurations | no |
| `.local/share/cic/clicada/.secret` | A gnupg encrypted symmetric secret used to encrypt local cached content | no |
| `.local/share/io.parity.ethereum/bloxberg` | Bloxberg configurations and chain data | no |
| `.local/share/io.parity.ethereum/bloxberg` | Bloxberg chain data | no |
| `.config/io.parity.ethereum/bloxberg` | Bloxberg configurations and chain data | bootnode.toml and bootnode.txt only |
## Installing as a different user
@ -130,5 +131,3 @@ machinectl login
```
Another alternative can be to open an `ssh` session.

View File

@ -123,19 +123,6 @@ if [ $update -gt 0 ]; then
fi
#dbg $dbg_info "using CIC_REGISTRY $CIC_REGISTRY_ADDRESS"
#if [ -z "$CIC_TRUST_ADDRESS" ]; then
# u="$CIC_ROOT_URL/cic_trust_address"
# dbg $dbg_trace "retrieve trust address from $u"
# curl -X GET $u -o cic_trust_address
# gpg --verify cic_trust_address
# export CIC_TRUST_ADDRESS=`gpg -d cic_trust_address`
#fi
#dbg $dbg_info "using CIC_TRUST_ADDRESS $CIC_TRUST_ADDRESS"
#popd
dbg $dbg_debug "installing configurations"
t=`mktemp`
if [ -f $HOME/.config/cic/cache/config.ini ]; then

View File

@ -1,8 +1,13 @@
. 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
OPENETHEREUM_RUN=${OPENETHEREUM_RUN:-$default_openethereum_run}
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
@ -15,6 +20,8 @@ if [ ! -f $OPENETHEREUM_PATH ]; then
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
@ -22,12 +29,16 @@ 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/
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

9
systemd/bloxberg.service Normal file
View File

@ -0,0 +1,9 @@
[Unit]
Description=Bloxberg openethereum node
After=network.target
[Service]
ExecStart=/bin/bash -c ${OPENETHEREUM_PATH} --config ${OPENETHEREUM_CONFIG}/bootnode.toml
[Install]
WantedBy=network.target

2
systemd/env/01-bloxberg.conf vendored Normal file
View File

@ -0,0 +1,2 @@
OPENETHEREUM_PATH={{OPENETHEREUM_PATH}}
OPENETHEREUM_CONFIG={{OPENETHEREUM_CONFIG}}

View File

@ -1,12 +1,12 @@
# File bootnode.toml
[parity]
chain = "{{HOME}}/.local/share/io.parity.ethereum/bloxberg/bloxberg.json"
base_path = "{{HOME}}/.local/share/io.parity.ethereum/bloxberg/bootnode"
chain = "{{OPENETHEREUM_CONFIG}}/bloxberg.json"
base_path = "{{OPENETHEREUM_RUN}}/bootnode"
[network]
port = 30303
reserved_peers = "{{HOME}}/.local/share/io.parity.ethereum/bloxberg/bootnodes.txt"
reserved_peers = "{{OPENETHEREUM_CONFIG}}/bootnodes.txt"
# reserved_only = true
max_peers = 100
snapshot_peers = 25
@ -26,7 +26,7 @@ interface = "all"
origins = ["all"]
[account]
password = ["{{HOME}}/.local/share/io.parity.ethereum/bloxberg/bootnode.pwd"]
password = ["{{OPENETHEREUM_CONFIG}}/bootnode.pwd"]
[footprint]
tracing = "on"