From 453248201511abd9a2e681fcac31987abc6cbdee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20S=C3=A1?= Date: Thu, 30 Dec 2021 14:23:14 +0000 Subject: [PATCH 1/4] fix: bitcoind install --- lib/blockchain/bitcoin.js | 2 +- lib/blockchain/install.js | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/blockchain/bitcoin.js b/lib/blockchain/bitcoin.js index b6f9f31b..272b5a55 100644 --- a/lib/blockchain/bitcoin.js +++ b/lib/blockchain/bitcoin.js @@ -18,7 +18,7 @@ function setup (dataDir) { function updateCore (coinRec, isCurrentlyRunning) { common.logger.info('Updating Bitcoin Core. This may take a minute...') - if (isCurrentlyRunning) common.es(`sudo supervisorctl stop bitcoin`) + common.es(`sudo supervisorctl stop bitcoin`) common.es(`curl -#o /tmp/bitcoin.tar.gz ${coinRec.url}`) common.es(`tar -xzf /tmp/bitcoin.tar.gz -C /tmp/`) diff --git a/lib/blockchain/install.js b/lib/blockchain/install.js index 8596d8f9..554e3951 100644 --- a/lib/blockchain/install.js +++ b/lib/blockchain/install.js @@ -71,7 +71,10 @@ function processCryptos (codes) { ) | crontab -` common.es(rsyncCmd) - _.forEach(updateCrypto, selectedCryptos) + _.forEach(c => { + updateCrypto(c) + common.es(`sudo supervisorctl start ${c.code}`) + }, selectedCryptos) logger.info('Installation complete.') } @@ -98,7 +101,9 @@ function setupCrypto (crypto) { function updateCrypto (crypto) { if (!common.isUpdateDependent(crypto.cryptoCode)) return const cryptoPlugin = plugin(crypto) - cryptoPlugin.updateCore(common.getBinaries(crypto.cryptoCode)) + const status = common.es(`sudo supervisorctl status ${crypto.code} | awk '{ print $2 }'`).trim() + const isCurrentlyRunning = status === 'RUNNING' + cryptoPlugin.updateCore(common.getBinaries(crypto.cryptoCode), isCurrentlyRunning) } function plugin (crypto) { From 2cbc0e06fcb526329e8ea3848fcdc1dfbe87aeed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20S=C3=A1?= Date: Thu, 30 Dec 2021 14:26:43 +0000 Subject: [PATCH 2/4] fix: Monero install --- lib/blockchain/common.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/blockchain/common.js b/lib/blockchain/common.js index 0f0625e6..273515e2 100644 --- a/lib/blockchain/common.js +++ b/lib/blockchain/common.js @@ -123,9 +123,7 @@ function fetchAndInstall (coinRec) { const binDir = requiresUpdate ? binaries.defaultDir : binaries.dir es(`wget -q ${url}`) - es(`echo ${downloadFile} | awk -F. '{print $NF}'`) === 'bz2' - ? es(`tar -xf ${downloadFile}`) - : es(`tar -xzf ${downloadFile}`) + es(`tar -xf ${downloadFile}`) if (_.isEmpty(binaries.files)) { es(`sudo cp ${binDir}/* /usr/local/bin`) From 21ce8b301b05546204b027c0c0e97e4440255015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20S=C3=A1?= Date: Thu, 30 Dec 2021 15:16:18 +0000 Subject: [PATCH 3/4] refactor: filter Tether/USDT from install candidates --- lib/blockchain/install.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/blockchain/install.js b/lib/blockchain/install.js index 554e3951..efc48107 100644 --- a/lib/blockchain/install.js +++ b/lib/blockchain/install.js @@ -113,15 +113,18 @@ function plugin (crypto) { } function run () { - const choices = _.map(c => { - const checked = isInstalledSoftware(c) && isInstalledVolume(c) - return { - name: c.display, - value: c.code, - checked, - disabled: checked && 'Installed' - } - }, cryptos) + const choices = _.flow([ + _.filter(c => c.type !== 'erc-20'), + _.map(c => { + const checked = isInstalledSoftware(c) && isInstalledVolume(c) + return { + name: c.display, + value: c.code, + checked, + disabled: checked && 'Installed' + } + }), + ])(cryptos) const questions = [] From 8180afa7f7448f42213a34c0c8f8a7929fa4ef26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20S=C3=A1?= Date: Tue, 18 Jan 2022 10:23:46 +0000 Subject: [PATCH 4/4] fix: require path --- lib/plugins/common/json-rpc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugins/common/json-rpc.js b/lib/plugins/common/json-rpc.js index de3c7129..463dc2fa 100644 --- a/lib/plugins/common/json-rpc.js +++ b/lib/plugins/common/json-rpc.js @@ -6,7 +6,7 @@ const _ = require('lodash/fp') const request = require('request-promise') const { utils: coinUtils } = require('lamassu-coins') -const options = require('../../../options') +const options = require('../../options') const blockchainDir = options.blockchainDir