From 0cc325e60b17bce3238d4f528c45a7959c3aed78 Mon Sep 17 00:00:00 2001 From: SKP Date: Fri, 19 Jul 2019 11:28:52 +0200 Subject: [PATCH] Added regtest support --- cyphernodeconf_docker/prompters/000_cyphernode.js | 3 +++ cyphernodeconf_docker/schema/config-v0.2.2.json | 3 ++- cyphernodeconf_docker/templates/bitcoin/bitcoin.conf | 10 ++++++++++ .../templates/installer/docker/docker-compose.yaml | 8 ++++---- .../templates/lightning/c-lightning/bitcoin.conf | 3 +++ .../templates/lightning/c-lightning/config | 5 ++++- 6 files changed, 26 insertions(+), 6 deletions(-) diff --git a/cyphernodeconf_docker/prompters/000_cyphernode.js b/cyphernodeconf_docker/prompters/000_cyphernode.js index c848730..f5bde84 100644 --- a/cyphernodeconf_docker/prompters/000_cyphernode.js +++ b/cyphernodeconf_docker/prompters/000_cyphernode.js @@ -34,6 +34,9 @@ module.exports = { },{ name: "Mainnet", value: "mainnet" + },{ + name: "RegTest", + value: "regtest" }] }, { diff --git a/cyphernodeconf_docker/schema/config-v0.2.2.json b/cyphernodeconf_docker/schema/config-v0.2.2.json index 9af3d14..4dfcaa9 100644 --- a/cyphernodeconf_docker/schema/config-v0.2.2.json +++ b/cyphernodeconf_docker/schema/config-v0.2.2.json @@ -178,7 +178,8 @@ "type": "string", "enum": [ "testnet", - "mainnet" + "mainnet", + "regtest" ], "title": "The net cyphernode is running on", "default": "testnet", diff --git a/cyphernodeconf_docker/templates/bitcoin/bitcoin.conf b/cyphernodeconf_docker/templates/bitcoin/bitcoin.conf index cf299ee..019ca5d 100644 --- a/cyphernodeconf_docker/templates/bitcoin/bitcoin.conf +++ b/cyphernodeconf_docker/templates/bitcoin/bitcoin.conf @@ -1,6 +1,9 @@ <% if (net === 'testnet') { %> # testnet testnet=1 +<% } else if( net === 'regtest' ) { %> +# regtest +regtest=1 <% } %> <% if (bitcoin_prune && bitcoin_mode === 'internal') { %> @@ -32,6 +35,13 @@ test.wallet=xpubwatching01.dat test.wallet=spending01.dat test.wallet=ln01.dat test.rpcbind=0.0.0.0 +<% } else if ( net === 'regtest' ) { %> +regtest.wallet=watching01.dat +regtest.wallet=xpubwatching01.dat +regtest.wallet=spending01.dat +regtest.wallet=ln01.dat +regtest.rpcbind=0.0.0.0 +regtest.rpcport=18443 <% } else { %> main.wallet=watching01.dat main.wallet=xpubwatching01.dat diff --git a/cyphernodeconf_docker/templates/installer/docker/docker-compose.yaml b/cyphernodeconf_docker/templates/installer/docker/docker-compose.yaml index d4701d3..7cfb269 100644 --- a/cyphernodeconf_docker/templates/installer/docker/docker-compose.yaml +++ b/cyphernodeconf_docker/templates/installer/docker/docker-compose.yaml @@ -52,12 +52,12 @@ services: # Bitcoin Mini Proxy environment: - "TRACING=1" - - "WATCHER_BTC_NODE_RPC_URL=<%= (bitcoin_mode === 'internal')?'bitcoin':bitcoin_node_ip %>:<%= (net === 'mainnet')?'8332':'18332' %>/wallet" + - "WATCHER_BTC_NODE_RPC_URL=<%= (bitcoin_mode === 'internal')?'bitcoin':bitcoin_node_ip %>:<%= (net === 'regtest')?'18443':((net === 'testnet')?'18332':'8332') %>/wallet" - "WATCHER_BTC_NODE_DEFAULT_WALLET=watching01.dat" - "WATCHER_BTC_NODE_XPUB_WALLET=xpubwatching01.dat" - "WATCHER_BTC_NODE_RPC_USER=<%= bitcoin_rpcuser %>:<%= bitcoin_rpcpassword %>" - "WATCHER_BTC_NODE_RPC_CFG=/tmp/watcher_btcnode_curlcfg.properties" - - "SPENDER_BTC_NODE_RPC_URL=<%= (bitcoin_mode === 'internal')?'bitcoin':bitcoin_node_ip %>:<%= (net === 'mainnet')?'8332':'18332' %>/wallet" + - "SPENDER_BTC_NODE_RPC_URL=<%= (bitcoin_mode === 'internal')?'bitcoin':bitcoin_node_ip %>:<%= (net === 'regtest')?'18443':((net === 'testnet')?'18332':'8332') %>/wallet" - "SPENDER_BTC_NODE_DEFAULT_WALLET=spending01.dat" - "SPENDER_BTC_NODE_RPC_USER=<%= bitcoin_rpcuser %>:<%= bitcoin_rpcpassword %>" - "SPENDER_BTC_NODE_RPC_CFG=/tmp/spender_btcnode_curlcfg.properties" @@ -164,7 +164,7 @@ services: image: cyphernode/bitcoin:<%= bitcoin_version %> <% if( bitcoin_expose ) { %> ports: - - "<%= (net === 'mainnet')?'8332:8332':'18332:18332' %>" + - "<%= (net === 'regtest')?'18443:18443':((net === 'testnet')?'18332:18332':'8332:8332') %>" <% } %> # deploy: # placement: @@ -200,4 +200,4 @@ networks: cyphernodenet: external: true cyphernodeappsnet: - external: true \ No newline at end of file + external: true diff --git a/cyphernodeconf_docker/templates/lightning/c-lightning/bitcoin.conf b/cyphernodeconf_docker/templates/lightning/c-lightning/bitcoin.conf index bed4730..e9402e8 100644 --- a/cyphernodeconf_docker/templates/lightning/c-lightning/bitcoin.conf +++ b/cyphernodeconf_docker/templates/lightning/c-lightning/bitcoin.conf @@ -1,6 +1,9 @@ <% if (net === 'testnet') { %> # testnet testnet=1 +<% } else if( net === 'regtest' ) { %> +# regtest +regtest=1 <% } %> rpcconnect=<%= (bitcoin_mode === 'internal')?'bitcoin':bitcoin_node_ip %> diff --git a/cyphernodeconf_docker/templates/lightning/c-lightning/config b/cyphernodeconf_docker/templates/lightning/c-lightning/config index bc1b855..66eb382 100644 --- a/cyphernodeconf_docker/templates/lightning/c-lightning/config +++ b/cyphernodeconf_docker/templates/lightning/c-lightning/config @@ -1,4 +1,7 @@ -<% if (net === 'testnet') { %> +<% if (net === 'regtest') { %> +# regtest +network=regtest +<% } else if (net === 'testnet') { %> # testnet network=testnet <% } else if (net === 'mainnet') { %>