Browse Source
Merge branch 'develop' into feat_mydojo_upgrade_tor
use-env-var-docker
kenshin samourai
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with
33 additions and
18 deletions
-
accounts/index.js
-
docker/my-dojo/.env
-
docker/my-dojo/explorer/Dockerfile
-
docker/my-dojo/explorer/restart.sh
-
docker/my-dojo/node/keys.index.js
-
keys/index-example.js
-
lib/http-server/http-server.js
-
package-lock.json
-
package.json
-
pushtx/index-orchestrator.js
-
pushtx/index.js
-
tracker/blockchain-processor.js
-
tracker/index.js
-
tracker/tracker.js
|
|
@ -52,8 +52,9 @@ |
|
|
|
hdaHelper.activateExternalDerivation() |
|
|
|
|
|
|
|
// Initialize the http server
|
|
|
|
const host = keys.apiBind |
|
|
|
const port = keys.ports.account |
|
|
|
const httpServer = new HttpServer(port) |
|
|
|
const httpServer = new HttpServer(port, host) |
|
|
|
|
|
|
|
// Initialize the rest api endpoints
|
|
|
|
const authRestApi = new AuthRestApi(httpServer) |
|
|
|
|
|
@ -13,10 +13,10 @@ COMPOSE_CONVERT_WINDOWS_PATHS=1 |
|
|
|
DOJO_VERSION_TAG=1.6.0 |
|
|
|
DOJO_DB_VERSION_TAG=1.1.1 |
|
|
|
DOJO_BITCOIND_VERSION_TAG=1.5.0 |
|
|
|
DOJO_NODEJS_VERSION_TAG=1.5.0 |
|
|
|
DOJO_NODEJS_VERSION_TAG=1.6.0 |
|
|
|
DOJO_NGINX_VERSION_TAG=1.4.0 |
|
|
|
DOJO_TOR_VERSION_TAG=1.4.0 |
|
|
|
DOJO_EXPLORER_VERSION_TAG=1.2.0 |
|
|
|
DOJO_EXPLORER_VERSION_TAG=1.3.0 |
|
|
|
DOJO_INDEXER_VERSION_TAG=1.0.0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -4,7 +4,7 @@ ENV LOGS_DIR /data/logs |
|
|
|
ENV APP_DIR /home/node/app |
|
|
|
|
|
|
|
ENV EXPLORER_URL https://github.com/janoside/btc-rpc-explorer/archive |
|
|
|
ENV EXPLORER_VERSION 1.1.9 |
|
|
|
ENV EXPLORER_VERSION 2.0.0 |
|
|
|
|
|
|
|
|
|
|
|
# Install netcat |
|
|
|
|
|
@ -13,6 +13,7 @@ explorer_options=( |
|
|
|
--bitcoind-pass "$BITCOIND_RPC_PASSWORD" |
|
|
|
--no-rates |
|
|
|
--privacy-mode |
|
|
|
--slow-device-mode |
|
|
|
) |
|
|
|
|
|
|
|
# Blacklist all functions provided by the RPC API |
|
|
|
|
|
@ -64,6 +64,10 @@ module.exports = { |
|
|
|
connectionLimitPushTxApi: 5, |
|
|
|
connectionLimitPushTxOrchestrator: 5 |
|
|
|
}, |
|
|
|
/* |
|
|
|
* IP address used to expose the API ports |
|
|
|
*/ |
|
|
|
apiBind: '0.0.0.0', |
|
|
|
/* |
|
|
|
* TCP Ports |
|
|
|
*/ |
|
|
|
|
|
@ -15,7 +15,7 @@ module.exports = { |
|
|
|
/* |
|
|
|
* Dojo version |
|
|
|
*/ |
|
|
|
dojoVersion: '1.5.0', |
|
|
|
dojoVersion: '1.6.0', |
|
|
|
/* |
|
|
|
* Bitcoind |
|
|
|
*/ |
|
|
@ -61,6 +61,10 @@ module.exports = { |
|
|
|
connectionLimitPushTxApi: 5, |
|
|
|
connectionLimitPushTxOrchestrator: 5 |
|
|
|
}, |
|
|
|
/* |
|
|
|
* IP address used to expose the API ports |
|
|
|
*/ |
|
|
|
apiBind: '127.0.0.1', |
|
|
|
/* |
|
|
|
* TCP Ports |
|
|
|
*/ |
|
|
@ -216,7 +220,7 @@ module.exports = { |
|
|
|
* Testnet parameters |
|
|
|
*/ |
|
|
|
testnet: { |
|
|
|
dojoVersion: '1.5.0', |
|
|
|
dojoVersion: '1.6.0', |
|
|
|
bitcoind: { |
|
|
|
rpc: { |
|
|
|
user: 'user', |
|
|
@ -240,6 +244,7 @@ module.exports = { |
|
|
|
connectionLimitPushTxApi: 1, |
|
|
|
connectionLimitPushTxOrchestrator: 5 |
|
|
|
}, |
|
|
|
apiBind: '127.0.0.1', |
|
|
|
ports: { |
|
|
|
account: 18080, |
|
|
|
pushtx: 18081, |
|
|
|
|
|
@ -18,9 +18,11 @@ class HttpServer { |
|
|
|
/** |
|
|
|
* Constructor |
|
|
|
* @param {int} port - port used by the http server |
|
|
|
* @param {string} host - host exposing the http server |
|
|
|
*/ |
|
|
|
constructor(port) { |
|
|
|
// Initialize server port
|
|
|
|
constructor(port, host) { |
|
|
|
// Initialize server host and port
|
|
|
|
this.host = host ? host : '127.0.0.1' |
|
|
|
this.port = port |
|
|
|
|
|
|
|
// Listening server instance
|
|
|
@ -54,8 +56,8 @@ class HttpServer { |
|
|
|
}) |
|
|
|
|
|
|
|
// Start a http server
|
|
|
|
this.server = this.app.listen(this.port, () => { |
|
|
|
Logger.info('HTTP server listening on port ' + this.port) |
|
|
|
this.server = this.app.listen(this.port, this.host, () => { |
|
|
|
Logger.info(`HTTP server listening on ${this.host}:${this.port}`) |
|
|
|
}) |
|
|
|
|
|
|
|
this.server.timeout = 600 * 1000 |
|
|
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
{ |
|
|
|
"name": "samourai-dojo", |
|
|
|
"version": "1.5.0", |
|
|
|
"version": "1.6.0", |
|
|
|
"lockfileVersion": 1, |
|
|
|
"requires": true, |
|
|
|
"dependencies": { |
|
|
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
{ |
|
|
|
"name": "samourai-dojo", |
|
|
|
"version": "1.5.0", |
|
|
|
"version": "1.6.0", |
|
|
|
"description": "Backend server for Samourai Wallet", |
|
|
|
"main": "accounts/index.js", |
|
|
|
"scripts": { |
|
|
|
|
|
@ -39,7 +39,7 @@ |
|
|
|
|
|
|
|
// Initialize notification sockets of singleton pushTxProcessor
|
|
|
|
pushTxProcessor.initNotifications({ |
|
|
|
uriSocket: `tcp://*:${keys.ports.orchestrator}` |
|
|
|
uriSocket: `tcp://127.0.0.1:${keys.ports.orchestrator}` |
|
|
|
}) |
|
|
|
|
|
|
|
// Initialize and start the orchestrator
|
|
|
|
|
|
@ -40,12 +40,13 @@ |
|
|
|
|
|
|
|
// Initialize notification sockets of singleton pushTxProcessor
|
|
|
|
pushTxProcessor.initNotifications({ |
|
|
|
uriSocket: `tcp://*:${keys.ports.notifpushtx}` |
|
|
|
uriSocket: `tcp://127.0.0.1:${keys.ports.notifpushtx}` |
|
|
|
}) |
|
|
|
|
|
|
|
// Initialize the http server
|
|
|
|
const host = keys.apiBind |
|
|
|
const port = keys.ports.pushtx |
|
|
|
const httpServer = new HttpServer(port) |
|
|
|
const httpServer = new HttpServer(port, host) |
|
|
|
|
|
|
|
// Initialize the PushTx rest api
|
|
|
|
const pushtxRestApi = new PushTxRestApi(httpServer) |
|
|
|
|
|
@ -60,7 +60,7 @@ class BlockchainProcessor extends AbstractProcessor { |
|
|
|
const daemonNbHeaders = info.headers |
|
|
|
|
|
|
|
// Consider that we are in IBD mode if Dojo is far in the past (> 13,000 blocks)
|
|
|
|
this.isIBD = highest.blockHeight < daemonNbHeaders - 13000 |
|
|
|
this.isIBD = (highest.blockHeight < 612000) || (highest.blockHeight < daemonNbHeaders - 13000) |
|
|
|
|
|
|
|
if (this.isIBD) |
|
|
|
return this.catchupIBDMode() |
|
|
|
|
|
@ -39,8 +39,9 @@ |
|
|
|
const tracker = new Tracker() |
|
|
|
|
|
|
|
// Initialize the http server
|
|
|
|
const host = keys.apiBind |
|
|
|
const port = keys.ports.trackerApi |
|
|
|
const httpServer = new HttpServer(port) |
|
|
|
const httpServer = new HttpServer(port, host) |
|
|
|
|
|
|
|
// Initialize the rest api endpoints
|
|
|
|
const trackerRestApi = new TrackerRestApi(httpServer, tracker) |
|
|
|
|
|
@ -22,7 +22,7 @@ class Tracker { |
|
|
|
constructor() { |
|
|
|
// Notification socket for client events
|
|
|
|
this.notifSock = zmq.socket('pub') |
|
|
|
this.notifSock.bindSync(`tcp://*:${keys.ports.tracker}`) |
|
|
|
this.notifSock.bindSync(`tcp://127.0.0.1:${keys.ports.tracker}`) |
|
|
|
|
|
|
|
// Initialize the blockchain processor
|
|
|
|
// and the mempool buffer
|
|
|
|