full node is no longer a feature. Cyphernode needs an internal or external full node to be present

This commit is contained in:
jash
2018-10-06 22:51:16 +02:00
committed by kexkey
parent 16d78de422
commit 2bd641285b
2 changed files with 53 additions and 8 deletions

View File

@@ -1,8 +1,4 @@
[
{
"name": "Bitcoin full node",
"value": "bitcoin"
},
{
"name": "Lightning node",
"value": "lightning"

View File

@@ -1,6 +1,11 @@
const name = 'bitcoin';
const featureCondition = function(props) {
return props.features && props.features.indexOf( name ) != -1;
const bitcoinExternal = function(props) {
return props.bitcoin_mode === 'external'
};
const bitcoinInternal = function(props) {
return props.bitcoin_mode === 'internal'
};
module.exports = {
@@ -8,12 +13,56 @@ module.exports = {
return name;
},
prompts: function( utils ) {
return [{
when: featureCondition,
return [
{
type: 'list',
name: 'bitcoin_mode',
default: utils._getDefault( 'bitcoin_mode' ),
message: 'Where is your bitcoin full node running?'+'\n',
choices: [
{
name: 'Nowhere! I want cyphernode to run one.',
value: 'internal'
},
{
name: 'I have a full node running.',
value: 'external'
}
]
},
{
when: bitcoinExternal,
type: 'input',
name: 'bitcoin_node_ip',
default: utils._getDefault( 'bitcoin_node_ip' ),
validate: utils._ipValidator,
message: 'What is your full node ip address?'+'\n',
},
{
type: 'input',
name: 'bitcoin_rpcuser',
default: utils._getDefault( 'bitcoin_rpcuser' ),
message: 'Name of bitcoin rpc user?'+'\n',
},
{
type: 'password',
name: 'bitcoin_rpcpassword',
default: utils._getDefault( 'bitcoin_rpcpassword' ),
message: 'Password of bitcoin rpc user?'+'\n',
},
{
when: bitcoinInternal,
type: 'confirm',
name: 'bitcoin_prune',
default: utils._getDefault( 'bitcoin_prune' ),
message: 'Run bitcoin node in prune mode?'+'\n',
},
{
when: bitcoinInternal,
type: 'confirm',
name: 'bitcoin_expose',
default: utils._getDefault( 'bitcoin_expose' ),
message: 'Expose bitcoin full node outside of the docker network?'+'\n',
}];
},
env: function( props ) {