Add bloxberg systemd installer
This commit is contained in:
parent
e75d135a2b
commit
8f5297eb97
15
README.md
15
README.md
@ -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 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)
|
- systemd (249)
|
||||||
- gcc (11.1.0)
|
- gcc (11.1.0)
|
||||||
@ -80,12 +80,11 @@ systemctl --user status cic-cache-tracker
|
|||||||
systemctl --user status cic-cache-server
|
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.
|
The bloxberg node, if installed, runs in the same manner:
|
||||||
|
|
||||||
To run the bloxberg node manually:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
/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/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/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/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 |
|
| `.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/.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/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
|
## Installing as a different user
|
||||||
@ -130,5 +131,3 @@ machinectl login
|
|||||||
```
|
```
|
||||||
|
|
||||||
Another alternative can be to open an `ssh` session.
|
Another alternative can be to open an `ssh` session.
|
||||||
|
|
||||||
|
|
||||||
|
13
setup.sh
13
setup.sh
@ -123,19 +123,6 @@ if [ $update -gt 0 ]; then
|
|||||||
fi
|
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"
|
dbg $dbg_debug "installing configurations"
|
||||||
t=`mktemp`
|
t=`mktemp`
|
||||||
if [ -f $HOME/.config/cic/cache/config.ini ]; then
|
if [ -f $HOME/.config/cic/cache/config.ini ]; then
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
|
. aux/bdbg/bdbg.sh
|
||||||
|
. setup_path.sh
|
||||||
|
|
||||||
GIT_OPENETHEREUM=${GIT_OPENETHEREUM:-https://github.com/openethereum/openethereum}
|
GIT_OPENETHEREUM=${GIT_OPENETHEREUM:-https://github.com/openethereum/openethereum}
|
||||||
OPENETHEREUM_PATH=${OPENETHEREUM_PATH:-$HOME/.local/bin/parity}
|
OPENETHEREUM_PATH=${OPENETHEREUM_PATH:-$HOME/.local/bin/parity}
|
||||||
openethereum_dir=`realpath $(dirname $OPENETHEREUM_PATH)`
|
openethereum_dir=`realpath $(dirname $OPENETHEREUM_PATH)`
|
||||||
default_openethereum_run=$HOME/.local/share/io.parity.ethereum/bloxberg
|
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=
|
install_env=
|
||||||
if [ ! -f $OPENETHEREUM_PATH ]; then
|
if [ ! -f $OPENETHEREUM_PATH ]; then
|
||||||
@ -15,6 +20,8 @@ if [ ! -f $OPENETHEREUM_PATH ]; then
|
|||||||
git checkout 2662d1925ec794f3ad7c5759b2412ff5128d259b
|
git checkout 2662d1925ec794f3ad7c5759b2412ff5128d259b
|
||||||
rustup install 1.47.0
|
rustup install 1.47.0
|
||||||
cargo build --release --features final
|
cargo build --release --features final
|
||||||
|
cp -v $t/target/release/parity $HOME/.local/bin/
|
||||||
|
export OPENETHEREUM_PATH=$HOME/.local/bin/parity
|
||||||
else
|
else
|
||||||
dbg $dbg_info "found bloxberg node executable in $OPENETHEREUM_PATH"
|
dbg $dbg_info "found bloxberg node executable in $OPENETHEREUM_PATH"
|
||||||
fi
|
fi
|
||||||
@ -22,12 +29,16 @@ fi
|
|||||||
#OPENETHEREUM_RUN=$HOME/.local/share/bloxberg
|
#OPENETHEREUM_RUN=$HOME/.local/share/bloxberg
|
||||||
if [ ! -d $OPENETHEREUM_RUN ]; then
|
if [ ! -d $OPENETHEREUM_RUN ]; then
|
||||||
mkdir -vp $OPENETHEREUM_RUN/bootnode
|
mkdir -vp $OPENETHEREUM_RUN/bootnode
|
||||||
touch $OPENETHEREUM_RUN/bootnode.pwd
|
mkdir -vp $OPENETHEREUM_CONFIG
|
||||||
dd if=/dev/urandom bs=32 count=1 2> /dev/null | hexdump -v -n 32 -e '1/1 "%02x"' > $OPENETHEREUM_RUN/bootnode.pwd
|
touch $OPENETHEREUM_CONFIG/bootnode.pwd
|
||||||
chmod 400 $OPENETHEREUM_RUN/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
|
||||||
./aux/bash-templater/templater.sh var/bloxberg/bootnode.toml > $OPENETHEREUM_RUN/bootnode.toml
|
chmod -v 400 $OPENETHEREUM_CONFIG/bootnode.pwd
|
||||||
cp -v var/bloxberg/bloxberg.json $OPENETHEREUM_RUN/
|
./aux/bash-templater/templater.sh var/bloxberg/bootnode.toml > $OPENETHEREUM_CONFIG/bootnode.toml
|
||||||
cp -v var/bloxberg/bootnodes.txt $OPENETHEREUM_RUN/
|
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
|
fi
|
||||||
|
|
||||||
update_path $openethereum_dir
|
update_path $openethereum_dir
|
||||||
|
9
systemd/bloxberg.service
Normal file
9
systemd/bloxberg.service
Normal 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
2
systemd/env/01-bloxberg.conf
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
OPENETHEREUM_PATH={{OPENETHEREUM_PATH}}
|
||||||
|
OPENETHEREUM_CONFIG={{OPENETHEREUM_CONFIG}}
|
@ -1,12 +1,12 @@
|
|||||||
# File bootnode.toml
|
# File bootnode.toml
|
||||||
|
|
||||||
[parity]
|
[parity]
|
||||||
chain = "{{HOME}}/.local/share/io.parity.ethereum/bloxberg/bloxberg.json"
|
chain = "{{OPENETHEREUM_CONFIG}}/bloxberg.json"
|
||||||
base_path = "{{HOME}}/.local/share/io.parity.ethereum/bloxberg/bootnode"
|
base_path = "{{OPENETHEREUM_RUN}}/bootnode"
|
||||||
|
|
||||||
[network]
|
[network]
|
||||||
port = 30303
|
port = 30303
|
||||||
reserved_peers = "{{HOME}}/.local/share/io.parity.ethereum/bloxberg/bootnodes.txt"
|
reserved_peers = "{{OPENETHEREUM_CONFIG}}/bootnodes.txt"
|
||||||
# reserved_only = true
|
# reserved_only = true
|
||||||
max_peers = 100
|
max_peers = 100
|
||||||
snapshot_peers = 25
|
snapshot_peers = 25
|
||||||
@ -26,7 +26,7 @@ interface = "all"
|
|||||||
origins = ["all"]
|
origins = ["all"]
|
||||||
|
|
||||||
[account]
|
[account]
|
||||||
password = ["{{HOME}}/.local/share/io.parity.ethereum/bloxberg/bootnode.pwd"]
|
password = ["{{OPENETHEREUM_CONFIG}}/bootnode.pwd"]
|
||||||
|
|
||||||
[footprint]
|
[footprint]
|
||||||
tracing = "on"
|
tracing = "on"
|
||||||
|
Loading…
Reference in New Issue
Block a user