diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index c3bdc28..d21a50f 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -11,6 +11,17 @@ confinement: strict base: core18 apps: + service: + command: $SNAP/bin/bitcoind -startupnotify='systemd-notify --ready' -shutdownnotify='systemd-notify --stopping' + daemon: notify + plugs: [home, removable-media, network, network-bind] + environment: + # Override HOME so the datadir is located at + # ~/snap/bitcoin-core/common/.bitcoin/ instead of + # ~/snap/bitcoin-core/current/.bitcoin/, and each new version of the + # snap won't have a different data directory: + # https://docs.snapcraft.io/environment-variables/7983 + HOME: $SNAP_USER_COMMON daemon: command: bitcoind plugs: [home, removable-media, network, network-bind]