[Unit]
Description=Electrs daemon

After=bitcoind.service
Wants=bitcoind.service

[Service]
ExecStart=/usr/bin/electrs --db-dir /var/lib/electrs \
                           --cookie-file /var/lib/bitcoind/.cookie \
                           --electrum-rpc-addr="127.0.0.1:50001" \
                           --log-filters INFO

# Process management
####################

Type=simple
Restart=on-failure
TimeoutSec=60

# Directory creation and permissions
####################################

# Run as bitcoin:bitcoin
User=bitcoin
Group=bitcoin

# /var/lib/electrs
StateDirectory=electrs
StateDirectoryMode=0710

[Install]
WantedBy=multi-user.target
