Add systemd setup

This commit is contained in:
nolash
2021-06-03 22:23:21 +02:00
parent 49ff9a4b99
commit 374a39edc3
11 changed files with 871 additions and 5 deletions

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Chainqueue transaction dispatch interface
Requires=chaind-eth-sync@.service
After=chaind-eth-sync@.service
[Service]
Environment="SESSION_ID=%i"
Environment="SESSION_RUNTIME_DIR=/run/user/%U/chaind/eth"
ExecStart=%h/.local/bin/chaind-eth-server -v --session-id %i
Restart=on-failure

View File

@@ -0,0 +1,6 @@
#!/bin/bash
>&2 echo "waiting for socket at $@ to become ready"
while ! test -S $@; do
sleep 1s
done

View File

@@ -0,0 +1,8 @@
[Unit]
Description=Ethereum chaind syncer
[Service]
Environment="SESSION_ID=%i"
Environment="SESSION_RUNTIME_DIR=/run/user/%U/chaind/eth"
ExecStart=%h/.local/bin/chaind-eth-syncer -v --session-id %i --skip-history
Restart=on-failure

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Chaind socket activation
Requires=chaind-eth-queue@.service
After=chaind-eth-queue@.service
[Service]
Environment="SESSION_RUNTIME_DIR=/run/user/%U/chaind/eth/%i"
ExecStartPre=/bin/bash /home/lash/.config/systemd/user/chaind-eth-ready.sh /run/user/%U/chaind/eth/%i/chaind.sock
ExecStart=/usr/lib/systemd/systemd-socket-proxyd /run/user/%U/chaind/eth/%i/chaind.sock
Restart=on-failure

View File

@@ -0,0 +1,9 @@
[Unit]
Description=Socket activation for
[Socket]
ListenStream=63600
Accept=no
[Install]
WantedBy=sockets.target

View File

@@ -0,0 +1,2 @@
SESSION_CHAIN_SPEC=evm:ethereum:1
RPC_ENDPOINT=http://localhost:8545