Vertcoin (#13)
* Initial vertcoin backend commit * Readme vertcoin ports * Fix bin * Vertcoin blockbook initial commit * Vertcoin fix services port, faked magic due duplicity
This commit is contained in:
parent
4107f3e350
commit
cb7c54ff21
@ -146,12 +146,14 @@ The data are separated to different column families:
|
|||||||
| Ethereum Classic | 9037 | 9137 | 8037 | 38337* |
|
| Ethereum Classic | 9037 | 9137 | 8037 | 38337* |
|
||||||
| Dogecoin | 9038 | 9138 | 8038 | 38338 |
|
| Dogecoin | 9038 | 9138 | 8038 | 38338 |
|
||||||
| Namecoin | 9039 | 9139 | 8039 | 38339 |
|
| Namecoin | 9039 | 9139 | 8039 | 38339 |
|
||||||
|
| Vertcoin | 9040 | 9140 | 8040 | 38340 |
|
||||||
| Bitcoin Testnet | 19030 | 19130 | 18030 | 48330 |
|
| Bitcoin Testnet | 19030 | 19130 | 18030 | 48330 |
|
||||||
| Bcash Testnet | 19031 | 19131 | 18031 | 48331 |
|
| Bcash Testnet | 19031 | 19131 | 18031 | 48331 |
|
||||||
| Zcash Testnet | 19032 | 19132 | 18032 | 48332 |
|
| Zcash Testnet | 19032 | 19132 | 18032 | 48332 |
|
||||||
| Dash Testnet | 19033 | 19133 | 18033 | 48333 |
|
| Dash Testnet | 19033 | 19133 | 18033 | 48333 |
|
||||||
| Litecoin Testnet | 19034 | 19134 | 18034 | 48334 |
|
| Litecoin Testnet | 19034 | 19134 | 18034 | 48334 |
|
||||||
| Ethereum Testnet Ropsten | 19036 | 19136 | 18036 | 48336* |
|
| Ethereum Testnet Ropsten | 19036 | 19136 | 18036 | 48336* |
|
||||||
|
| Vertcoin Testnet | 19040 | 19140 | 18040 | 48340 |
|
||||||
|
|
||||||
\* geth listens on this port, however not as zmq service
|
\* geth listens on this port, however not as zmq service
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import (
|
|||||||
"blockbook/bchain/coins/dogecoin"
|
"blockbook/bchain/coins/dogecoin"
|
||||||
"blockbook/bchain/coins/eth"
|
"blockbook/bchain/coins/eth"
|
||||||
"blockbook/bchain/coins/litecoin"
|
"blockbook/bchain/coins/litecoin"
|
||||||
|
"blockbook/bchain/coins/vertcoin"
|
||||||
"blockbook/bchain/coins/namecoin"
|
"blockbook/bchain/coins/namecoin"
|
||||||
"blockbook/bchain/coins/zec"
|
"blockbook/bchain/coins/zec"
|
||||||
"blockbook/common"
|
"blockbook/common"
|
||||||
@ -41,6 +42,8 @@ func init() {
|
|||||||
blockChainFactories["Litecoin"] = litecoin.NewLitecoinRPC
|
blockChainFactories["Litecoin"] = litecoin.NewLitecoinRPC
|
||||||
blockChainFactories["Litecoin Testnet"] = litecoin.NewLitecoinRPC
|
blockChainFactories["Litecoin Testnet"] = litecoin.NewLitecoinRPC
|
||||||
blockChainFactories["Dogecoin"] = dogecoin.NewDogecoinRPC
|
blockChainFactories["Dogecoin"] = dogecoin.NewDogecoinRPC
|
||||||
|
blockChainFactories["Vertcoin"] = vertcoin.NewVertcoinRPC
|
||||||
|
blockChainFactories["Vertcoin Testnet"] = vertcoin.NewVertcoinRPC
|
||||||
blockChainFactories["Namecoin"] = namecoin.NewNamecoinRPC
|
blockChainFactories["Namecoin"] = namecoin.NewNamecoinRPC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
62
bchain/coins/vertcoin/vertcoinparser.go
Normal file
62
bchain/coins/vertcoin/vertcoinparser.go
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
package vertcoin
|
||||||
|
|
||||||
|
import (
|
||||||
|
"blockbook/bchain/coins/btc"
|
||||||
|
|
||||||
|
"github.com/btcsuite/btcd/chaincfg"
|
||||||
|
"github.com/btcsuite/btcd/wire"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
MainnetMagic wire.BitcoinNet = 0xdab5bffb
|
||||||
|
TestnetMagic wire.BitcoinNet = 0x74726576 // "vert" word
|
||||||
|
RegtestMagic wire.BitcoinNet = 0xdab5bffc
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
MainNetParams chaincfg.Params
|
||||||
|
TestNetParams chaincfg.Params
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
MainNetParams = chaincfg.MainNetParams
|
||||||
|
MainNetParams.Net = MainnetMagic
|
||||||
|
MainNetParams.PubKeyHashAddrID = 71
|
||||||
|
MainNetParams.ScriptHashAddrID = 5
|
||||||
|
MainNetParams.Bech32HRPSegwit = "vtc"
|
||||||
|
|
||||||
|
TestNetParams = chaincfg.TestNet3Params
|
||||||
|
TestNetParams.Net = TestnetMagic
|
||||||
|
TestNetParams.PubKeyHashAddrID = 74
|
||||||
|
TestNetParams.ScriptHashAddrID = 196
|
||||||
|
TestNetParams.Bech32HRPSegwit = "tvtc"
|
||||||
|
|
||||||
|
err := chaincfg.Register(&MainNetParams)
|
||||||
|
if err == nil {
|
||||||
|
err = chaincfg.Register(&TestNetParams)
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// VertcoinParser handle
|
||||||
|
type VertcoinParser struct {
|
||||||
|
*btc.BitcoinParser
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewVertcoinParser returns new VertcoinParser instance
|
||||||
|
func NewVertcoinParser(params *chaincfg.Params, c *btc.Configuration) *VertcoinParser {
|
||||||
|
return &VertcoinParser{BitcoinParser: btc.NewBitcoinParser(params, c)}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetChainParams contains network parameters for the main Vertcoin network,
|
||||||
|
// and the test Vertcoin network
|
||||||
|
func GetChainParams(chain string) *chaincfg.Params {
|
||||||
|
switch chain {
|
||||||
|
case "test":
|
||||||
|
return &TestNetParams
|
||||||
|
default:
|
||||||
|
return &MainNetParams
|
||||||
|
}
|
||||||
|
}
|
||||||
61
bchain/coins/vertcoin/vertcoinrpc.go
Normal file
61
bchain/coins/vertcoin/vertcoinrpc.go
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
package vertcoin
|
||||||
|
|
||||||
|
import (
|
||||||
|
"blockbook/bchain"
|
||||||
|
"blockbook/bchain/coins/btc"
|
||||||
|
"encoding/json"
|
||||||
|
|
||||||
|
"github.com/golang/glog"
|
||||||
|
)
|
||||||
|
|
||||||
|
// VertcoinRPC is an interface to JSON-RPC bitcoind service.
|
||||||
|
type VertcoinRPC struct {
|
||||||
|
*btc.BitcoinRPC
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewVertcoinRPC returns new VertcoinRPC instance.
|
||||||
|
func NewVertcoinRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error) {
|
||||||
|
b, err := btc.NewBitcoinRPC(config, pushHandler)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
s := &VertcoinRPC{
|
||||||
|
b.(*btc.BitcoinRPC),
|
||||||
|
}
|
||||||
|
s.RPCMarshaler = btc.JSONMarshalerV2{}
|
||||||
|
|
||||||
|
return s, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize initializes VertcoinRPC instance.
|
||||||
|
func (b *VertcoinRPC) Initialize() error {
|
||||||
|
chainName, err := b.GetChainInfoAndInitializeMempool(b)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
glog.Info("Chain name ", chainName)
|
||||||
|
params := GetChainParams(chainName)
|
||||||
|
|
||||||
|
// always create parser
|
||||||
|
b.Parser = NewVertcoinParser(params, b.ChainConfig)
|
||||||
|
|
||||||
|
// parameters for getInfo request
|
||||||
|
if params.Net == MainnetMagic {
|
||||||
|
b.Testnet = false
|
||||||
|
b.Network = "livenet"
|
||||||
|
} else {
|
||||||
|
b.Testnet = true
|
||||||
|
b.Network = "testnet"
|
||||||
|
}
|
||||||
|
|
||||||
|
glog.Info("rpc: block chain ", params.Name)
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// EstimateFee returns fee estimation.
|
||||||
|
func (b *VertcoinRPC) EstimateFee(blocks int) (float64, error) {
|
||||||
|
return b.EstimateSmartFee(blocks, true)
|
||||||
|
}
|
||||||
1
build/deb/debian/blockbook-vertcoin-testnet.conffiles
Normal file
1
build/deb/debian/blockbook-vertcoin-testnet.conffiles
Normal file
@ -0,0 +1 @@
|
|||||||
|
/opt/coins/blockbook/vertcoin_testnet/config/blockchaincfg.json
|
||||||
2
build/deb/debian/blockbook-vertcoin-testnet.cron.daily
Normal file
2
build/deb/debian/blockbook-vertcoin-testnet.cron.daily
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
/opt/coins/blockbook/vertcoin_testnet/bin/logrotate.sh
|
||||||
2
build/deb/debian/blockbook-vertcoin-testnet.dirs
Normal file
2
build/deb/debian/blockbook-vertcoin-testnet.dirs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/opt/coins/data/vertcoin_testnet/blockbook
|
||||||
|
/opt/coins/blockbook/vertcoin_testnet/logs
|
||||||
6
build/deb/debian/blockbook-vertcoin-testnet.install
Executable file
6
build/deb/debian/blockbook-vertcoin-testnet.install
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/dh-exec
|
||||||
|
blockbook /opt/coins/blockbook/vertcoin_testnet/bin
|
||||||
|
cert /opt/coins/blockbook/vertcoin_testnet
|
||||||
|
static /opt/coins/blockbook/vertcoin_testnet
|
||||||
|
configs/vertcoin_testnet.json => /opt/coins/blockbook/vertcoin_testnet/config/blockchaincfg.json
|
||||||
|
logrotate.sh /opt/coins/blockbook/vertcoin_testnet/bin
|
||||||
2
build/deb/debian/blockbook-vertcoin-testnet.links
Normal file
2
build/deb/debian/blockbook-vertcoin-testnet.links
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/opt/coins/blockbook/vertcoin_testnet/cert/testcert.crt /opt/coins/blockbook/vertcoin_testnet/cert/blockbook.crt
|
||||||
|
/opt/coins/blockbook/vertcoin_testnet/cert/testcert.key /opt/coins/blockbook/vertcoin_testnet/cert/blockbook.key
|
||||||
23
build/deb/debian/blockbook-vertcoin-testnet.postinst
Normal file
23
build/deb/debian/blockbook-vertcoin-testnet.postinst
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
|
||||||
|
configure)
|
||||||
|
if ! id -u blockbook-vertcoin &> /dev/null
|
||||||
|
then
|
||||||
|
useradd --system -M -U blockbook-vertcoin -s /bin/false
|
||||||
|
fi
|
||||||
|
|
||||||
|
for dir in /opt/coins/data/vertcoin_testnet/blockbook /opt/coins/blockbook/vertcoin_testnet/logs
|
||||||
|
do
|
||||||
|
if [ "$(stat -c '%U' $dir)" != "blockbook-vertcoin" ]
|
||||||
|
then
|
||||||
|
chown -R blockbook-vertcoin:blockbook-vertcoin $dir
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
#DEBHELPER#
|
||||||
43
build/deb/debian/blockbook-vertcoin-testnet.service
Normal file
43
build/deb/debian/blockbook-vertcoin-testnet.service
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# 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-vertcoin-testnet.service
|
||||||
|
# See "man systemd.service" for details.
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Blockbook daemon (Vertcoin testnet)
|
||||||
|
After=network.target
|
||||||
|
Wants=backend-vertcoin-testnet.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/opt/coins/blockbook/vertcoin_testnet/bin/blockbook -blockchaincfg=/opt/coins/blockbook/vertcoin_testnet/config/blockchaincfg.json -datadir=/opt/coins/data/vertcoin_testnet/blockbook/db -sync -httpserver=:19040 -socketio=:19140 -certfile=/opt/coins/blockbook/vertcoin_testnet/cert/blockbook -explorer=http://explorer.vertcointools.com/ -log_dir=/opt/coins/blockbook/vertcoin_testnet/logs
|
||||||
|
User=blockbook-vertcoin
|
||||||
|
Type=simple
|
||||||
|
Restart=on-failure
|
||||||
|
WorkingDirectory=/opt/coins/blockbook/vertcoin_testnet
|
||||||
|
|
||||||
|
# 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
|
||||||
1
build/deb/debian/blockbook-vertcoin.conffiles
Normal file
1
build/deb/debian/blockbook-vertcoin.conffiles
Normal file
@ -0,0 +1 @@
|
|||||||
|
/opt/coins/blockbook/vertcoin/config/blockchaincfg.json
|
||||||
2
build/deb/debian/blockbook-vertcoin.cron.daily
Normal file
2
build/deb/debian/blockbook-vertcoin.cron.daily
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
/opt/coins/blockbook/vertcoin/bin/logrotate.sh
|
||||||
2
build/deb/debian/blockbook-vertcoin.dirs
Normal file
2
build/deb/debian/blockbook-vertcoin.dirs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/opt/coins/data/vertcoin/blockbook
|
||||||
|
/opt/coins/blockbook/vertcoin/logs
|
||||||
6
build/deb/debian/blockbook-vertcoin.install
Executable file
6
build/deb/debian/blockbook-vertcoin.install
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/dh-exec
|
||||||
|
blockbook /opt/coins/blockbook/vertcoin/bin
|
||||||
|
cert /opt/coins/blockbook/vertcoin
|
||||||
|
static /opt/coins/blockbook/vertcoin
|
||||||
|
configs/vertcoin.json => /opt/coins/blockbook/vertcoin/config/blockchaincfg.json
|
||||||
|
logrotate.sh /opt/coins/blockbook/vertcoin/bin
|
||||||
2
build/deb/debian/blockbook-vertcoin.links
Normal file
2
build/deb/debian/blockbook-vertcoin.links
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/opt/coins/blockbook/vertcoin/cert/testcert.crt /opt/coins/blockbook/vertcoin/cert/blockbook.crt
|
||||||
|
/opt/coins/blockbook/vertcoin/cert/testcert.key /opt/coins/blockbook/vertcoin/cert/blockbook.key
|
||||||
23
build/deb/debian/blockbook-vertcoin.postinst
Normal file
23
build/deb/debian/blockbook-vertcoin.postinst
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
|
||||||
|
configure)
|
||||||
|
if ! id -u blockbook-vertcoin &> /dev/null
|
||||||
|
then
|
||||||
|
useradd --system -M -U blockbook-vertcoin -s /bin/false
|
||||||
|
fi
|
||||||
|
|
||||||
|
for dir in /opt/coins/data/vertcoin/blockbook /opt/coins/blockbook/vertcoin/logs
|
||||||
|
do
|
||||||
|
if [ "$(stat -c '%U' $dir)" != "blockbook-vertcoin" ]
|
||||||
|
then
|
||||||
|
chown -R blockbook-vertcoin:blockbook-vertcoin $dir
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
#DEBHELPER#
|
||||||
43
build/deb/debian/blockbook-vertcoin.service
Normal file
43
build/deb/debian/blockbook-vertcoin.service
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# 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-vertcoin.service
|
||||||
|
# See "man systemd.service" for details.
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Blockbook daemon (Vertcoin mainnet)
|
||||||
|
After=network.target
|
||||||
|
Wants=backend-vertcoin.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/opt/coins/blockbook/vertcoin/bin/blockbook -blockchaincfg=/opt/coins/blockbook/vertcoin/config/blockchaincfg.json -datadir=/opt/coins/data/vertcoin/blockbook/db -sync -httpserver=:9040 -socketio=:9140 -certfile=/opt/coins/blockbook/vertcoin/cert/blockbook -explorer=https://insight.vertcoin.org/ -log_dir=/opt/coins/blockbook/vertcoin/logs
|
||||||
|
User=blockbook-vertcoin
|
||||||
|
Type=simple
|
||||||
|
Restart=on-failure
|
||||||
|
WorkingDirectory=/opt/coins/blockbook/vertcoin
|
||||||
|
|
||||||
|
# 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
|
||||||
@ -80,6 +80,16 @@ Architecture: amd64
|
|||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils, psmisc, backend-dogecoin
|
Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils, psmisc, backend-dogecoin
|
||||||
Description: Satoshilabs blockbook server (Dogecoin mainnet)
|
Description: Satoshilabs blockbook server (Dogecoin mainnet)
|
||||||
|
|
||||||
|
Package: blockbook-vertcoin
|
||||||
|
Architecture: amd64
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils, psmisc, backend-dogecoin
|
||||||
|
Description: Satoshilabs blockbook server (Vertcoin mainnet)
|
||||||
|
|
||||||
|
Package: blockbook-vertcoin-testnet
|
||||||
|
Architecture: amd64
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils, psmisc, backend-dogecoin
|
||||||
|
Description: Satoshilabs blockbook server (Vertcoin testnet)
|
||||||
|
|
||||||
Package: blockbook-namecoin
|
Package: blockbook-namecoin
|
||||||
Architecture: amd64
|
Architecture: amd64
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils, psmisc, backend-namecoin
|
Depends: ${shlibs:Depends}, ${misc:Depends}, coreutils, passwd, findutils, psmisc, backend-namecoin
|
||||||
|
|||||||
12
configs/vertcoin.json
Normal file
12
configs/vertcoin.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"coin_name": "Vertcoin",
|
||||||
|
"rpcURL": "http://localhost:8040",
|
||||||
|
"rpcUser": "rpc",
|
||||||
|
"rpcPass": "rpc",
|
||||||
|
"rpcTimeout": 25,
|
||||||
|
"parse": true,
|
||||||
|
"zeroMQBinding": "tcp://localhost:38340",
|
||||||
|
"mempoolWorkers": 8,
|
||||||
|
"mempoolSubWorkers": 2,
|
||||||
|
"blockAddressesToKeep": 300
|
||||||
|
}
|
||||||
12
configs/vertcoin_testnet.json
Normal file
12
configs/vertcoin_testnet.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"coin_name": "Vertcoin Testnet",
|
||||||
|
"rpcURL": "http://localhost:18040",
|
||||||
|
"rpcUser": "rpc",
|
||||||
|
"rpcPass": "rpc",
|
||||||
|
"rpcTimeout": 25,
|
||||||
|
"parse": true,
|
||||||
|
"zeroMQBinding": "tcp://localhost:48340",
|
||||||
|
"mempoolWorkers": 8,
|
||||||
|
"mempoolSubWorkers": 2,
|
||||||
|
"blockAddressesToKeep": 300
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
TARGETS = bitcoin zcash bcash ethereum bgold dash litecoin dogecoin namecoin
|
TARGETS = bitcoin zcash bcash ethereum bgold dash litecoin dogecoin vertcoin namecoin
|
||||||
IMAGE = blockbook-backend-build-deb
|
IMAGE = blockbook-backend-build-deb
|
||||||
NO_CACHE = false
|
NO_CACHE = false
|
||||||
|
|
||||||
|
|||||||
10
contrib/backends/vertcoin/Makefile
Normal file
10
contrib/backends/vertcoin/Makefile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
VERTCOIN_VERSION := 0.13.2
|
||||||
|
|
||||||
|
all:
|
||||||
|
wget https://github.com/vertcoin-project/vertcoin-core/releases/download/${VERTCOIN_VERSION}/vertcoind-v${VERTCOIN_VERSION}-linux-amd64.zip
|
||||||
|
mkdir vertcoin
|
||||||
|
unzip vertcoind-v${VERTCOIN_VERSION}-linux-amd64.zip -d vertcoin/
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf vertcoin
|
||||||
|
rm -f vertcoind-v${VERTCOIN_VERSION}-linux-amd64.zip
|
||||||
@ -0,0 +1 @@
|
|||||||
|
/opt/coins/nodes/vertcoin_testnet/vertcoin_testnet.conf
|
||||||
@ -0,0 +1 @@
|
|||||||
|
/opt/coins/data/vertcoin_testnet/backend
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
vertcoin/* /opt/coins/nodes/vertcoin_testnet
|
||||||
|
vertcoin_testnet.conf /opt/coins/nodes/vertcoin_testnet
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
/opt/coins/data/vertcoin_testnet/backend/testnet3/debug.log
|
||||||
|
/opt/coins/data/vertcoin_testnet/backend/testnet3/db.log
|
||||||
|
{
|
||||||
|
rotate 7
|
||||||
|
daily
|
||||||
|
compress
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
copytruncate
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
|
||||||
|
configure)
|
||||||
|
if ! id -u vertcoin &> /dev/null
|
||||||
|
then
|
||||||
|
useradd --system -M -U vertcoin -s /bin/false
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$(stat -c '%U' /opt/coins/data/vertcoin_testnet/backend)" != "vertcoin" ]
|
||||||
|
then
|
||||||
|
chown -R vertcoin:vertcoin /opt/coins/data/vertcoin_testnet/backend
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
#DEBHELPER#
|
||||||
@ -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 vertcoin-testnet.service
|
||||||
|
# See "man systemd.service" for details.
|
||||||
|
|
||||||
|
# Note that almost all daemon options could be specified in
|
||||||
|
# /opt/coins/nodes/vertcoin_testnet/vertcoin_testnet.conf
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=vertcoin daemon (testnet)
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/opt/coins/nodes/vertcoin_testnet/vertcoind -datadir=/opt/coins/data/vertcoin_testnet/backend -conf=/opt/coins/nodes/vertcoin_testnet/vertcoin_testnet.conf -pid=/run/vertcoind/vertcoin_testnet.pid
|
||||||
|
# Creates /run/vertcoind owned by vertcoin
|
||||||
|
RuntimeDirectory=vertcoind
|
||||||
|
User=vertcoin
|
||||||
|
Type=forking
|
||||||
|
PIDFile=/run/vertcoind/vertcoin_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
|
||||||
@ -0,0 +1 @@
|
|||||||
|
/opt/coins/nodes/vertcoin/vertcoin.conf
|
||||||
1
contrib/backends/vertcoin/debian/backend-vertcoin.dirs
Normal file
1
contrib/backends/vertcoin/debian/backend-vertcoin.dirs
Normal file
@ -0,0 +1 @@
|
|||||||
|
/opt/coins/data/vertcoin/backend
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
vertcoin/* /opt/coins/nodes/vertcoin
|
||||||
|
vertcoin.conf /opt/coins/nodes/vertcoin
|
||||||
10
contrib/backends/vertcoin/debian/backend-vertcoin.logrotate
Normal file
10
contrib/backends/vertcoin/debian/backend-vertcoin.logrotate
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/opt/coins/data/vertcoin/backend/debug.log
|
||||||
|
/opt/coins/data/vertcoin/backend/db.log
|
||||||
|
{
|
||||||
|
rotate 7
|
||||||
|
daily
|
||||||
|
compress
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
copytruncate
|
||||||
|
}
|
||||||
20
contrib/backends/vertcoin/debian/backend-vertcoin.postinst
Normal file
20
contrib/backends/vertcoin/debian/backend-vertcoin.postinst
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
|
||||||
|
configure)
|
||||||
|
if ! id -u vertcoin &> /dev/null
|
||||||
|
then
|
||||||
|
useradd --system -M -U vertcoin -s /bin/false
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$(stat -c '%U' /opt/coins/data/vertcoin/backend)" != "vertcoin" ]
|
||||||
|
then
|
||||||
|
chown -R vertcoin:vertcoin /opt/coins/data/vertcoin/backend
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
#DEBHELPER#
|
||||||
47
contrib/backends/vertcoin/debian/backend-vertcoin.service
Normal file
47
contrib/backends/vertcoin/debian/backend-vertcoin.service
Normal 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 vertcoin.service
|
||||||
|
# See "man systemd.service" for details.
|
||||||
|
|
||||||
|
# Note that almost all daemon options could be specified in
|
||||||
|
# /opt/coins/nodes/vertcoin/vertcoin.conf
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=vertcoin daemon (mainnet)
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/opt/coins/nodes/vertcoin/vertcoind -datadir=/opt/coins/data/vertcoin/backend -conf=/opt/coins/nodes/vertcoin/vertcoin.conf -pid=/run/vertcoind/vertcoin.pid
|
||||||
|
# Creates /run/vertcoind owned by vertcoin
|
||||||
|
RuntimeDirectory=vertcoind
|
||||||
|
User=vertcoin
|
||||||
|
Type=forking
|
||||||
|
PIDFile=/run/vertcoind/vertcoin.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
|
||||||
5
contrib/backends/vertcoin/debian/changelog
Normal file
5
contrib/backends/vertcoin/debian/changelog
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
vertcoin (0.13.2-satoshilabs1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Initial build
|
||||||
|
|
||||||
|
-- Petr Kracik <petr.kracik@satoshilabs.com> Thu, 21 Jun 2018 11:42:00 +0200
|
||||||
1
contrib/backends/vertcoin/debian/compat
Normal file
1
contrib/backends/vertcoin/debian/compat
Normal file
@ -0,0 +1 @@
|
|||||||
|
9
|
||||||
16
contrib/backends/vertcoin/debian/control
Normal file
16
contrib/backends/vertcoin/debian/control
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
Source: vertcoin
|
||||||
|
Section: satoshilabs
|
||||||
|
Priority: optional
|
||||||
|
Maintainer: petr.kracik@satoshilabs.com
|
||||||
|
Build-Depends: debhelper, wget, tar, gzip, make, dh-systemd, dh-exec
|
||||||
|
Standards-Version: 3.9.5
|
||||||
|
|
||||||
|
Package: backend-vertcoin
|
||||||
|
Architecture: amd64
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}, logrotate
|
||||||
|
Description: Satoshilabs packaged vertcoin server
|
||||||
|
|
||||||
|
Package: backend-vertcoin-testnet
|
||||||
|
Architecture: amd64
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}, logrotate
|
||||||
|
Description: Satoshilabs packaged vertcoin server
|
||||||
11
contrib/backends/vertcoin/debian/rules
Executable file
11
contrib/backends/vertcoin/debian/rules
Executable 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:
|
||||||
17
contrib/backends/vertcoin/vertcoin.conf
Normal file
17
contrib/backends/vertcoin/vertcoin.conf
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
daemon=1
|
||||||
|
server=1
|
||||||
|
nolisten=1
|
||||||
|
rpcuser=rpc
|
||||||
|
rpcpassword=rpc
|
||||||
|
rpcport=8040
|
||||||
|
txindex=1
|
||||||
|
whitelist=127.0.0.1
|
||||||
|
|
||||||
|
zmqpubhashtx=tcp://127.0.0.1:38340
|
||||||
|
zmqpubhashblock=tcp://127.0.0.1:38340
|
||||||
|
|
||||||
|
rpcworkqueue=1100
|
||||||
|
maxmempool=2000
|
||||||
|
dbcache=1000
|
||||||
|
|
||||||
|
|
||||||
15
contrib/backends/vertcoin/vertcoin_testnet.conf
Normal file
15
contrib/backends/vertcoin/vertcoin_testnet.conf
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
daemon=1
|
||||||
|
server=1
|
||||||
|
testnet=1
|
||||||
|
nolisten=1
|
||||||
|
rpcuser=rpc
|
||||||
|
rpcpassword=rpc
|
||||||
|
rpcport=18040
|
||||||
|
txindex=1
|
||||||
|
|
||||||
|
zmqpubhashtx=tcp://127.0.0.1:48340
|
||||||
|
zmqpubhashblock=tcp://127.0.0.1:48340
|
||||||
|
|
||||||
|
rpcworkqueue=1100
|
||||||
|
maxmempool=2000
|
||||||
|
dbcache=1000
|
||||||
Loading…
Reference in New Issue
Block a user