-
Notifications
You must be signed in to change notification settings - Fork 10
/
smoke-test.js
37 lines (33 loc) · 744 Bytes
/
smoke-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* Cashier-BTC
* -----------
* Self-hosted bitcoin payment gateway
*
* https://github.com/Overtorment/Cashier-BTC
*
**/
/**
* simple smoke tests check accessibility of
* database and RPC
*
*/
let bitcoind = require('./models/blockchain')
let rp = require('request-promise')
let config = require('./config')
let assert = require('assert')
;(async () => {
try {
let info = await bitcoind.getblockchaininfo()
assert(info.result.chain)
} catch (err) {
console.log('Bitcoin Core RPC problem: ', err)
process.exit(1)
}
try {
let couchdb = await rp.get({url: config.couchdb, json: true})
assert(couchdb.db_name)
} catch (err) {
console.log('couchdb problem: ', err)
process.exit(1)
}
})()