Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for neutrino clients #221

Open
wants to merge 4 commits into
base: releases/v0.7.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

TRACING=1

# CYPHERNODE VERSION "v0.6.0-dev", dev over v0.6.0
CONF_VERSION="v0.6.0-dev-local"
GATEKEEPER_VERSION="v0.6.0-dev-local"
TOR_VERSION="v0.6.0-dev-local"
PROXY_VERSION="v0.6.0-dev-local"
NOTIFIER_VERSION="v0.6.0-dev-local"
PROXYCRON_VERSION="v0.6.0-dev-local"
OTSCLIENT_VERSION="v0.6.0-dev-local"
PYCOIN_VERSION="v0.6.0-dev-local"
# CYPHERNODE VERSION "v0.7.0-rc.1"
CONF_VERSION="v0.7.0-rc.1-local"
GATEKEEPER_VERSION="v0.7.0-rc.1-local"
TOR_VERSION="v0.7.0-rc.1-local"
PROXY_VERSION="v0.7.0-rc.1-local"
NOTIFIER_VERSION="v0.7.0-rc.1-local"
PROXYCRON_VERSION="v0.7.0-rc.1-local"
OTSCLIENT_VERSION="v0.7.0-rc.1-local"
PYCOIN_VERSION="v0.7.0-rc.1-local"

trace()
{
Expand Down
2 changes: 1 addition & 1 deletion cyphernodeconf_docker/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh

VERSION=v0.6.0-dev
VERSION=v0.7.0-rc.1

docker build . -t cyphernode/cyphernodeconf:${VERSION}
1 change: 1 addition & 0 deletions cyphernodeconf_docker/help.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"bitcoin_rpcpassword": "Bitcoin Core's <font underline='true'>RPC password</font> used by Cyphernode when calling the node.",
"bitcoin_prune": "If you don't have at least 350GB of disk space, you should run Bitcoin Core in <font underline='true'>prune mode</font>. <font color='#00ff00'>NOTE</font>: when running Bitcoin Core in prune mode, the incoming transactions' fees cannot be computed by Cyphernode and won't be part of the addresses watching's callbacks payload.",
"bitcoin_prune_size": "Minimum <font underline='true'>size</font> is <font color='#00ff00'>550</font>. This option specifies the maximum number in MB Bitcoin Core will allocate for raw block & undo data.",
"bitcoin_cbf": "Compact Block Filters serve filtered block data to neutrino clients and have a networking overhead.",
"bitcoin_uacomment": "<font underline='true'>User Agent</font> string used by Bitcoin Core. (Optional)",
"bitcoin_datapath": "<font underline='true'>Path name</font> to where Bitcoin Core's data files (blockchain data, wallets, configs, etc.) are stored. This directory will be mounted into the Bitcoin node's container. If you already have a sync'ed node, you can copy data there to be used by the node, instead of resyncing everything. <font color='#00ff00'>NOTE</font>: only copy chainstate/ and blocks/ contents. <font color='#ff0000'>If running on OSX, check mountable directories in Docker's File Sharing configs.</font>",
"bitcoin_datapath_custom": " ",
Expand Down
6 changes: 6 additions & 0 deletions cyphernodeconf_docker/prompters/900_bitcoin.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ module.exports = {
return true;
}
}, // TODO: ask for size of prune
{
type: 'confirm',
name: 'bitcoin_cbf',
default: utils.getDefault( 'bitcoin_cbf' ),
message: prefix()+'Enable compact block filters?'+utils.getHelp('bitcoin_cbf')
},
{
when: bitcoinInternal,
type: 'input',
Expand Down
20 changes: 10 additions & 10 deletions cyphernodeconf_docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
export SETUP_DIR=$(pwd)/../dist
export DEFAULT_USER=$USER
export DEFAULT_CERT_HOSTNAME=disk0book.local
export PROXYCRON_VERSION=v0.6.0-dev
export PYCOIN_VERSION=v0.6.0-dev
export SETUP_VERSION=v0.6.0-dev
export BITCOIN_VERSION=v0.21.0
export LIGHTNING_VERSION=v0.9.1
export PROXYCRON_VERSION=v0.7.0-rc.1
export PYCOIN_VERSION=v0.7.0-rc.1
export SETUP_VERSION=v0.7.0-rc.1
export BITCOIN_VERSION=v0.21.1
export LIGHTNING_VERSION=v0.10.0
export DEFAULT_DATADIR_BASE=$HOME
export GATEKEEPER_VERSION=v0.6.0-dev
export TOR_VERSION=v0.6.0-dev
export PROXY_VERSION=v0.6.0-dev
export OTSCLIENT_VERSION=v0.6.0-dev
export NOTIFIER_VERSION=v0.6.0-dev
export GATEKEEPER_VERSION=v0.7.0-rc.1
export TOR_VERSION=v0.7.0-rc.1
export PROXY_VERSION=v0.7.0-rc.1
export OTSCLIENT_VERSION=v0.7.0-rc.1
export NOTIFIER_VERSION=v0.7.0-rc.1
export EDITOR=/usr/bin/nano
export TRAEFIK_VERSION="v1.7.9-alpine"
export MOSQUITTO_VERSION="1.6"
Expand Down
10 changes: 10 additions & 0 deletions cyphernodeconf_docker/schema/config-v0.2.5.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"bitcoin_rpcuser",
"bitcoin_rpcpassword",
"bitcoin_prune",
"bitcoin_cbf",
"bitcoin_datapath",
"bitcoin_mode",
"bitcoin_expose",
Expand Down Expand Up @@ -375,6 +376,15 @@
550
]
},
"bitcoin_cbf": {
"$id": "#/properties/bitcoin_cbf",
"type": "boolean",
"title": "Bitcoin serve compact block filters",
"default": false,
"examples": [
"false"
]
},
"bitcoin_datapath": {
"$id": "#/properties/bitcoin_datapath",
"type": "string",
Expand Down
5 changes: 5 additions & 0 deletions cyphernodeconf_docker/templates/bitcoin/bitcoin.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ prune=<%= bitcoin_prune_size || 550 %>
<% } else { %>
txindex=1
blockfilterindex=1
<% if ( bitcoin_cbf ) { %>
peerblockfilters=1
<% } %>
<% } %>



zmqpubrawblock=tcp://0.0.0.0:18501
zmqpubrawtx=tcp://0.0.0.0:18502
Expand Down
22 changes: 11 additions & 11 deletions dist/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -849,17 +849,17 @@ ALWAYSYES=0
SUDO_REQUIRED=0
AUTOSTART=0

# CYPHERNODE VERSION "v0.6.0-dev", dev over v0.6.0
SETUP_VERSION="v0.6.0-dev"
CONF_VERSION="v0.6.0-dev"
GATEKEEPER_VERSION="v0.6.0-dev"
TOR_VERSION="v0.6.0-dev"
PROXY_VERSION="v0.6.0-dev"
NOTIFIER_VERSION="v0.6.0-dev"
PROXYCRON_VERSION="v0.6.0-dev"
OTSCLIENT_VERSION="v0.6.0-dev"
PYCOIN_VERSION="v0.6.0-dev"
CYPHERAPPS_VERSION="dev"
# CYPHERNODE VERSION "v0.7.0-rc.1"
SETUP_VERSION="v0.7.0-rc.1"
CONF_VERSION="v0.7.0-rc.1"
GATEKEEPER_VERSION="v0.7.0-rc.1"
TOR_VERSION="v0.7.0-rc.1"
PROXY_VERSION="v0.7.0-rc.1"
NOTIFIER_VERSION="v0.7.0-rc.1"
PROXYCRON_VERSION="v0.7.0-rc.1"
OTSCLIENT_VERSION="v0.7.0-rc.1"
PYCOIN_VERSION="v0.7.0-rc.1"
CYPHERAPPS_VERSION="releases/v0.7.0"
BITCOIN_VERSION="v0.21.1"
LIGHTNING_VERSION="v0.10.0"
TRAEFIK_VERSION="v1.7.9-alpine"
Expand Down
6 changes: 3 additions & 3 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ aarch64_docker="arm64"
#arch_docker=${aarch64_docker}
arch_docker=${x86_docker}

v1="v0"
v2="v0.6"
v3="v0.6.0"
v1="v0-rc.1"
v2="v0.7-rc.1"
v3="v0.7.0-rc.1"

echo "\nBuilding Cyphernode Core containers\n"
echo "arch_docker=$arch_docker\n"
Expand Down
3 changes: 2 additions & 1 deletion proxy_docker/app/script/batching.sh
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ removefrombatch() {
trace "[removefrombatch] id missing"
response='{"result":null,"error":{"code":-32700,"message":"outputId is required","data":'${request}'}}'
else
batcher_id=$(sql "SELECT batcher_id FROM recipient WHERE id=${id}")
# We don't want to remove an already spent output
batcher_id=$(sql "SELECT batcher_id FROM recipient WHERE id=${id} AND tx_id IS NULL")
returncode=$?
trace_rc ${returncode}

Expand Down
14 changes: 13 additions & 1 deletion proxy_docker/app/script/watchrequest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ watchtxidrequest() {
trace "[watchtxidrequest] cbxconf_url=${cbxconf_url}"
local nbxconf=$(echo "${request}" | jq ".nbxconf")
trace "[watchtxidrequest] nbxconf=${nbxconf}"
local cb1cond
local cbxcond
local inserted
local id_inserted
local result
Expand All @@ -353,7 +355,17 @@ watchtxidrequest() {

if [ "${returncode}" -eq 0 ]; then
inserted=1
id_inserted=$(sql "SELECT id FROM watching_by_txid WHERE txid=${txid} AND callback1conf=${cb1conf_url} AND callbackxconf=${cbxconf_url}")
if [ "${cb1conf_url}" = "null" ]; then
cb1cond=" IS NULL"
else
cb1cond="=${cb1conf_url}"
fi
if [ "${cbxconf_url}" = "null" ]; then
cbxcond=" IS NULL"
else
cbxcond="=${cbxconf_url}"
fi
id_inserted=$(sql "SELECT id FROM watching_by_txid WHERE txid=${txid} AND callback1conf${cb1cond} AND callbackxconf${cbxcond}")
trace "[watchtxidrequest] id_inserted: ${id_inserted}"
else
inserted=0
Expand Down