Ivan Socolsky
10 years ago
10 changed files with 93 additions and 43 deletions
@ -0,0 +1,26 @@ |
|||||
|
var config = { |
||||
|
basePath: '/bws/api', |
||||
|
disableLogs: false, |
||||
|
BlockchainMonitor: { |
||||
|
livenet: { |
||||
|
name: 'insight', |
||||
|
url: 'https://insight.bitpay.com:443', |
||||
|
}, |
||||
|
testnet: { |
||||
|
name: 'insight', |
||||
|
url: 'https://test-insight.bitpay.com:443', |
||||
|
}, |
||||
|
}, |
||||
|
WalletService: { |
||||
|
storageOpts: { |
||||
|
dbPath: './db', |
||||
|
/* To use multilevel, uncomment this: |
||||
|
multiLevel: { |
||||
|
host: 'localhost', |
||||
|
port: 3002, |
||||
|
}, |
||||
|
*/ |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
module.exports = config; |
@ -0,0 +1,14 @@ |
|||||
|
var multilevel = require('multilevel'); |
||||
|
var net = require('net'); |
||||
|
var level = require('levelup'); |
||||
|
|
||||
|
var db = level('./db', { |
||||
|
valueEncoding: 'json' |
||||
|
}); |
||||
|
var PORT = 3002; |
||||
|
|
||||
|
|
||||
|
console.log('Server started at port ' + PORT + '...'); |
||||
|
net.createServer(function(con) { |
||||
|
con.pipe(multilevel.server(db)).pipe(con); |
||||
|
}).listen(PORT); |
Loading…
Reference in new issue