Add litecoin backend package

This commit is contained in:
Martin Boehm 2018-06-11 13:55:37 +02:00
parent 5baf69adab
commit b6d66cf6a8
19 changed files with 241 additions and 0 deletions

View File

@ -0,0 +1,13 @@
LITECOIN_VERSION := 0.16.0
all:
wget https://download.litecoin.org/litecoin-${LITECOIN_VERSION}/linux/litecoin-${LITECOIN_VERSION}-x86_64-linux-gnu.tar.gz
tar -xf litecoin-${LITECOIN_VERSION}-x86_64-linux-gnu.tar.gz
mv litecoin-${LITECOIN_VERSION} litecoin
rm litecoin/bin/litecoin-qt
rm litecoin/bin/test_litecoin
clean:
rm -rf litecoin
rm -f litecoin-${LITECOIN_VERSION}-x86_64-linux-gnu.tar.gz

View File

@ -0,0 +1 @@
/opt/coins/nodes/litecoin_testnet/litecoin_testnet.conf

View File

@ -0,0 +1 @@
/opt/coins/data/litecoin_testnet/backend

View File

@ -0,0 +1,2 @@
litecoin/* /opt/coins/nodes/litecoin_testnet
litecoin_testnet.conf /opt/coins/nodes/litecoin_testnet

View File

@ -0,0 +1,10 @@
/opt/coins/data/litecoin_testnet/backend/testnet3/debug.log
/opt/coins/data/litecoin_testnet/backend/testnet3/db.log
{
rotate 7
daily
compress
missingok
notifempty
copytruncate
}

View File

@ -0,0 +1,20 @@
#!/bin/bash
set -e
case "$1" in
configure)
if ! id -u litecoin &> /dev/null
then
useradd --system -M -U litecoin -s /bin/false
fi
if [ "$(stat -c '%U' /opt/coins/data/litecoin_testnet/backend)" != "litecoin" ]
then
chown -R litecoin:litecoin /opt/coins/data/litecoin_testnet/backend
fi
;;
esac
#DEBHELPER#

View File

@ -0,0 +1,47 @@
# It is not recommended to modify this file in-place, because it will
# be overwritten during package upgrades. If you want to add further
# options or overwrite existing ones then use
# $ systemctl edit litecoin-testnet.service
# See "man systemd.service" for details.
# Note that almost all daemon options could be specified in
# /opt/coins/nodes/litecoin_testnet/litecoin_testnet.conf
[Unit]
Description=litecoin daemon (testnet)
After=network.target
[Service]
ExecStart=/opt/coins/nodes/litecoin_testnet/bin/litecoind -datadir=/opt/coins/data/litecoin_testnet/backend -conf=/opt/coins/nodes/litecoin_testnet/litecoin_testnet.conf -pid=/run/litecoind/litecoin_testnet.pid
# Creates /run/litecoind owned by litecoin
RuntimeDirectory=litecoind
User=litecoin
Type=forking
PIDFile=/run/litecoind/litecoin_testnet.pid
Restart=on-failure
# Resource limits
LimitNOFILE=500000
# Hardening measures
####################
# Provide a private /tmp and /var/tmp.
PrivateTmp=true
# Mount /usr, /boot/ and /etc read-only for the process.
ProtectSystem=full
# 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
# Deny the creation of writable and executable memory mappings.
MemoryDenyWriteExecute=true
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1 @@
/opt/coins/nodes/litecoin/litecoin.conf

View File

@ -0,0 +1 @@
/opt/coins/data/litecoin/backend

View File

@ -0,0 +1,2 @@
litecoin/* /opt/coins/nodes/litecoin
litecoin.conf /opt/coins/nodes/litecoin

View File

@ -0,0 +1,10 @@
/opt/coins/data/litecoin/backend/debug.log
/opt/coins/data/litecoin/backend/db.log
{
rotate 7
daily
compress
missingok
notifempty
copytruncate
}

View File

@ -0,0 +1,20 @@
#!/bin/bash
set -e
case "$1" in
configure)
if ! id -u litecoin &> /dev/null
then
useradd --system -M -U litecoin -s /bin/false
fi
if [ "$(stat -c '%U' /opt/coins/data/litecoin/backend)" != "litecoin" ]
then
chown -R litecoin:litecoin /opt/coins/data/litecoin/backend
fi
;;
esac
#DEBHELPER#

View File

@ -0,0 +1,47 @@
# It is not recommended to modify this file in-place, because it will
# be overwritten during package upgrades. If you want to add further
# options or overwrite existing ones then use
# $ systemctl edit litecoin.service
# See "man systemd.service" for details.
# Note that almost all daemon options could be specified in
# /opt/coins/nodes/litecoin/litecoin.conf
[Unit]
Description=litecoin daemon (mainnet)
After=network.target
[Service]
ExecStart=/opt/coins/nodes/litecoin/bin/litecoind -datadir=/opt/coins/data/litecoin/backend -conf=/opt/coins/nodes/litecoin/litecoin.conf -pid=/run/litecoind/litecoin.pid
# Creates /run/litecoind owned by litecoin
RuntimeDirectory=litecoind
User=litecoin
Type=forking
PIDFile=/run/litecoind/litecoin.pid
Restart=on-failure
# Resource limits
LimitNOFILE=500000
# Hardening measures
####################
# Provide a private /tmp and /var/tmp.
PrivateTmp=true
# Mount /usr, /boot/ and /etc read-only for the process.
ProtectSystem=full
# 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
# Deny the creation of writable and executable memory mappings.
MemoryDenyWriteExecute=true
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,5 @@
litecoin (0.16.0-satoshilabs1) unstable; urgency=medium
* Initial build
-- Martin Bohm <martin.bohm@satoshilabs.com> Mon, 11 Jun 2018 11:12:13 +0200

View File

@ -0,0 +1 @@
9

View File

@ -0,0 +1,16 @@
Source: litecoin
Section: satoshilabs
Priority: optional
Maintainer: martin.bohm@satoshilabs.com
Build-Depends: debhelper, wget, tar, gzip, make, dh-systemd, dh-exec
Standards-Version: 3.9.5
Package: backend-litecoin
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, logrotate
Description: Satoshilabs packaged litecoin server
Package: backend-litecoin-testnet
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, logrotate
Description: Satoshilabs packaged litecoin server

View File

@ -0,0 +1,11 @@
#!/usr/bin/make -f
DH_VERBOSE = 1
%:
dh $@ --with=systemd
override_dh_systemd_start:
dh_systemd_start --no-start
override_dh_installinit:

View File

@ -0,0 +1,18 @@
daemon=1
server=1
nolisten=1
rpcuser=rpc
rpcpassword=rpc
rpcport=8034
txindex=1
whitelist=127.0.0.1
rpcallowip=127.0.0.1
zmqpubhashtx=tcp://127.0.0.1:38334
zmqpubhashblock=tcp://127.0.0.1:38334
rpcworkqueue=1100
maxmempool=2000
dbcache=1000

View File

@ -0,0 +1,15 @@
daemon=1
server=1
testnet=1
nolisten=1
rpcuser=rpc
rpcpassword=rpc
rpcport=18033
txindex=1
zmqpubhashtx=tcp://127.0.0.1:48333
zmqpubhashblock=tcp://127.0.0.1:48333
rpcworkqueue=1100
maxmempool=2000
dbcache=1000