From e380c81c3f93f77dee0c2abee88d4011064c6a70 Mon Sep 17 00:00:00 2001 From: "Augusto F. Hack" Date: Wed, 6 Mar 2024 16:01:13 +0100 Subject: [PATCH] config: minimal systemd service files --- config/README.md | 13 +++++++++++++ config/miden-faucet.service | 16 ++++++++++++++++ config/miden-node.service | 14 ++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 config/README.md create mode 100644 config/miden-faucet.service create mode 100644 config/miden-node.service diff --git a/config/README.md b/config/README.md new file mode 100644 index 000000000..103c81597 --- /dev/null +++ b/config/README.md @@ -0,0 +1,13 @@ +## Service configuration files + +- `miden-faucet.service`: simple configuration to setup a faucet service monitored via systemd. +- `miden-node.service`: simple configuration to setup full node service monitored via systemd. + +Install the above files to your system's unit directory (e.g. +`/etc/systemd/system/`), and run the following commands to start the service: + +```sh +systemctl daemon-reload # ask the systemd to load the new configuration files +systemctl enable --now miden-node # enable and start the node +systemctl enable --now miden-faucet # enable and start the faucet +``` diff --git a/config/miden-faucet.service b/config/miden-faucet.service new file mode 100644 index 000000000..4a3ea5da6 --- /dev/null +++ b/config/miden-faucet.service @@ -0,0 +1,16 @@ +[Unit] +Description=Miden faucet +Wants=network-online.target +Wants=miden-node.service + +[Install] +WantedBy=multi-user.target + +[Service] +Type=exec +Environment="RUST_LOG=info" +ExecStart=miden-faucet import --asset-amount 100 --faucet-path /srv/miden-node/accounts/account1.mac +ExecStartPre=-rm store.sqlite3 +WorkingDirectory=/srv/miden-faucet +RestartSec=5 +Restart=always diff --git a/config/miden-node.service b/config/miden-node.service new file mode 100644 index 000000000..84d7a3b37 --- /dev/null +++ b/config/miden-node.service @@ -0,0 +1,14 @@ +[Unit] +Description=Miden node +Wants=network-online.target + +[Install] +WantedBy=multi-user.target + +[Service] +Type=exec +Environment="RUST_LOG=info" +ExecStart=miden-node start +WorkingDirectory=/srv/miden-node +RestartSec=5 +Restart=always