chore: initial function stubs
This commit is contained in:
parent
b190b349b3
commit
75cb094476
2 changed files with 18 additions and 3 deletions
|
|
@ -112,6 +112,11 @@ function plugin (crypto) {
|
||||||
return plugin
|
return plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getSyncedBlockchains (cryptoList) {
|
||||||
|
const installedCryptos = _.reduce((acc, value) => ({ ...acc, [value.cryptoCode]: isInstalledSoftware(value) && isInstalledVolume(value) }), {}, cryptoList)
|
||||||
|
const syncedBlockchains = plugin()
|
||||||
|
}
|
||||||
|
|
||||||
function run () {
|
function run () {
|
||||||
const choices = _.flow([
|
const choices = _.flow([
|
||||||
_.filter(c => c.type !== 'erc-20'),
|
_.filter(c => c.type !== 'erc-20'),
|
||||||
|
|
@ -132,10 +137,14 @@ function run () {
|
||||||
questions.push({
|
questions.push({
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
name: 'crypto',
|
name: 'crypto',
|
||||||
message: 'Which cryptocurrencies would you like to install?',
|
message: 'Which cryptocurrencies would you like to install?\nTo prevent server resource overloading, only TWO coins should be installed simultaneously.\nMore coins can be installed after this process is over.',
|
||||||
choices
|
choices,
|
||||||
|
validate: (a) => {
|
||||||
|
getSyncedBlockchains(cryptos)
|
||||||
|
return _.size(a) > 0 && _.size(a) <= 2
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
inquirer.prompt(questions)
|
inquirer.prompt(questions)
|
||||||
.then(answers => processCryptos(answers.crypto))
|
.then(answers => console.log('answers', answers) /* processCryptos(answers.crypto) */)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,12 @@ function supportsBatching (cryptoCode) {
|
||||||
.then(() => SUPPORTS_BATCHING)
|
.then(() => SUPPORTS_BATCHING)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkBlockchainStatus (cryptoCode) {
|
||||||
|
return checkCryptoCode(cryptoCode)
|
||||||
|
.then(() => fetch('getblockchaininfo'))
|
||||||
|
.then(res => !!res['initialblockdownload'] ? 'ready' : 'syncing')
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
balance,
|
balance,
|
||||||
sendCoins,
|
sendCoins,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue