diff --git a/contrib/backends/Makefile b/contrib/backends/Makefile index 2862f19e..be61a88e 100644 --- a/contrib/backends/Makefile +++ b/contrib/backends/Makefile @@ -1,4 +1,4 @@ -TARGETS = bitcoin zcash bcash ethereum bgold dash litecoin dogecoin +TARGETS = bitcoin zcash bcash ethereum bgold dash litecoin dogecoin namecoin IMAGE = blockbook-backend-build-deb NO_CACHE = false diff --git a/contrib/backends/namecoin/Makefile b/contrib/backends/namecoin/Makefile new file mode 100644 index 00000000..5b5d7498 --- /dev/null +++ b/contrib/backends/namecoin/Makefile @@ -0,0 +1,13 @@ +NAMECOIN_VERSION := 0.13.99 + +all: + wget https://namecoin.org/files/namecoin-core-${NAMECOIN_VERSION}-name-tab-beta1-notreproduced/namecoin-${NAMECOIN_VERSION}-x86_64-linux-gnu.tar.gz + tar -xf namecoin-${NAMECOIN_VERSION}-x86_64-linux-gnu.tar.gz + mv namecoin-${NAMECOIN_VERSION} namecoin + rm namecoin/bin/namecoin-qt + rm namecoin/bin/test_namecoin* + + +clean: + rm -rf namecoin + rm -f namecoin-${NAMECOIN_VERSION}-x86_64-linux-gnu.tar.gz diff --git a/contrib/backends/namecoin/debian/backend-namecoin.conffiles b/contrib/backends/namecoin/debian/backend-namecoin.conffiles new file mode 100644 index 00000000..723eb4b6 --- /dev/null +++ b/contrib/backends/namecoin/debian/backend-namecoin.conffiles @@ -0,0 +1 @@ +/opt/coins/nodes/namecoin/namecoin.conf diff --git a/contrib/backends/namecoin/debian/backend-namecoin.dirs b/contrib/backends/namecoin/debian/backend-namecoin.dirs new file mode 100644 index 00000000..e5a2195f --- /dev/null +++ b/contrib/backends/namecoin/debian/backend-namecoin.dirs @@ -0,0 +1 @@ +/opt/coins/data/namecoin/backend diff --git a/contrib/backends/namecoin/debian/backend-namecoin.install b/contrib/backends/namecoin/debian/backend-namecoin.install new file mode 100644 index 00000000..099e6621 --- /dev/null +++ b/contrib/backends/namecoin/debian/backend-namecoin.install @@ -0,0 +1,2 @@ +namecoin/* /opt/coins/nodes/namecoin +namecoin.conf /opt/coins/nodes/namecoin diff --git a/contrib/backends/namecoin/debian/backend-namecoin.logrotate b/contrib/backends/namecoin/debian/backend-namecoin.logrotate new file mode 100644 index 00000000..e3e59529 --- /dev/null +++ b/contrib/backends/namecoin/debian/backend-namecoin.logrotate @@ -0,0 +1,10 @@ +/opt/coins/data/namecoin/backend/debug.log +/opt/coins/data/namecoin/backend/db.log +{ + rotate 7 + daily + compress + missingok + notifempty + copytruncate +} diff --git a/contrib/backends/namecoin/debian/backend-namecoin.postinst b/contrib/backends/namecoin/debian/backend-namecoin.postinst new file mode 100644 index 00000000..2eae5e29 --- /dev/null +++ b/contrib/backends/namecoin/debian/backend-namecoin.postinst @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +case "$1" in + + configure) + if ! id -u namecoin &> /dev/null + then + useradd --system -M -U namecoin -s /bin/false + fi + + if [ "$(stat -c '%U' /opt/coins/data/namecoin/backend)" != "namecoin" ] + then + chown -R namecoin:namecoin /opt/coins/data/namecoin/backend + fi + ;; + +esac + +#DEBHELPER# diff --git a/contrib/backends/namecoin/debian/backend-namecoin.service b/contrib/backends/namecoin/debian/backend-namecoin.service new file mode 100644 index 00000000..1dd79fb7 --- /dev/null +++ b/contrib/backends/namecoin/debian/backend-namecoin.service @@ -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 namecoin.service +# See "man systemd.service" for details. + +# Note that almost all daemon options could be specified in +# /opt/coins/nodes/namecoin/namecoin.conf + +[Unit] +Description=Namecoin daemon (mainnet) +After=network.target + +[Service] +ExecStart=/opt/coins/nodes/namecoin/bin/namecoind -datadir=/opt/coins/data/namecoin/backend -conf=/opt/coins/nodes/namecoin/namecoin.conf -pid=/run/namecoind/namecoin.pid +# Creates /run/namecoind owned by namecoin +RuntimeDirectory=namecoind +User=namecoin +Type=forking +PIDFile=/run/namecoind/namecoin.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 diff --git a/contrib/backends/namecoin/debian/changelog b/contrib/backends/namecoin/debian/changelog new file mode 100644 index 00000000..50f2bb4d --- /dev/null +++ b/contrib/backends/namecoin/debian/changelog @@ -0,0 +1,5 @@ +namecoin (0.13.99-satoshilabs1) unstable; urgency=medium + + * Initial build + + -- Martin Bohm Mon, 18 Jun 2018 11:12:13 +0200 diff --git a/contrib/backends/namecoin/debian/compat b/contrib/backends/namecoin/debian/compat new file mode 100644 index 00000000..ec635144 --- /dev/null +++ b/contrib/backends/namecoin/debian/compat @@ -0,0 +1 @@ +9 diff --git a/contrib/backends/namecoin/debian/control b/contrib/backends/namecoin/debian/control new file mode 100644 index 00000000..4726da03 --- /dev/null +++ b/contrib/backends/namecoin/debian/control @@ -0,0 +1,11 @@ +Source: namecoin +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-namecoin +Architecture: amd64 +Depends: ${shlibs:Depends}, ${misc:Depends}, logrotate +Description: Satoshilabs packaged namecoin server diff --git a/contrib/backends/namecoin/debian/rules b/contrib/backends/namecoin/debian/rules new file mode 100755 index 00000000..f69489df --- /dev/null +++ b/contrib/backends/namecoin/debian/rules @@ -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: diff --git a/contrib/backends/namecoin/namecoin.conf b/contrib/backends/namecoin/namecoin.conf new file mode 100644 index 00000000..d33f9cdc --- /dev/null +++ b/contrib/backends/namecoin/namecoin.conf @@ -0,0 +1,19 @@ +daemon=1 +server=1 +nolisten=1 +rpcuser=rpc +rpcpassword=rpc +rpcport=8039 +txindex=1 +whitelist=127.0.0.1 +upnp=0 +discover=0 + +zmqpubhashtx=tcp://127.0.0.1:38339 +zmqpubhashblock=tcp://127.0.0.1:38339 + +rpcworkqueue=1100 +maxmempool=2000 +dbcache=1000 + +