added package definition for Bitcoin Cash backend

indexv1
Jakub Matys 2018-04-13 15:23:15 +02:00
parent 26de94495c
commit 173a0feb4a
20 changed files with 224 additions and 1 deletions

View File

@ -1,4 +1,4 @@
TARGETS = bitcoin zcash
TARGETS = bitcoin zcash bcash
IMAGE = blockbook-backend-build-deb
NO_CACHE = false

View File

@ -0,0 +1,14 @@
BITCOINABC_VERSION := 0.17.0
all:
wget https://download.bitcoinabc.org/0.17.0/linux/bitcoin-abc-${BITCOINABC_VERSION}-x86_64-linux-gnu.tar.gz
tar -xf bitcoin-abc-${BITCOINABC_VERSION}-x86_64-linux-gnu.tar.gz
mv bitcoin-abc-${BITCOINABC_VERSION} bitcoin-abc
rm bitcoin-abc/bin/bitcoin-qt
rm bitcoin-abc/bin/bitcoin-tx
rm bitcoin-abc/bin/bitcoin-seeder
rm bitcoin-abc/bin/test_bitcoin
clean:
rm -rf bitcoin-abc
rm -f bitcoin-abc-${BITCOINABC_VERSION}-x86_64-linux-gnu.tar.gz*

View File

@ -0,0 +1,13 @@
daemon=1
server=1
testnet=1
nolisten=1
rpcuser=rpc
rpcpassword=rpc
rpcport=18432
txindex=1
rpcworkqueue=32
zmqpubhashtx=tcp://127.0.0.1:18434
zmqpubhashblock=tcp://127.0.0.1:18434
zmqpubrawblock=tcp://127.0.0.1:18434
zmqpubrawtx=tcp://127.0.0.1:18434

View File

@ -0,0 +1,12 @@
daemon=1
server=1
nolisten=1
rpcuser=rpc
rpcpassword=rpc
rpcport=8432
txindex=1
rpcworkqueue=32
zmqpubhashtx=tcp://127.0.0.1:8434
zmqpubhashblock=tcp://127.0.0.1:8434
zmqpubrawblock=tcp://127.0.0.1:8434
zmqpubrawtx=tcp://127.0.0.1:8434

View File

@ -0,0 +1 @@
/opt/bitcoin/bch/bch.conf

View File

@ -0,0 +1 @@
/data/bch/bitcoin

View File

@ -0,0 +1,2 @@
bitcoin-abc/* /opt/bitcoin/bch
bch.conf /opt/bitcoin/bch

View File

@ -0,0 +1,10 @@
/data/bch/bitcoin/debug.log
/data/bch/bitcoin/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 bitcoin &> /dev/null
then
useradd --system -M -U bitcoin
fi
if [ "$(stat -c '%U' /data/btc/bitcoin)" != "bitcoin" ]
then
chown bitcoin:bitcoin /data/bch/bitcoin
fi
;;
esac
#DEBHELPER#

View File

@ -0,0 +1,44 @@
# 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 bcash-bch.service
# See "man systemd.service" for details.
# Note that almost all daemon options could be specified in
# /opt/bitcoin/bch/bch.conf
[Unit]
Description=Bitcoin Cash daemon (mainnet)
After=network.target
[Service]
ExecStart=/opt/bitcoin/bch/bin/bitcoind -datadir=/data/bch/bitcoin -conf=/opt/bitcoin/bch/bch.conf -pid=/run/bitcoind/bch.pid
# Creates /run/bitcoind owned by bitcoin
RuntimeDirectory=bitcoind
User=bitcoin
Type=forking
PIDFile=/run/bitcoind/bch.pid
Restart=on-failure
# 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/bitcoin/bch-testnet/bch-testnet.conf

View File

@ -0,0 +1 @@
/data/bch-testnet/bitcoin

View File

@ -0,0 +1,2 @@
bitcoin-abc/* /opt/bitcoin/bch-testnet
bch-testnet.conf /opt/bitcoin/bch-testnet

View File

@ -0,0 +1,10 @@
/data/bch-testnet/bitcoin/testnet3/debug.log
/data/bch-testnet/bitcoin/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 bitcoin &> /dev/null
then
useradd --system -M -U bitcoin
fi
if [ "$(stat -c '%U' /data/bch-testnet/bitcoin)" != "bitcoin" ]
then
chown bitcoin:bitcoin /data/bch-testnet/bitcoin
fi
;;
esac
#DEBHELPER#

View File

@ -0,0 +1,44 @@
# 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 bcash-testnet.service
# See "man systemd.service" for details.
# Note that almost all daemon options could be specified in
# /opt/bitcoin/bch-testnet/bch-testnet.conf
[Unit]
Description=Bitcoin Cash daemon (testnet)
After=network.target
[Service]
ExecStart=/opt/bitcoin/bch-testnet/bin/bitcoind -datadir=/data/bch-testnet/bitcoin -conf=/opt/bitcoin/bch-testnet/bch-testnet.conf -pid=/run/bitcoind/bch-testnet.pid
# Creates /run/bitcoind owned by bitcoin
RuntimeDirectory=bitcoind
User=bitcoin
Type=forking
PIDFile=/run/bitcoind/bch-testnet.pid
Restart=on-failure
# 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 @@
bcash (0.17.0-satoshilabs1) unstable; urgency=medium
* Initial build
-- Jakub Matys <jakub.matys@satoshilabs.com> Fri, 13 Apr 2018 11:31:01 +0200

View File

@ -0,0 +1 @@
9

View File

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

View File

@ -0,0 +1,6 @@
#!/usr/bin/make -f
DH_VERBOSE = 1
%:
dh $@ --with=systemd