This commit is contained in:
jash
2018-10-07 19:39:25 +02:00
committed by kexkey
parent 65cce8b652
commit cce9c1397a
9 changed files with 55 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
const name = 'cyphernode';
const name = 'proxy';
module.exports = {
name: function() {
@@ -15,8 +15,8 @@ module.exports = {
},
{
type: 'list',
name: 'cyphernode_net',
default: utils._getDefault( 'cyphernode_net' ),
name: 'net',
default: utils._getDefault( 'net' ),
message: 'What net do you want to run on?'+'\n',
choices: [{
name: "Testnet",
@@ -28,16 +28,20 @@ module.exports = {
},
{
type: 'input',
name: 'cyphernode_xpub',
default: utils._getDefault( 'cyphernode_xpub' ),
name: 'xpub',
default: utils._getDefault( 'xpub' ),
message: 'What is your xpub to watch?'+'\n',
validate: utils._xkeyValidator
},
{
type: 'input',
name: 'derivation_path',
default: utils._getDefault( 'derivation_path' ),
message: 'What is your address derivation path?'+'\n',
validate: utils._derivationPathValidator
}];
},
env: function( props ) {
return 'VAR0=VALUE0\nVAR1=VALUE1'
},
templates: function( props ) {
return [];
return [ 'env.properties' ];
}
};

View File

@@ -63,6 +63,13 @@ module.exports = {
name: 'bitcoin_expose',
default: utils._getDefault( 'bitcoin_expose' ),
message: 'Expose bitcoin full node outside of the docker network?'+'\n',
},
{
when: bitcoinInternal,
type: 'input',
name: 'bitcoin_uacomment',
default: utils._getDefault( 'bitcoin_uacomment' ),
message: 'Any UA comment?'+'\n',
}];
},
env: function( props ) {

View File

@@ -41,9 +41,6 @@ module.exports = {
message: 'What external ip does your lightning node have?'+'\n',
}];
},
env: function( props ) {
return 'VAR0=VALUE0\nVAR1=VALUE1'
},
templates: function( props ) {
return templates[props.lightning_implementation]
}

View File

@@ -26,9 +26,6 @@ module.exports = {
]
}];
},
env: function( props ) {
return 'VAR0=VALUE0\nVAR1=VALUE1'
},
templates: function( props ) {
return [];
}

View File

@@ -11,9 +11,6 @@ module.exports = {
prompts: function( utils ) {
return [];
},
env: function( props ) {
return 'VAR0=VALUE0\nVAR1=VALUE1';
},
templates: function( props ) {
return [];
}

View File

@@ -22,7 +22,9 @@ module.exports = class extends Generator {
if( fs.existsSync(this.destinationPath('props.json')) ) {
this.props = require(this.destinationPath('props.json'));
} else {
this.props = {};
this.props = {
'derivation_path': '0/n'
};
}
this.featureChoices = featureChoices;
@@ -51,9 +53,7 @@ module.exports = class extends Generator {
fs.writeFileSync(this.destinationPath('props.json'), JSON.stringify(this.props, null, 2));
for( let m of featurePromptModules ) {
const name = m.name();
fs.writeFileSync(this.destinationPath(name+'.properties'), m.env());
const name = m.name();
for( let t of m.templates(this.props) ) {
const p = path.join(name,t);
this.fs.copyTpl(
@@ -62,7 +62,6 @@ module.exports = class extends Generator {
this.props
);
}
}
}
@@ -80,12 +79,10 @@ module.exports = class extends Generator {
_ipOrFQDNValidator( host ) {
host = (host+"").trim();
if( !(validator.isIP(host) ||
validator.isFQDN(host)) ) {
throw new Error( 'No IP address or fully qualified domain name' )
}
return true;
}
@@ -94,10 +91,12 @@ module.exports = class extends Generator {
if( !coinstring.isValid( xpub ) ) {
throw new Error('Not an extended key.');
}
return true;
}
_derivationPathValidator( path ) {
return true;
}
_trimFilter( input ) {
return (input+"").trim();

View File

@@ -1,4 +1,4 @@
<% if (cyphernode_net === 'testnet') { %>
<% if (net === 'testnet') { %>
# testnet
testnet=1
<% } %>
@@ -14,7 +14,13 @@ zmqpubrawtx=tcp://0.0.0.0:18502
#proxy=127.0.0.1:9050
#listen=1
rpcconnect=btcnode
rpcconnect=bitcoin
rpcuser=<%= bitcoin_rpcuser %>
rpcpassword=<%= bitcoin_rpcpassword %>
# why?
rpcwallet=ln01.dat
<% if ( bitcoin_uacomment != null && bitcoin_uacomment != '' ) { %>
uacomment=<%= bitcoin_uacomment %>
<% } %>

View File

@@ -0,0 +1,19 @@
TRACING=1
WATCHER_BTC_NODE_RPC_URL=btcnode:<%= (net === 'mainnet')?'8332':'18332' %>/wallet/watching01.dat
WATCHER_BTC_NODE_RPC_USER=<%= bitcoin_rpcuser %>:<%= bitcoin_rpcpassword %>
WATCHER_BTC_NODE_RPC_CFG=/proxyuser/watcher_btcnode_curlcfg.properties
SPENDER_BTC_NODE_RPC_URL=btcnode:<%= (net === 'mainnet')?'8332':'18332' %>/wallet/spending01.dat
SPENDER_BTC_NODE_RPC_USER=<%= bitcoin_rpcuser %>:<%= bitcoin_rpcpassword %>
SPENDER_BTC_NODE_RPC_CFG=/proxyuser/sender_btcnode_curlcfg.properties
PROXY_LISTENING_PORT=8888
# Variable substitutions don't work
DB_PATH=/proxyuser/db
DB_FILE=/proxyuser/db/proxydb
# Pycoin container
PYCOIN_CONTAINER=pycoinnode:7777
# OTS container
OTS_CONTAINER=otsnode:6666
DERIVATION_PUB32=<%= xpub %>
DERIVATION_PATH=<%= derivation_path %>
WATCHER_BTC_NODE_PRUNED=<%= bitcoin_prune?'true':'false' %>

View File

@@ -16,7 +16,7 @@ trace "Updating SatoshiPortal dockers"
#
## build cyphernode images
#build_docker_image ../../cron_docker/ proxycronimg
#build_docker_image ../../proxy_docker/ btcproxyimg
build_docker_image ../../proxy_docker/ btcproxyimg
#build_docker_image ../../pycoin_docker/ pycoinimg
#
## build setup docker image