-
Notifications
You must be signed in to change notification settings - Fork 671
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat/faster-inv-generation
- Loading branch information
Showing
25 changed files
with
360 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Sample configuration files for: | ||
|
||
``` | ||
systemd: stacks.service | ||
SysVinit: stacks.init | ||
MacOS: org.stacks.stacks-blockchain.plist | ||
``` | ||
|
||
have been made available to assist packagers in creating node packages here. | ||
|
||
See [docs/init.md](../../docs/init.md) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>Label</key> | ||
<string>org.stacks.stacks-blockchain</string> | ||
<key>ProgramArguments</key> | ||
<array> | ||
<string>/usr/local/bin/stacks-node</string> | ||
<string>start</string> | ||
<string>--config=/etc/stacks-blockchain/Config.toml</string> | ||
</array> | ||
|
||
<key>ProcessType</key> | ||
<integer>Standard</integer> | ||
|
||
<key>StandardErrorPath</key> | ||
<string>/tmp/stacks-blockchain.log</string> | ||
|
||
<key>StandardOutPath</key> | ||
<string>/tmp/stacks-blockchain.log</string> | ||
|
||
<key>RunAtLoad</key> | ||
<false/> | ||
|
||
<key>ExitTimeOut</key> | ||
<integer>60</integer> | ||
|
||
<key>KeepAlive</key> | ||
<false/> | ||
|
||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
#!/usr/bin/env bash | ||
# # Modelled after https://github.com/bitcoin/bitcoin/blob/master/contrib/init/bitcoind.init | ||
# | ||
# Stacks Blockchain | ||
# | ||
# | ||
# chkconfig: 345 80 20 | ||
# description: stacks-blockchain | ||
# processname: stacks-node | ||
# | ||
### BEGIN INIT INFO | ||
# Provides: stacks-blockchain | ||
# Required-Start: | ||
# Required-Stop: | ||
# Should-Start: | ||
# Should-Stop: | ||
# Default-Start: 3 4 5 | ||
# Default-Stop: 0 1 6 | ||
# Short-Description: Stacks Blockchain | ||
# Description: Stacks Blockchain | ||
### END INIT INFO | ||
|
||
# Source function library. | ||
. /etc/init.d/functions | ||
|
||
# you can override defaults in /etc/sysconfig/stacks-blockchain, see below | ||
if [ -f /etc/sysconfig/stacks-blockchain ]; then | ||
. /etc/sysconfig/stacks-blockchain | ||
fi | ||
|
||
RETVAL=0 | ||
|
||
prog=stacks-node | ||
# you can override the lockfile via STACKS_BLOCKCHAIN_LOCKFILE in /etc/sysconfig/stacks-blockchain | ||
lockfile=${STACKS_BLOCKCHAIN_LOCKFILE-/var/lock/subsys/stacks-blockchain} | ||
|
||
# stacks-blockchain defaults to /usr/local/bin/stacks-node, override with STACKS_BLOCKCHAIN_BIN | ||
stacks_bin=${STACKS_BLOCKCHAIN_BIN-/usr/local/bin/stacks-node} | ||
|
||
# stacks-blockchain path to config toml, override with STACKS_BLOCKCHAIN_CONFIG | ||
stacks_config=${STACKS_BLOCKCHAIN_CONFIG-/etc/stacks-blockchain/Config.toml} | ||
|
||
# stacks-blockchain log file default to /var/log/stacks-blockchain.log, override with STACKS_BLOCKCHAIN_LOG | ||
stacks_log=${STACKS_BLOCKCHAIN_LOG-/stacks-blockchain/output.log} | ||
# Note: no logrotate is provided, you're encouraged to set something up like the following logrotate file: | ||
# cat <<EOF> /etc/logrotate.d/stacks-blockchain | ||
# /stacks-blockchain/output.log | ||
# { | ||
# missingok | ||
# daily | ||
# copytruncate | ||
# rotate 7 | ||
# } | ||
# EOF | ||
|
||
|
||
start() { | ||
if [ ! -f "$stacks_config" ];then | ||
echo -n "Missing config file: $stacks_config " | ||
return 1 | ||
fi | ||
echo -n $"Starting $prog: " | ||
$stacks_bin start --config="$stacks_config" > "$stacks_log" 2>&1 & | ||
RETVAL=$? | ||
[ $RETVAL -eq 0 ] && touch "$lockfile" | ||
echo | ||
return $RETVAL | ||
} | ||
|
||
stop() { | ||
echo -n $"Stopping $prog: " | ||
killproc $prog -INT | ||
RETVAL=$? | ||
echo | ||
[ $RETVAL -eq 0 ] && rm -f "$lockfile" | ||
return $RETVAL | ||
} | ||
|
||
restart() { | ||
stop | ||
start | ||
} | ||
|
||
rh_status() { | ||
status $prog | ||
} | ||
|
||
rh_status_q() { | ||
rh_status >/dev/null 2>&1 | ||
} | ||
|
||
case "$1" in | ||
start) | ||
rh_status_q && exit 1 | ||
$1 | ||
;; | ||
stop) | ||
rh_status_q || exit 1 | ||
$1 | ||
;; | ||
status) | ||
rh_status | ||
;; | ||
restart) | ||
$1 | ||
;; | ||
*) | ||
echo "Usage: service $prog {start|stop|status|restart}" | ||
exit 2 | ||
;; | ||
esac | ||
|
||
exit $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# # Modeled after https://github.com/bitcoin/bitcoin/blob/master/contrib/init/bitcoind.service | ||
|
||
[Unit] | ||
Description=Stacks Blockchain | ||
# https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ | ||
After=network-online.target | ||
Wants=network-online.target | ||
|
||
ConditionFileIsExecutable=/usr/local/bin/stacks-node | ||
ConditionPathExists=/etc/stacks-blockchain/Config.toml | ||
ConditionPathIsDirectory=/stacks-blockchain | ||
|
||
[Service] | ||
#ExecStart=/bin/sh -c "/usr/local/bin/stacks-node start --config=/etc/stacks-blockchain/Config.toml >> /stacks-blockchain/output.log 2>&1" | ||
ExecStart=/bin/sh -c "/usr/local/bin/stacks-node start --config=/etc/stacks-blockchain/Config.toml" | ||
ExecStartPost=/bin/sh -c "umask 022; sleep 2 && pgrep -f \"/usr/local/bin/stacks-node start --config=/etc/stacks-blockchain/Config.toml\" > /run/stacks-blockchain/stacks-blockchain.pid" | ||
ExecStopPost=/bin/sh -c "if [ -f \"/run/stacks-blockchain/stacks-blockchain.pid\" ]; then rm -f /run/stacks-blockchain/stacks-blockchain.pid; fi" | ||
|
||
# Make sure the config directory is readable by the service user | ||
PermissionsStartOnly=true | ||
#ExecStartPre=/bin/chgrp stacks /etc/stacks-blockchain/ | ||
|
||
# Process management | ||
#################### | ||
Type=simple | ||
PIDFile=/run/stacks-blockchain/stacks-blockchain.pid | ||
Restart=no | ||
TimeoutStopSec=600 | ||
KillSignal=SIGTERM | ||
|
||
# Directory creation and permissions | ||
#################################### | ||
# Run as stacks:stacks | ||
User=stacks | ||
Group=stacks | ||
|
||
# /run/stacks-blockchain | ||
RuntimeDirectory=stacks-blockchain | ||
RuntimeDirectoryMode=0710 | ||
|
||
# Hardening measures | ||
#################### | ||
|
||
# Provide a private /tmp and /var/tmp. | ||
PrivateTmp=true | ||
|
||
# Mount /usr, /boot/ and /etc read-only for the process. | ||
ProtectSystem=full | ||
|
||
# Deny access to /home, /root and /run/user | ||
ProtectHome=true | ||
|
||
# Disallow the process and all of its children to gain | ||
# new privileges through execve(). | ||
NoNewPrivileges=true | ||
|
||
# Use a new /dev namespace only populated with API pseudo devices | ||
# such as /dev/null, /dev/zero and /dev/random. | ||
PrivateDevices=true | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.