[Unit]
Description=Power-House validator node (%i)
After=network-online.target
Wants=network-online.target
StartLimitIntervalSec=120
StartLimitBurst=5

[Service]
Type=simple
User=root
Group=root
WorkingDirectory=/var/lib/powerhouse/%i
StateDirectory=powerhouse/%i
StateDirectoryMode=0750
LogsDirectory=powerhouse
LogsDirectoryMode=0750
Environment=RUST_LOG=info
EnvironmentFile=/etc/powerhouse/powerhouse-common.env
EnvironmentFile=/etc/powerhouse/powerhouse-%i.env
ExecStartPre=/usr/bin/install -d -m 0750 /var/lib/powerhouse/%i/logs
ExecStart=/usr/local/bin/powerhouse-boot.sh
Restart=on-failure
RestartSec=5
TimeoutStopSec=30
KillSignal=SIGINT
LimitNOFILE=65536
NoNewPrivileges=true
PrivateTmp=true
ProtectHome=true
ProtectSystem=strict
ReadWritePaths=/var/lib/powerhouse/%i /var/log/powerhouse

[Install]
WantedBy=multi-user.target
