Merge pull request #1081 from naconner/monero-update
fix: add xmr to lamassu-update-wallet-nodes
This commit is contained in:
commit
69ca308408
2 changed files with 26 additions and 5 deletions
|
|
@ -8,11 +8,12 @@ const cryptos = coinUtils.cryptoCurrencies()
|
||||||
|
|
||||||
const PLUGINS = {
|
const PLUGINS = {
|
||||||
BTC: require('../lib/blockchain/bitcoin.js'),
|
BTC: require('../lib/blockchain/bitcoin.js'),
|
||||||
LTC: require('../lib/blockchain/litecoin.js'),
|
BCH: require('../lib/blockchain/bitcoincash.js'),
|
||||||
ETH: require('../lib/blockchain/ethereum.js'),
|
|
||||||
DASH: require('../lib/blockchain/dash.js'),
|
DASH: require('../lib/blockchain/dash.js'),
|
||||||
ZEC: require('../lib/blockchain/zcash.js'),
|
ETH: require('../lib/blockchain/ethereum.js'),
|
||||||
BCH: require('../lib/blockchain/bitcoincash.js')
|
LTC: require('../lib/blockchain/litecoin.js'),
|
||||||
|
XMR: require('../lib/blockchain/monero.js'),
|
||||||
|
ZEC: require('../lib/blockchain/zcash.js')
|
||||||
}
|
}
|
||||||
|
|
||||||
function plugin (crypto) {
|
function plugin (crypto) {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ const { utils } = require('lamassu-coins')
|
||||||
|
|
||||||
const common = require('./common')
|
const common = require('./common')
|
||||||
|
|
||||||
module.exports = {setup}
|
module.exports = { setup, updateCore }
|
||||||
|
|
||||||
const coinRec = utils.getCryptoCurrency('XMR')
|
const coinRec = utils.getCryptoCurrency('XMR')
|
||||||
|
|
||||||
|
|
@ -18,6 +18,26 @@ function setup (dataDir) {
|
||||||
common.writeSupervisorConfig(coinRec, cmd, walletCmd)
|
common.writeSupervisorConfig(coinRec, cmd, walletCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateCore (coinRec, isCurrentlyRunning) {
|
||||||
|
common.logger.info('Updating Monero. This may take a minute...')
|
||||||
|
common.es(`sudo supervisorctl stop monero monero-wallet`)
|
||||||
|
common.es(`curl -#o /tmp/monero.tar.gz ${coinRec.url}`)
|
||||||
|
common.es(`tar -xf /tmp/monero.tar.gz -C /tmp/`)
|
||||||
|
|
||||||
|
common.logger.info('Updating wallet...')
|
||||||
|
common.es(`cp /tmp/${coinRec.dir}/monerod /usr/local/bin/monerod`)
|
||||||
|
common.es(`cp /tmp/${coinRec.dir}/monero-wallet-rpc /usr/local/bin/monero-wallet-rpc`)
|
||||||
|
common.es(`rm -r /tmp/${coinRec.dir.replace('/bin', '')}`)
|
||||||
|
common.es(`rm /tmp/monero.tar.gz`)
|
||||||
|
|
||||||
|
if (isCurrentlyRunning) {
|
||||||
|
common.logger.info('Starting wallet...')
|
||||||
|
common.es(`sudo supervisorctl start monero monero-wallet`)
|
||||||
|
}
|
||||||
|
|
||||||
|
common.logger.info('Monero is updated!')
|
||||||
|
}
|
||||||
|
|
||||||
function buildConfig (auth) {
|
function buildConfig (auth) {
|
||||||
return `rpc-login=${auth}
|
return `rpc-login=${auth}
|
||||||
stagenet=0
|
stagenet=0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue