Add BCH
This commit is contained in:
parent
28979e475c
commit
548d285e5b
20 changed files with 216 additions and 227 deletions
|
|
@ -3,6 +3,9 @@ const os = require('os')
|
|||
const path = require('path')
|
||||
const cp = require('child_process')
|
||||
const fs = require('fs')
|
||||
|
||||
const _ = require('lodash/fp')
|
||||
|
||||
const logger = require('console-log-level')({level: 'info'})
|
||||
|
||||
module.exports = {
|
||||
|
|
@ -18,8 +21,8 @@ module.exports = {
|
|||
|
||||
const BINARIES = {
|
||||
BTC: {
|
||||
url: 'https://bitcoin.org/bin/bitcoin-core-0.14.2/bitcoin-0.14.2-x86_64-linux-gnu.tar.gz',
|
||||
dir: 'bitcoin-0.14.2/bin'
|
||||
url: 'https://bitcoin.org/bin/bitcoin-core-0.15.1/bitcoin-0.15.1-x86_64-linux-gnu.tar.gz',
|
||||
dir: 'bitcoin-0.15.1/bin'
|
||||
},
|
||||
ETH: {
|
||||
url: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.7.2-1db4ecdc.tar.gz',
|
||||
|
|
@ -30,12 +33,17 @@ const BINARIES = {
|
|||
dir: 'zcash-1.0.12/bin'
|
||||
},
|
||||
DASH: {
|
||||
url: 'https://www.dash.org/binaries/dashcore-0.12.1.5-linux64.tar.gz',
|
||||
dir: 'dashcore-0.12.1/bin'
|
||||
url: 'https://github.com/dashpay/dash/releases/download/v0.12.2.1/dashcore-0.12.2.1-linux64.tar.gz',
|
||||
dir: 'dashcore-0.12.2/bin'
|
||||
},
|
||||
LTC: {
|
||||
url: 'https://download.litecoin.org/litecoin-0.14.2/linux/litecoin-0.14.2-x86_64-linux-gnu.tar.gz',
|
||||
dir: 'litecoin-0.14.2/bin'
|
||||
},
|
||||
BCH: {
|
||||
url: 'https://download.bitcoinabc.org/0.16.1/linux/bitcoin-abc-0.16.1-x86_64-linux-gnu.tar.gz',
|
||||
dir: 'bitcoin-abc-0.16.1/bin',
|
||||
files: [['bitcoind', 'bitcoincashd'], ['bitcoin-cli', 'bitcoincash-cli']]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -90,7 +98,15 @@ function fetchAndInstall (coinRec) {
|
|||
|
||||
es(`wget -q ${url}`)
|
||||
es(`tar -xzf ${downloadFile}`)
|
||||
es(`sudo cp ${binDir}/* /usr/local/bin`)
|
||||
|
||||
if (_.isEmpty(binaries.files)) {
|
||||
es(`sudo cp ${binDir}/* /usr/local/bin`)
|
||||
return
|
||||
}
|
||||
|
||||
_.forEach(([source, target]) => {
|
||||
es(`sudo cp ${binDir}/${source} /usr/local/bin/${target}`)
|
||||
}, binaries.files)
|
||||
}
|
||||
|
||||
function writeFile (path, content) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue