added package definition for Bitcoin Cash blockbook

indexv1
Jakub Matys 2018-04-16 19:50:34 +02:00
parent 173a0feb4a
commit 11e519970e
17 changed files with 177 additions and 3 deletions

View File

@ -0,0 +1 @@
/opt/blockbook/bch-testnet/config/blockchaincfg.json

View File

@ -0,0 +1,2 @@
#!/bin/sh
find /opt/blockbook/bch-testnet/logs -mtime +6 -type f -delete

View File

@ -0,0 +1,2 @@
/data/bch-testnet/blockbook
/opt/blockbook/bch-testnet/logs

View File

@ -0,0 +1,5 @@
#!/usr/bin/dh-exec
blockbook /opt/blockbook/bch-testnet/bin
server/testcert.* /opt/blockbook/bch-testnet/cert
server/static /opt/blockbook/bch-testnet
configs/bch-testnet.json => /opt/blockbook/bch-testnet/config/blockchaincfg.json

View File

@ -0,0 +1,2 @@
/opt/blockbook/bch-testnet/cert/testcert.crt /opt/blockbook/bch-testnet/cert/blockbook.crt
/opt/blockbook/bch-testnet/cert/testcert.key /opt/blockbook/bch-testnet/cert/blockbook.key

View File

@ -0,0 +1,23 @@
#!/bin/bash
set -e
case "$1" in
configure)
if ! id -u blockbook &> /dev/null
then
useradd --system -M -U blockbook
fi
for dir in /data/bch-testnet/blockbook /opt/blockbook/bch-testnet/logs
do
if [ "$(stat -c '%U' $dir)" != "blockbook" ]
then
chown -R blockbook:blockbook $dir
fi
done
;;
esac
#DEBHELPER#

View File

@ -0,0 +1,39 @@
# 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 blockbook-bch-testnet.service
# See "man systemd.service" for details.
[Unit]
Description=Blockbook daemon (BCH testnet)
After=network.target
[Service]
ExecStart=/opt/blockbook/bch-testnet/bin/blockbook -coin=bch-testnet -blockchaincfg=/opt/blockbook/bch-testnet/config/blockchaincfg.json -datadir=/data/bch-testnet/blockbook/db -sync -httpserver=:18435 -socketio=:18436 -certfile=/opt/blockbook/bch-testnet/cert/blockbook -explorer=https://bch-bitcore1.trezor.io/ -log_dir=/opt/blockbook/bch-testnet/logs
User=blockbook
Type=simple
Restart=on-failure
WorkingDirectory=/opt/blockbook/bch-testnet
# 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/blockbook/bch/config/blockchaincfg.json

View File

@ -0,0 +1,2 @@
#!/bin/sh
find /opt/blockbook/bch/logs -mtime +6 -type f -delete

View File

@ -0,0 +1,2 @@
/data/bch/blockbook
/opt/blockbook/bch/logs

View File

@ -0,0 +1,5 @@
#!/usr/bin/dh-exec
blockbook /opt/blockbook/bch/bin
server/testcert.* /opt/blockbook/bch/cert
server/static /opt/blockbook/bch
configs/bch.json => /opt/blockbook/bch/config/blockchaincfg.json

View File

@ -0,0 +1,2 @@
/opt/blockbook/bch/cert/testcert.crt /opt/blockbook/bch/cert/blockbook.crt
/opt/blockbook/bch/cert/testcert.key /opt/blockbook/bch/cert/blockbook.key

View File

@ -0,0 +1,23 @@
#!/bin/bash
set -e
case "$1" in
configure)
if ! id -u blockbook &> /dev/null
then
useradd --system -M -U blockbook
fi
for dir in /data/bch/blockbook /opt/blockbook/bch/logs
do
if [ "$(stat -c '%U' $dir)" != "blockbook" ]
then
chown -R blockbook:blockbook $dir
fi
done
;;
esac
#DEBHELPER#

View File

@ -0,0 +1,39 @@
# 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 blockbook-bch.service
# See "man systemd.service" for details.
[Unit]
Description=Blockbook daemon (BCH mainnet)
After=network.target
[Service]
ExecStart=/opt/blockbook/bch/bin/blockbook -coin=bch -blockchaincfg=/opt/blockbook/bch/config/blockchaincfg.json -datadir=/data/bch/blockbook/db -sync -httpserver=:8435 -socketio=:8436 -certfile=/opt/blockbook/bch/cert/blockbook -explorer=https://bitcore1.trezor.io/ -log_dir=/opt/blockbook/bch/logs
User=blockbook
Type=simple
Restart=on-failure
WorkingDirectory=/opt/blockbook/bch
# 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

@ -8,14 +8,24 @@ Standards-Version: 3.9.5
Package: blockbook-btc
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils
Description: Satoshilabs blockbook server
Description: Satoshilabs blockbook server (Bitcoin mainnet)
Package: blockbook-btc-testnet
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils
Description: Satoshilabs blockbook server
Description: Satoshilabs blockbook server (Bitcoin testnet)
Package: blockbook-zec
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils
Description: Satoshilabs blockbook server
Description: Satoshilabs blockbook server (ZCash mainnet)
Package: blockbook-bch
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils
Description: Satoshilabs blockbook server (Bitcoin Cash mainnet)
Package: blockbook-bch-testnet
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils
Description: Satoshilabs blockbook server (Bitcoin Cash testnet)

View File

@ -0,0 +1,8 @@
{
"rpcURL": "http://localhost:18432",
"rpcUser": "rpc",
"rpcPass": "rpc",
"rpcTimeout": 25,
"parse": true,
"zeroMQBinding": "tcp://127.0.0.1:18434"
}

8
configs/bch.json 100644
View File

@ -0,0 +1,8 @@
{
"rpcURL": "http://127.0.0.1:8432",
"rpcUser": "rpc",
"rpcPass": "rpc",
"rpcTimeout": 25,
"parse": true,
"zeroMQBinding": "tcp://127.0.0.1:8434"
}