Skip to content

Instantly share code, notes, and snippets.

@swaldman
Last active April 27, 2021 03:12
Show Gist options
  • Save swaldman/9c08d395e376dd1cdee759a12156d2c5 to your computer and use it in GitHub Desktop.
Save swaldman/9c08d395e376dd1cdee759a12156d2c5 to your computer and use it in GitHub Desktop.
Setting up ethdocstore as a service under systemd Fedora 27
This gist describes ethdocstore setup.
ethdocstore {
contracts {
0xcbc2e5f5fbc14ea4951f87c4029cf536cd66f784 {
postPutHook = "GitAddCommitPush"
}
}
node {
url = "https://ethjsonrpc.mchange.com"
chainId = 1
}
http {
server {
interface = "127.0.0.1"
# path = "/poop/" # commented out, our base URL is at document root of the server
port = 7237
dataDir = "/home/docstore-bureaucracy/ethdocstore-data"
}
}
}
[Unit]
Description=ethdocstore service
After=syslog.target network.target
[Service]
User=docstore-bureaucracy
Group=docstore-bureaucracy
Environment=HOME=/home/docstore-bureaucracy
Type=simple
ExecStart=/home/docstore-bureaucracy/ethdocstore/bin/ethdocstore
KillMode=process
KillSignal=SIGINT
TimeoutStopSec=90
Restart=on-failure
RestartSec=10s
[Install]
WantedBy=multi-user.target

Setting up ethdocstore as a service under systemd Fedora 27

  1. Create user docstore-bureaucracy with useradd
  2. Download with wget latest version of ethdocstore (as tgz) into /home/docstore-bureaucracy and unpack. Symlink ethdocstore to that version, in /home/docstore-bureaucracy
  3. Define an ethdocstore-data directory
  4. Edit the application.conf file in the conf directory of the distribution (perhaps as a symlink elsewhere to prevent upgrades from overwriting, currently the true file is /home/docstore-bureaucracy/conf/application.conf)
  5. Install the ethdocstore.service file (also in this gist) in /usr/lib/systemd/system/ (make sure the version / path-to-bin are correct)
  6. Make a symlink from /etc/systemd/system/multi-user.target.wants/ethdocstore.service to /usr/lib/systemd/system/ethdocstore.service
  7. systemctl enable ethdocstore followed by systemctl start ethdocstore
  8. Verify that logging goes to the systemd journal with journalctl --follow -u ethdocstore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment