From c78cbbb952ff1b04e4a5159f331cbb0b6460df60 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Mon, 22 Jun 2020 16:30:35 +0200 Subject: [PATCH 01/20] prepare next iteration --- docker/my-dojo/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/my-dojo/.env b/docker/my-dojo/.env index 53794e8..3d7ebdd 100644 --- a/docker/my-dojo/.env +++ b/docker/my-dojo/.env @@ -10,7 +10,7 @@ COMPOSE_CONVERT_WINDOWS_PATHS=1 -DOJO_VERSION_TAG=1.6.0 +DOJO_VERSION_TAG=1.7.0 DOJO_DB_VERSION_TAG=1.2.0 DOJO_BITCOIND_VERSION_TAG=1.6.0 DOJO_NODEJS_VERSION_TAG=1.6.0 From 5b0211c1223a56eb98a76d447f82182a94f180ff Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Tue, 23 Jun 2020 15:30:10 +0200 Subject: [PATCH 02/20] bump version of node container and app --- docker/my-dojo/.env | 2 +- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/my-dojo/.env b/docker/my-dojo/.env index 3d7ebdd..bc8dc30 100644 --- a/docker/my-dojo/.env +++ b/docker/my-dojo/.env @@ -13,7 +13,7 @@ COMPOSE_CONVERT_WINDOWS_PATHS=1 DOJO_VERSION_TAG=1.7.0 DOJO_DB_VERSION_TAG=1.2.0 DOJO_BITCOIND_VERSION_TAG=1.6.0 -DOJO_NODEJS_VERSION_TAG=1.6.0 +DOJO_NODEJS_VERSION_TAG=1.7.0 DOJO_NGINX_VERSION_TAG=1.5.0 DOJO_TOR_VERSION_TAG=1.4.0 DOJO_EXPLORER_VERSION_TAG=1.3.0 diff --git a/package-lock.json b/package-lock.json index c22196a..2a84bca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "samourai-dojo", - "version": "1.6.0", + "version": "1.7.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 94a30c1..51038e9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "samourai-dojo", - "version": "1.6.0", + "version": "1.7.0", "description": "Backend server for Samourai Wallet", "main": "accounts/index.js", "scripts": { From 76271c8fcb1d988843756666d29151bfe9617e71 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Tue, 23 Jun 2020 15:31:01 +0200 Subject: [PATCH 03/20] add support of strict_mode_vouts to pushtx endpoint --- lib/errors.js | 3 ++- pushtx/pushtx-processor.js | 47 ++++++++++++++++++++++++++++++++++++++ pushtx/pushtx-rest-api.js | 30 ++++++++++++++++++++---- 3 files changed, 75 insertions(+), 5 deletions(-) diff --git a/lib/errors.js b/lib/errors.js index 10b4a92..b8bef58 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -75,6 +75,7 @@ module.exports = { pushtx: { NLOCK_MISMATCH: 'nLockTime in script does not match nLockTime in transaction', SCHEDULED_TOO_FAR: 'nLockTime is set to far in the future', - SCHEDULED_BAD_ORDER: 'Order of hop and nLockTime values must be consistent' + SCHEDULED_BAD_ORDER: 'Order of hop and nLockTime values must be consistent', + VIOLATION_STRICT_MODE_VOUTS: 'VIOLATION_STRICT_MODE_VOUTS' } } diff --git a/pushtx/pushtx-processor.js b/pushtx/pushtx-processor.js index cfe0ecb..dc78968 100644 --- a/pushtx/pushtx-processor.js +++ b/pushtx/pushtx-processor.js @@ -8,11 +8,20 @@ const bitcoin = require('bitcoinjs-lib') const zmq = require('zeromq') const Logger = require('../lib/logger') const errors = require('../lib/errors') +const db = require('../lib/db/mysql-db-wrapper') const RpcClient = require('../lib/bitcoind-rpc/rpc-client') const network = require('../lib/bitcoin/network') +const activeNet = network.network const keys = require('../keys')[network.key] const status = require('./status') +let Sources +if (network.key == 'bitcoin') { + Sources = require('../lib/remote-importer/sources-mainnet') +} else { + Sources = require('../lib/remote-importer/sources-testnet') +} + /** * A singleton providing a wrapper @@ -25,6 +34,7 @@ class PushTxProcessor { */ constructor() { this.notifSock = null + this.sources = new Sources() // Initialize the rpc client this.rpcClient = new RpcClient() } @@ -38,6 +48,43 @@ class PushTxProcessor { this.notifSock.bindSync(config.uriSocket) } + /** + * Enforce a strict verification mode on a list of outputs + * @param {string} rawtx - raw bitcoin transaction in hex format + * @param {array} vouts - output indices (integer) + * @returns {array} returns the indices of the faulty outputs + */ + async enforceStrictModeVouts(rawtx, vouts) { + const faultyOutputs = [] + const addrMap = {} + let tx + try { + tx = bitcoin.Transaction.fromHex(rawtx) + } catch(e) { + throw errors.tx.PARSE + } + // Check in db if addresses are known and have been used + for (let vout of vouts) { + if (vout >= tx.outs.length) + throw errors.txout.VOUT + const output = tx.outs[vout] + const address = bitcoin.address.fromOutputScript(output.script, activeNet) + const nbTxs = await db.getAddressNbTransactions(address) + if (nbTxs == null || nbTxs > 0) + faultyOutputs.push(vout) + else + addrMap[address] = vout + } + // Checks with indexer if addresses are known and have been used + if (keys.indexer.active != 'local_bitcoind') { + const results = await this.sources.getAddresses(Object.keys(addrMap)) + for (let r of results) + if (r.ntx > 0) + faultyOutputs.push(addrMap[r.address]) + } + return faultyOutputs + } + /** * Push transactions to the Bitcoin network * @param {string} rawtx - raw bitcoin transaction in hex format diff --git a/pushtx/pushtx-rest-api.js b/pushtx/pushtx-rest-api.js index 7c9dcbd..dd7aa87 100644 --- a/pushtx/pushtx-rest-api.js +++ b/pushtx/pushtx-rest-api.js @@ -152,6 +152,31 @@ class PushTxRestApi { if (!validator.isHexadecimal(query.tx)) return this._traceError(res, errors.body.INVDATA) + if (query.strict_mode_vouts) { + const outs = query.strict_mode_vouts.split('|') + if (outs.length > 0) { + let faults + for (let item of outs) { + if (!validator.isInt(item)) + return this._traceError(res, errors.body.INVDATA) + } + try { + const indices = outs.map(v => parseInt(v, 10)) + faults = await pushTxProcessor.enforceStrictModeVouts(query.tx, indices) + } catch(e) { + this._traceError(res, e) + } + if (faults.length > 0) { + return this._traceError(res, { + 'message': JSON.stringify({ + 'message': faults, + 'code': errors.pushtx.VIOLATION_STRICT_MODE_VOUTS + }) + }) + } + } + } + try { const txid = await pushTxProcessor.pushTx(query.tx) HttpServer.sendOkData(res, txid) @@ -198,10 +223,7 @@ class PushTxRestApi { if (msg.code && msg.message) { Logger.error(null, 'PushTx : Error ' + msg.code + ': ' + msg.message) - ret = { - message: msg.message, - code: msg.code - } + ret = msg } else { Logger.error(err.message, 'PushTx : ') ret = err.message From e860114e588cabd8eb2a73dfb0054829bc033d4f Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Tue, 23 Jun 2020 15:31:15 +0200 Subject: [PATCH 04/20] update pushtx doc --- doc/POST_pushtx.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/POST_pushtx.md b/doc/POST_pushtx.md index 029fe37..e0ed61e 100644 --- a/doc/POST_pushtx.md +++ b/doc/POST_pushtx.md @@ -10,6 +10,7 @@ Parameters must be passed in the body of the request as url encoded arguments. ## Parameters * **tx** - `hex string` - The raw transaction hex * **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated. Alternatively, the access token can be passed through the `Authorization` HTTP header (with the `Bearer` scheme). +* **strict_mode_vouts** (optional) - `string` - A pipe-separated list of outpoints indices. A strict verification is enforced on these outpoints before the transaction is pushed. Strict mode checks that addresses associated to these outputs aren't reused. If verifications fail, push is aborted and an error is returned. ### Example @@ -18,6 +19,7 @@ Parameters must be passed in the body of the request as url encoded arguments. POST /pushtx/ tx=abcdef0123456789 +strict_mode_vouts=0|2|3 ``` #### Success @@ -32,11 +34,18 @@ Status code 200 with JSON response: #### Failure Status code 400 with JSON response: ```json +{ + "status": "error", + "error": "" +} +``` +or +```json { "status": "error", "error": { - "message": "", - "code": "" + "message": [vouts], + "code": "VIOLATION_STRICT_MODE_VOUTS" } } ``` From 70547a42923af5ae44f48ebf1ba9d25966eaa349 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Wed, 24 Jun 2020 14:42:37 +0200 Subject: [PATCH 05/20] rework some code used for strict_mode_vouts --- pushtx/pushtx-processor.js | 12 +++++++----- pushtx/pushtx-rest-api.js | 34 +++++++++++++++------------------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/pushtx/pushtx-processor.js b/pushtx/pushtx-processor.js index dc78968..0ba6d4c 100644 --- a/pushtx/pushtx-processor.js +++ b/pushtx/pushtx-processor.js @@ -76,11 +76,13 @@ class PushTxProcessor { addrMap[address] = vout } // Checks with indexer if addresses are known and have been used - if (keys.indexer.active != 'local_bitcoind') { - const results = await this.sources.getAddresses(Object.keys(addrMap)) - for (let r of results) - if (r.ntx > 0) - faultyOutputs.push(addrMap[r.address]) + if (Object.keys(addrMap).length > 0) { + if (keys.indexer.active != 'local_bitcoind') { + const results = await this.sources.getAddresses(Object.keys(addrMap)) + for (let r of results) + if (r.ntx > 0) + faultyOutputs.push(addrMap[r.address]) + } } return faultyOutputs } diff --git a/pushtx/pushtx-rest-api.js b/pushtx/pushtx-rest-api.js index dd7aa87..c17923a 100644 --- a/pushtx/pushtx-rest-api.js +++ b/pushtx/pushtx-rest-api.js @@ -153,27 +153,23 @@ class PushTxRestApi { return this._traceError(res, errors.body.INVDATA) if (query.strict_mode_vouts) { - const outs = query.strict_mode_vouts.split('|') - if (outs.length > 0) { - let faults - for (let item of outs) { - if (!validator.isInt(item)) - return this._traceError(res, errors.body.INVDATA) - } - try { - const indices = outs.map(v => parseInt(v, 10)) - faults = await pushTxProcessor.enforceStrictModeVouts(query.tx, indices) - } catch(e) { - this._traceError(res, e) - } - if (faults.length > 0) { - return this._traceError(res, { - 'message': JSON.stringify({ - 'message': faults, - 'code': errors.pushtx.VIOLATION_STRICT_MODE_VOUTS + try { + const vouts = query.strict_mode_vouts.split('|').map(v => parseInt(v, 10)) + if (vouts.some(isNaN)) + throw errors.txout.VOUT + if (vouts.length > 0) { + let faults = await pushTxProcessor.enforceStrictModeVouts(query.tx, vouts) + if (faults.length > 0) { + return this._traceError(res, { + 'message': JSON.stringify({ + 'message': faults, + 'code': errors.pushtx.VIOLATION_STRICT_MODE_VOUTS + }) }) - }) + } } + } catch(e) { + return this._traceError(res, e) } } From 98263ae64a38f2686783b404e00463d03523ed70 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Wed, 24 Jun 2020 14:43:24 +0200 Subject: [PATCH 06/20] add support of strict_mode_vouts to /pushtx/schedule --- pushtx/transactions-scheduler.js | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/pushtx/transactions-scheduler.js b/pushtx/transactions-scheduler.js index 68425c2..25edc68 100644 --- a/pushtx/transactions-scheduler.js +++ b/pushtx/transactions-scheduler.js @@ -57,6 +57,7 @@ class TransactionsScheduler { // Iterate over the transactions for a few validations let lastHopProcessed = -1 let lastLockTimeProcessed = -1 + const faults = [] for (let entry of script) { // Compute delta height (entry.nlocktime - nltTx0) @@ -77,6 +78,30 @@ class TransactionsScheduler { if (entry.nlocktime < lastLockTimeProcessed) throw errors.pushtx.SCHEDULED_BAD_ORDER } + // Enforce strcit_mode_vouts if required + const vouts = entry.strict_mode_vouts + if (vouts) { + try { + if (vouts.some(isNaN)) + throw errors.txout.VOUT + if (vouts.length > 0) { + let faultsTx = await pushTxProcessor.enforceStrictModeVouts(entry.tx, vouts) + if (faultsTx.length > 0) { + const txid = bitcoin.Transaction.fromHex(entry.tx).getId() + for (let vout of faultsTx) { + faults.push({ + "txid": txid, + "hop": entry.hop, + "vouts": vout + }) + } + } + } + } catch(e) { + throw e + } + } + // Prepare verification of next hop lastHopProcessed = entry.hop lastLockTimeProcessed = entry.nlocktime // Update scheduled height if needed @@ -84,6 +109,16 @@ class TransactionsScheduler { entry.nlocktime = baseHeight + entry.delta } + // Return if strict_mode_vout has detected errors + if (faults.length > 0) { + throw { + 'message': JSON.stringify({ + 'message': faults, + 'code': errors.pushtx.VIOLATION_STRICT_MODE_VOUTS + }) + } + } + let parentTxid = null let parentNlocktime = baseHeight From 6d8612fa009d06bfea07e2263b8b3abb16e6e674 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Wed, 24 Jun 2020 16:22:24 +0200 Subject: [PATCH 07/20] Add setup of explorer in keys.index.js --- accounts/support-rest-api.js | 15 +++------------ docker/my-dojo/node/keys.index.js | 28 ++++++++++++++++++++++++++++ keys/index-example.js | 17 +++++++++++++++++ 3 files changed, 48 insertions(+), 12 deletions(-) diff --git a/accounts/support-rest-api.js b/accounts/support-rest-api.js index 8b18b5d..34cf985 100644 --- a/accounts/support-rest-api.js +++ b/accounts/support-rest-api.js @@ -312,20 +312,11 @@ class SupportRestApi { */ async getPairingExplorer(req, res) { try { - let url = '' - if (process.env.EXPLORER_INSTALL == 'on') { - try { - url = fs.readFileSync('/var/lib/tor/hsv3explorer/hostname', 'utf8') - url = url.replace('\n', '') - } catch(e) { - Logger.error(e, 'API : SupportRestApi.getPairing() : Cannot read explorer onion address') - } - } const ret = { 'pairing': { - 'type': 'explorer.btcRpcExplorer', - 'url': url, - 'key': process.env.EXPLORER_KEY + 'type': `explorer.${keys.explorer.active}`, + 'url': keys.explorer.uri, + 'key': keys.explorer.password } } HttpServer.sendRawData(res, JSON.stringify(ret, null, 2)) diff --git a/docker/my-dojo/node/keys.index.js b/docker/my-dojo/node/keys.index.js index 3c2ca42..e37a1f3 100644 --- a/docker/my-dojo/node/keys.index.js +++ b/docker/my-dojo/node/keys.index.js @@ -2,11 +2,27 @@ * keys/index-example.js * Copyright (c) 2016-2018, Samourai Wallet (CC BY-NC-ND 4.0 License). */ +const fs = require('fs') + +// Retrieve active bitcoin network from conf files const bitcoinNetwork = (process.env.COMMON_BTC_NETWORK == 'testnet') ? 'testnet' : 'bitcoin' +// Retrieve explorer config from conf files +let explorerActive = 'oxt' +let explorerUrl = 'https://oxt.me' +let explorerPassword = '' +if (process.env.EXPLORER_INSTALL == 'on') { + try { + explorerUrl = fs.readFileSync('/var/lib/tor/hsv3explorer/hostname', 'utf8').replace('\n', '') + explorerPassword = process.env.EXPLORER_KEY + explorerActive = 'btc_rpc_explorer' + } catch(e) {} +} + + /** * Desired structure of /keys/index.js, which is ignored in the repository. */ @@ -180,6 +196,18 @@ module.exports = { // Esplora (testnet) esplora: process.env.NODE_URL_ESPLORA_API, }, + /* + * Explorer recommended by this Dojo + */ + explorer: { + // Active explorer + // Values: oxt | btc_rpc_explorer + active: explorerActive, + // URI of the explorer + uri: explorerUrl, + // Password (value required for btc_rpc_explorer) + password: explorerPassword + }, /* * Max number of transactions per address * accepted during fast scan diff --git a/keys/index-example.js b/keys/index-example.js index cd72820..b001627 100644 --- a/keys/index-example.js +++ b/keys/index-example.js @@ -174,6 +174,18 @@ module.exports = { // OXT oxt: 'https://api.oxt.me' }, + /* + * Explorer recommended by this Dojo + */ + explorer: { + // Active explorer + // Values: oxt | btc_rpc_explorer + active: 'oxt', + // URI of the explorer + uri: 'https://oxt.me', + // Password (value required for btc_rpc_explorer) + password: '' + }, /* * Max number of transactions per address * accepted during fast scan @@ -295,6 +307,11 @@ module.exports = { socks5Proxy: null, esplora: 'https://blockstream.info/testnet' }, + explorer: { + active: 'none', + uri: '', + password: '' + }, addrFilterThreshold: 1000, addrDerivationPool: { minNbChildren: 1, From 95f7863b837ce8fbec06a602b23316f9a3f050f5 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Wed, 24 Jun 2020 19:19:30 +0200 Subject: [PATCH 08/20] update doc and package.json with url of new repository --- README.md | 2 +- doc/DOCKER_advanced_setups.md | 6 +++--- doc/DOCKER_mac_setup.MD | 10 +++++----- doc/DOCKER_setup.md | 6 +++--- doc/DOCKER_synology_setup.md | 8 ++++---- doc/GET_multiaddr.md | 2 +- doc/GET_unspent.md | 2 +- package.json | 4 ++-- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 786e3f3..2a36035 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ It provides in a single command the setup of a full Samourai backend composed of * the backend modules with an API accessible as a static Tor hidden service, * a maintenance tool accessible through a Tor web browser, * a block explorer ([BTC RPC Explorer](https://github.com/janoside/btc-rpc-explorer)) accessible through a Tor web browser, -* an optional indexer of Bitcoin addresses ([addrindexrs](https://github.com/Samourai-Wallet/addrindexrs)) providing fast and private rescans of HD accounts and loose addresses. +* an optional indexer of Bitcoin addresses ([addrindexrs](hhttps://code.samourai.io/dojo/addrindexrs)) providing fast and private rescans of HD accounts and loose addresses. See [the documentation](./doc/DOCKER_setup.md) for detailed setup instructions. diff --git a/doc/DOCKER_advanced_setups.md b/doc/DOCKER_advanced_setups.md index 4f13e39..2369eb9 100644 --- a/doc/DOCKER_advanced_setups.md +++ b/doc/DOCKER_advanced_setups.md @@ -21,7 +21,7 @@ A word of caution, though, the default values of these options try to maximize y ## Local indexer of Bitcoin addresses ## -By default, Dojo uses the local full node as its data source for imports and rescans of HD accounts and addresses. While private, this default option has many limitations. MyDojo allows to install a local indexer ([addrindexrs](https://github.com/Samourai-Wallet/addrindexrs)) providing the best of both worlds (no request sent to a third party, fast and real time rescans, complete transactional history is retrieved). +By default, Dojo uses the local full node as its data source for imports and rescans of HD accounts and addresses. While private, this default option has many limitations. MyDojo allows to install a local indexer ([addrindexrs](https://code.samourai.io/dojo/addrindexrs)) providing the best of both worlds (no request sent to a third party, fast and real time rescans, complete transactional history is retrieved). ### Requirements ### @@ -122,7 +122,7 @@ nano ./conf/docker-node.conf ## Local Whirlpool client ## -This setup allows to install and run a [Whirlpool client](https://github.com/Samourai-Wallet/whirlpool-client-cli) inside MyDojo. +This setup allows to install and run a [Whirlpool client](https://code.samourai.io/whirlpool/whirlpool-client-cli) inside MyDojo. The client can be configured and controlled through a REST API exposed as a Tor hidden service. @@ -144,7 +144,7 @@ nano ./conf/docker-whirlpool.conf ### Installation of Whirlpool GUI ### -The [Whirlpool GUI application]((https://github.com/Samourai-Wallet/whirlpool-gui)) provides a graphical interface for your Whirlpool client. +The [Whirlpool GUI application]((https://code.samourai.io/whirlpool/whirlpool-gui)) provides a graphical interface for your Whirlpool client. These steps describe how to install the Whirlpool GUI application how a computer and how to connect it to your Whirlpool client. diff --git a/doc/DOCKER_mac_setup.MD b/doc/DOCKER_mac_setup.MD index 47b3279..300c9eb 100644 --- a/doc/DOCKER_mac_setup.MD +++ b/doc/DOCKER_mac_setup.MD @@ -22,7 +22,7 @@ Follow the instructions in this [video](https://www.youtube.com/watch?v=6M1DivpQ Also, remember to install the virtual box at a directory where you have __enough free space__ to install the Dojo. Specially if you are running a full node. -After the setup is complete, start the virtual box and open a terminal window then proceed to install the Dojo following these [instructions](https://github.com/Samourai-Wallet/samourai-dojo/blob/develop/doc/DOCKER_setup.md#install). +After the setup is complete, start the virtual box and open a terminal window then proceed to install the Dojo following these [instructions](https://code.samourai.io/dojo/samourai-dojo/-/blob/master/doc/DOCKER_setup.md#install). @@ -73,7 +73,7 @@ Note: _This is an important step, otherwise, it's probable that when you run the (_At 4 CPUs, 8GB of RAM and a 4GiB Swap - the initial block download took 4.5 days at the time of writing_). ### Install the DOJO -Follow the instructions [here](https://github.com/Samourai-Wallet/samourai-dojo/blob/develop/doc/DOCKER_setup.md) starting at the step: +Follow the instructions [here](https://code.samourai.io/dojo/samourai-dojo/-/blob/master/doc/DOCKER_setup.md) starting at the step: __"Download the most recent release of Dojo from Github"__ _Note: For tracking progress, open Kitematic and follow the bitcoind logs. You'll be able to see the Blockchain verification process under the _progress_ log variable (1.00 = fully validated). This process takes a long time. Just let it do its thing. In my system it took 3 days._ @@ -105,11 +105,11 @@ This installation was tested on an iMac (late 2014) with a 3.5GHz i5 processor w 4. Click __Advanced__ and increase the CPU count, Memory and Swap sizes. Adjusting these will speed up the blockchain validation process ### Install the DOJO Pointing and Existing bitcoind -Follow the instructions [here](https://github.com/Samourai-Wallet/samourai-dojo/blob/develop/doc/DOCKER_setup.md) starting at the step: +Follow the instructions [here](hhttps://code.samourai.io/dojo/samourai-dojo/-/blob/master/doc/DOCKER_setup.md) starting at the step: __"Download the most recent release of Dojo from Github"__ until you reach __"Launch the Installation of Your Dojo with"__ ***DO NOT LAUNCH DOJO YET*** -Once you Reach Step __"Launch the Installation of Your Dojo with"__ from above you will need to read and follow the instructions from [here](https://github.com/Samourai-Wallet/samourai-dojo/blob/develop/doc/DOCKER_advanced_setups.md) -Once adjustments are made to your external bitcoind bitcoin.conf __(location dependent on what device you have bitcoind)__ and docker-bitcoind.conf.tpl __(dojo_dir > docker > my-dojo > conf)__ you can proceed with Install and revert back to original instructions [here](https://github.com/Samourai-Wallet/samourai-dojo/blob/develop/doc/DOCKER_setup.md) at section __"Launch the Installation of Your Dojo with"__ +Once you Reach Step __"Launch the Installation of Your Dojo with"__ from above you will need to read and follow the instructions from [here](https://code.samourai.io/dojo/samourai-dojo/-/blob/master/doc/DOCKER_advanced_setups.md) +Once adjustments are made to your external bitcoind bitcoin.conf __(location dependent on what device you have bitcoind)__ and docker-bitcoind.conf.tpl __(dojo_dir > docker > my-dojo > conf)__ you can proceed with Install and revert back to original instructions [here](https://code.samourai.io/dojo/samourai-dojo/-/blob/master/doc/DOCKER_setup.md) at section __"Launch the Installation of Your Dojo with"__ _Note: For tracking progress, open terminal, change directory to my-dojo and run /dojo.sh logs nodejs __Some possible optimization tips:__ diff --git a/doc/DOCKER_setup.md b/doc/DOCKER_setup.md index b90a4a2..0d9f6ab 100644 --- a/doc/DOCKER_setup.md +++ b/doc/DOCKER_setup.md @@ -6,7 +6,7 @@ MyDojo is a set of Docker containers providing a full Samourai backend composed * backend modules with an API accessible as a static Tor hidden service, * a maintenance tool accessible through a Tor web browser, * a block explorer ([BTC RPC Explorer](https://github.com/janoside/btc-rpc-explorer)) accessible as a static Tor hidden service. -* an optional indexer of Bitcoin addresses ([addrindexrs](https://github.com/Samourai-Wallet/addrindexrs)) providing fast and private rescans of HD accounts and loose addresses. +* an optional indexer of Bitcoin addresses ([addrindexrs](https://code.samourai.io/dojo/addrindexrs)) providing fast and private rescans of HD accounts and loose addresses. ## Table of Content ## @@ -122,7 +122,7 @@ This procedure allows to install a new Dojo from scratch. * Install [Tor Browser](https://www.torproject.org/projects/torbrowser.html.en) on the host machine. -* Download the most recent release of Dojo from [Github](https://github.com/Samourai-Wallet/samourai-dojo/archive/master.zip) +* Download the most recent release of Dojo from [Gitlab](https://code.samourai.io/dojo/samourai-dojo/-/archive/master/samourai-dojo-master.zip) * Uncompress the archive on the host machine in a temporary directory of your choice (named `` in this doc) @@ -209,7 +209,7 @@ This procedure allows to upgrade your Dojo with a new version. ./dojo.sh stop ``` -* Download the most recent release of Dojo from [Github](https://github.com/Samourai-Wallet/samourai-dojo/releases) +* Download the most recent release of Dojo from [Gitlab](https://code.samourai.io/dojo/samourai-dojo/-/releases) * Uncompress the archive on the host machine in a temporary directory of your choice (named `` in this doc) diff --git a/doc/DOCKER_synology_setup.md b/doc/DOCKER_synology_setup.md index 7d18a94..9aef60e 100644 --- a/doc/DOCKER_synology_setup.md +++ b/doc/DOCKER_synology_setup.md @@ -76,13 +76,13 @@ cd ``` cp -r ./ ../dojo-backup ``` -- Download latest Dojo from [GitHub releases](https://github.com/Samourai-Wallet/samourai-dojo/releases) +- Download latest Dojo from [Gitlab releases](https://code.samourai.io/dojo/samourai-dojo/-/releases) ``` mkdir newDojo cd newDojo - wget https://github.com/Samourai-Wallet/samourai-dojo/archive/v1.5.0.tar.gz - tar xzvf v1.5.0.tar.gz - cp -r samourai-dojo-1.5.0/* ../ + wget https://code.samourai.io/dojo/samourai-dojo/-/archive/v1.7.0/samourai-dojo-v1.7.0.tar.gz + tar xzvf samourai-dojo-v1.7.0.tar.gz + cp -r samourai-dojo-v1.7.0/* ../ cd .. ``` - Upgrade diff --git a/doc/GET_multiaddr.md b/doc/GET_multiaddr.md index 08b9a96..49b1956 100644 --- a/doc/GET_multiaddr.md +++ b/doc/GET_multiaddr.md @@ -135,4 +135,4 @@ Status code 400 with JSON response: ``` ## Notes -Multiaddr response is consumed by the wallet in the [APIFactory](https://github.com/Samourai-Wallet/samourai-wallet-android/blob/master/app/src/main/java/com/samourai/wallet/api/APIFactory.java) +Multiaddr response is consumed by the wallet in the [APIFactory](https://code.samourai.io/wallet/samourai-wallet-android/-/blob/master/app/src/main/java/com/samourai/wallet/api/APIFactory.java) diff --git a/doc/GET_unspent.md b/doc/GET_unspent.md index 1e81758..b4fcd9f 100644 --- a/doc/GET_unspent.md +++ b/doc/GET_unspent.md @@ -79,4 +79,4 @@ Status code 400 with JSON response: ``` ## Notes -Unspent response is consumed by the wallet in the [APIFactory](https://github.com/Samourai-Wallet/samourai-wallet-android/blob/master/app/src/main/java/com/samourai/wallet/api/APIFactory.java) +Unspent response is consumed by the wallet in the [APIFactory](https://code.samourai.io/wallet/samourai-wallet-android/-/blob/master/app/src/main/java/com/samourai/wallet/api/APIFactory.java) diff --git a/package.json b/package.json index 94a30c1..0da9cec 100644 --- a/package.json +++ b/package.json @@ -8,11 +8,11 @@ }, "repository": { "type": "git", - "url": "git+ssh://git@github.com:Samourai-Wallet/samourai-dojo.git" + "url": "git+ssh://git@code.samourai.io:dojo/samourai-dojo.git" }, "author": "Katana Cryptographic Ltd.", "license": "AGPL-3.0-only", - "homepage": "https://github.com/Samourai-Wallet/samourai-dojo", + "homepage": "https://code.samourai.io/dojo/samourai-dojo", "dependencies": { "async-sema": "2.1.2", "bip39": "2.4.0", From d858b2dbdc945c58164deda1c6b030e9c03f28de Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Thu, 25 Jun 2020 12:34:11 +0200 Subject: [PATCH 09/20] fix url of ronin's repository --- doc/DOCKER_setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/DOCKER_setup.md b/doc/DOCKER_setup.md index 0d9f6ab..150d9aa 100644 --- a/doc/DOCKER_setup.md +++ b/doc/DOCKER_setup.md @@ -113,7 +113,7 @@ For MacOS, see this detailed [installation guide](./DOCKER_mac_setup.MD). For Synology, see this detailed [installation guide](./DOCKER_synology_setup.md). -For Raspberry Pi4 and Odroid N2, see the [Ronin Dojo Project](https://github.com/RoninDojo/RoninDojo) +For Raspberry Pi4 and Odroid N2, see the [Ronin Dojo Project](https://code.samourai.io/ronindojo/RoninDojo) This procedure allows to install a new Dojo from scratch. From d2029a54413517d32e104c568c6f3ec9f3ef19a6 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Thu, 25 Jun 2020 13:01:07 +0200 Subject: [PATCH 10/20] switch addrindexrs repo to gitlab --- docker/my-dojo/indexer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/my-dojo/indexer/Dockerfile b/docker/my-dojo/indexer/Dockerfile index 8fd258a..b838a13 100644 --- a/docker/my-dojo/indexer/Dockerfile +++ b/docker/my-dojo/indexer/Dockerfile @@ -2,7 +2,7 @@ FROM rust:1.42.0-slim-buster ENV INDEXER_HOME /home/indexer ENV INDEXER_VERSION 0.3.0 -ENV INDEXER_URL https://github.com/Samourai-Wallet/addrindexrs.git +ENV INDEXER_URL https://code.samourai.io/dojo/addrindexrs.git RUN apt-get update && \ apt-get install -y clang cmake git && \ From fc0be423e7be629d0c18b37ec15c0a5aff54eccc Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Wed, 1 Jul 2020 14:03:05 +0200 Subject: [PATCH 11/20] explicitely set algo used for jwt signatures --- lib/auth/authorizations-manager.js | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/lib/auth/authorizations-manager.js b/lib/auth/authorizations-manager.js index 82cbc41..fb830a9 100644 --- a/lib/auth/authorizations-manager.js +++ b/lib/auth/authorizations-manager.js @@ -23,6 +23,7 @@ class AuthorizationsManager { constructor() { try { // Constants + this.JWT_ALGO = 'HS256' this.ISS = 'Samourai Wallet backend' this.TOKEN_TYPE_ACCESS = 'access-token' this.TOKEN_TYPE_REFRESH = 'refresh-token' @@ -210,7 +211,10 @@ class AuthorizationsManager { return jwt.sign( claims, this._secret, - {expiresIn: this.accessTokenExpires} + { + expiresIn: this.accessTokenExpires, + algorithm: this.JWT_ALGO + } ) } @@ -239,7 +243,11 @@ class AuthorizationsManager { * @returns {Object} payload of the json web token */ _verifyAccessToken(token) { - const payload = jwt.verify(token, this._secret, {}) + const payload = jwt.verify( + token, + this._secret, + {algorithms: [this.JWT_ALGO]} + ) if (payload['type'] != this.TOKEN_TYPE_ACCESS) throw errors.auth.INVALID_JWT @@ -263,7 +271,10 @@ class AuthorizationsManager { return jwt.sign( claims, this._secret, - {expiresIn: this.refreshTokenExpires} + { + expiresIn: this.refreshTokenExpires, + algorithm: this.JWT_ALGO + } ) } @@ -292,7 +303,11 @@ class AuthorizationsManager { * @returns {Object} payload of the json web token */ _verifyRefreshToken(token) { - const payload = jwt.verify(token, this._secret, {}) + const payload = jwt.verify( + token, + this._secret, + {algorithms: [this.JWT_ALGO]} + ) if (payload['type'] != this.TOKEN_TYPE_REFRESH) throw errors.auth.INVALID_JWT From 53cf4aba018ccb97d5c74ea26a01ae2a4944536c Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Fri, 3 Jul 2020 13:26:55 +0200 Subject: [PATCH 12/20] update release notes --- RELEASES.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index ee9a9c8..1a7e89b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3,6 +3,7 @@ ## Releases ## +- [v1.7.0](#1_7_0) - [v1.6.0](#1_6_0) - [v1.5.0](#1_5_0) - [v1.4.1](#1_4_1) @@ -12,6 +13,31 @@ - [v1.1.0](#1_1_0) + + +## Samourai Dojo v1.7.0 ## + + +### Change log ### + + +### Notable changes ### + + + +#### MyDojo #### + +- [#mr142](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/142) add setup of explorer in keys.index.js +- [#mr143](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/143) update doc and package.json with url of new repository +- [#mr144](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/144) switch addrindexrs repo to gitlab +- [#mr145](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/145) explicitely set algo used for jwt signatures + + +#### Credits ### + +- kenshin-samourai + + ## Samourai Dojo v1.6.0 ## From e1e836bc43dd277e884f4e98a1d47686d9f6d708 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Fri, 3 Jul 2020 18:57:19 +0200 Subject: [PATCH 13/20] upgrade whirlpool to whirlpool-cli 0.10.7 --- docker/my-dojo/.env | 2 +- docker/my-dojo/whirlpool/Dockerfile | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/my-dojo/.env b/docker/my-dojo/.env index 3d7ebdd..e212025 100644 --- a/docker/my-dojo/.env +++ b/docker/my-dojo/.env @@ -18,7 +18,7 @@ DOJO_NGINX_VERSION_TAG=1.5.0 DOJO_TOR_VERSION_TAG=1.4.0 DOJO_EXPLORER_VERSION_TAG=1.3.0 DOJO_INDEXER_VERSION_TAG=1.1.0 -DOJO_WHIRLPOOL_VERSION_TAG=1.0.0 +DOJO_WHIRLPOOL_VERSION_TAG=1.1.0 ######################################### diff --git a/docker/my-dojo/whirlpool/Dockerfile b/docker/my-dojo/whirlpool/Dockerfile index 4808b6d..ab123b0 100644 --- a/docker/my-dojo/whirlpool/Dockerfile +++ b/docker/my-dojo/whirlpool/Dockerfile @@ -51,10 +51,10 @@ RUN set -ex && \ # Install whirlpool-cli ENV WHIRLPOOL_URL https://code.samourai.io/whirlpool/whirlpool-client-cli/uploads -ENV WHIRLPOOL_VERSION 0.10.6 -ENV WHIRLPOOL_VERSION_HASH a05b443bf9d266702327c99fd8bad5da +ENV WHIRLPOOL_VERSION 0.10.7 +ENV WHIRLPOOL_VERSION_HASH 8487fff43052fd9ad1ecd8b6856d9de9 ENV WHIRLPOOL_JAR "whirlpool-client-cli-$WHIRLPOOL_VERSION-run.jar" -ENV WHIRLPOOL_SHA256 eb07ef5637c2bb52b1be57b62941120a689b0c02600c38dbda3b8dd701d03cc8 +ENV WHIRLPOOL_SHA256 5636a7a5c578b54cfe0c19d187e91255d7473fdedd881d2a90e6a5dcad32dc25 RUN set -ex && \ cd "$WHIRLPOOL_DIR" && \ From 3f7ff3363c262e6a956037391c45465c2c38e109 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Fri, 3 Jul 2020 19:03:55 +0200 Subject: [PATCH 14/20] update release notes --- RELEASES.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 1a7e89b..7cb3f22 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -18,11 +18,15 @@ ## Samourai Dojo v1.7.0 ## -### Change log ### +### Notable changes ### -### Notable changes ### +#### Upgrade of whirlpool to v0.10.7 #### +Upgrade to [whirlpool-cli](https://code.samourai.io/whirlpool/whirlpool-client-cli) v0.10.7 + + +### Change log ### #### MyDojo #### @@ -30,7 +34,8 @@ - [#mr142](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/142) add setup of explorer in keys.index.js - [#mr143](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/143) update doc and package.json with url of new repository - [#mr144](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/144) switch addrindexrs repo to gitlab -- [#mr145](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/145) explicitely set algo used for jwt signatures +- [#mr145](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/145) explicitely set algo used for jwt signatures +- [#mr146](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/146) upgrade whirlpool to whirlpool-cli 0.10.7 #### Credits ### From 6cc2f90de3c47d282eae20f56cfa94926fe81fd8 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Fri, 3 Jul 2020 21:47:39 +0200 Subject: [PATCH 15/20] update release notes --- RELEASES.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index 7cb3f22..ae787c0 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -21,6 +21,15 @@ ### Notable changes ### +#### New optional strict_mode_vouts added to PushTx endpoints #### + +A new optional "strict mode" is added to the /pushtx and /pushtx/schedule endpoints of the API. + +This strict mode enforces a few additional checks on a selected subset of the outputs of a transaction before it's pushed on the P2P network or before it's scheduled for a delayed push. + +See this [doc](https://code.samourai.io/dojo/samourai-dojo/-/blob/develop/doc/POST_pushtx.md) for detailed information. + + #### Upgrade of whirlpool to v0.10.7 #### Upgrade to [whirlpool-cli](https://code.samourai.io/whirlpool/whirlpool-client-cli) v0.10.7 @@ -36,6 +45,7 @@ Upgrade to [whirlpool-cli](https://code.samourai.io/whirlpool/whirlpool-client-c - [#mr144](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/144) switch addrindexrs repo to gitlab - [#mr145](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/145) explicitely set algo used for jwt signatures - [#mr146](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/146) upgrade whirlpool to whirlpool-cli 0.10.7 +- [#mr147](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/147) add new optional strict_mode_vouts to pushtx endpoints #### Credits ### From 4ce1e62d09ce177d545992946dae27f6f85a5e6a Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Sat, 4 Jul 2020 17:37:26 +0200 Subject: [PATCH 16/20] complete pushtx docs --- doc/POST_pushtx.md | 5 +++-- doc/POST_pushtx_schedule.md | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/doc/POST_pushtx.md b/doc/POST_pushtx.md index e0ed61e..aa6de56 100644 --- a/doc/POST_pushtx.md +++ b/doc/POST_pushtx.md @@ -39,12 +39,13 @@ Status code 400 with JSON response: "error": "" } ``` -or + +or status code 200 with JSON response: ```json { "status": "error", "error": { - "message": [vouts], + "message": [], "code": "VIOLATION_STRICT_MODE_VOUTS" } } diff --git a/doc/POST_pushtx_schedule.md b/doc/POST_pushtx_schedule.md index 69d56b1..5ea4a55 100644 --- a/doc/POST_pushtx_schedule.md +++ b/doc/POST_pushtx_schedule.md @@ -29,6 +29,7 @@ If step A and step B have the same **hop** value, then they MAY HAVE different * The transaction MUST HAVE its nLockTime field filled with the height of a block. The height of the block MUST BE equal to the value of the **nlocktime** field of the ScriptStep object. +* **strict_mode_vouts** (optional) - `int[]` - An array of outpoints indices. A strict verification is enforced on these outpoints before the transaction is pushed. Strict mode checks that addresses associated to these outputs aren't reused. If verifications fail, the scheduled push is aborted and an error is returned. ### Examples @@ -45,7 +46,8 @@ Request Body (JSON-encoded) "script": [{ "hop": 0, "nlocktime": 549817, - "tx": "" + "tx": "", + "strict_mode_vouts": [0,1] }, { "hop": 1, "nlocktime": 549818, @@ -122,3 +124,18 @@ Status code 400 with JSON response: "error": "" } ``` + +or status code 200 with JSON response: +```json +{ + "status": "error", + "error": { + "message": [{ + "txid": "", + "hop": , + "vouts": [] + }, ...], + "code": "VIOLATION_STRICT_MODE_VOUTS" + } +} +``` From 0decb9d82c34f892a4b9453096bc6b609b71819d Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Sat, 4 Jul 2020 17:49:02 +0200 Subject: [PATCH 17/20] return status code 200 on VIOLATION_STRICT_MODE_VOUTS --- pushtx/pushtx-rest-api.js | 17 +++++++++++++---- pushtx/transactions-scheduler.js | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pushtx/pushtx-rest-api.js b/pushtx/pushtx-rest-api.js index c17923a..b05dd5b 100644 --- a/pushtx/pushtx-rest-api.js +++ b/pushtx/pushtx-rest-api.js @@ -165,7 +165,7 @@ class PushTxRestApi { 'message': faults, 'code': errors.pushtx.VIOLATION_STRICT_MODE_VOUTS }) - }) + }, 200) } } } catch(e) { @@ -198,7 +198,13 @@ class PushTxRestApi { await this.scheduler.schedule(req.body.script) HttpServer.sendOk(res) } catch(e) { - this._traceError(res, e) + // Returns code 200 if VIOLATION_STRICT_MODE_VOUTS + if (e.message && e.message.code && e.message.code == errors.pushtx.VIOLATION_STRICT_MODE_VOUTS) { + e.message = JSON.stringify(e.message) + this._traceError(res, e, 200) + } else { + this._traceError(res, e) + } } } @@ -206,10 +212,13 @@ class PushTxRestApi { * Trace an error during push * @param {object} res - http response object * @param {object} err - error object + * @param {int} errorCode - error code (optional) */ - _traceError(res, err) { + _traceError(res, err, errorCode) { let ret = null + errorCode = errorCode == null ? 400 : errorCode + try { if (err.message) { let msg = {} @@ -232,7 +241,7 @@ class PushTxRestApi { Logger.error(e, 'PushTx : ') ret = e } finally { - HttpServer.sendError(res, ret) + HttpServer.sendError(res, ret, errorCode) } } diff --git a/pushtx/transactions-scheduler.js b/pushtx/transactions-scheduler.js index 25edc68..11f085c 100644 --- a/pushtx/transactions-scheduler.js +++ b/pushtx/transactions-scheduler.js @@ -112,10 +112,10 @@ class TransactionsScheduler { // Return if strict_mode_vout has detected errors if (faults.length > 0) { throw { - 'message': JSON.stringify({ + 'message': { 'message': faults, 'code': errors.pushtx.VIOLATION_STRICT_MODE_VOUTS - }) + } } } From 2ff99826a60024999970466b1bc72eb0880517d7 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Sat, 4 Jul 2020 17:53:53 +0200 Subject: [PATCH 18/20] update release notes --- RELEASES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASES.md b/RELEASES.md index ae787c0..39d6d62 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -46,6 +46,7 @@ Upgrade to [whirlpool-cli](https://code.samourai.io/whirlpool/whirlpool-client-c - [#mr145](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/145) explicitely set algo used for jwt signatures - [#mr146](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/146) upgrade whirlpool to whirlpool-cli 0.10.7 - [#mr147](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/147) add new optional strict_mode_vouts to pushtx endpoints +- [#mr148](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/148) status code pushtx endpoints #### Credits ### From 4719c67a7b2f5be67aa339aa8ce45b30e6f68d7b Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Fri, 10 Jul 2020 12:43:44 +0200 Subject: [PATCH 19/20] upgrade whirlpool to whirlpool-cli 0.10.8 --- docker/my-dojo/conf/docker-whirlpool.conf.tpl | 4 ++++ docker/my-dojo/whirlpool/Dockerfile | 6 +++--- docker/my-dojo/whirlpool/restart.sh | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docker/my-dojo/conf/docker-whirlpool.conf.tpl b/docker/my-dojo/conf/docker-whirlpool.conf.tpl index 2ec295a..762681f 100644 --- a/docker/my-dojo/conf/docker-whirlpool.conf.tpl +++ b/docker/my-dojo/conf/docker-whirlpool.conf.tpl @@ -6,6 +6,10 @@ # Value: on | off WHIRLPOOL_INSTALL=off +# Resynchronize mix counters on startup (startup will be slower) +# Value: on | off +WHIRLPOOL_RESYNC=off + # # EXPERT SETTINGS diff --git a/docker/my-dojo/whirlpool/Dockerfile b/docker/my-dojo/whirlpool/Dockerfile index ab123b0..2aee4a0 100644 --- a/docker/my-dojo/whirlpool/Dockerfile +++ b/docker/my-dojo/whirlpool/Dockerfile @@ -51,10 +51,10 @@ RUN set -ex && \ # Install whirlpool-cli ENV WHIRLPOOL_URL https://code.samourai.io/whirlpool/whirlpool-client-cli/uploads -ENV WHIRLPOOL_VERSION 0.10.7 -ENV WHIRLPOOL_VERSION_HASH 8487fff43052fd9ad1ecd8b6856d9de9 +ENV WHIRLPOOL_VERSION 0.10.8 +ENV WHIRLPOOL_VERSION_HASH 7998ea5a9bb180451616809bc346b9ac ENV WHIRLPOOL_JAR "whirlpool-client-cli-$WHIRLPOOL_VERSION-run.jar" -ENV WHIRLPOOL_SHA256 5636a7a5c578b54cfe0c19d187e91255d7473fdedd881d2a90e6a5dcad32dc25 +ENV WHIRLPOOL_SHA256 62e17b6020d0821a98e99ebb773b46191770ec186ceaa3e616a428f5cafe9f49 RUN set -ex && \ cd "$WHIRLPOOL_DIR" && \ diff --git a/docker/my-dojo/whirlpool/restart.sh b/docker/my-dojo/whirlpool/restart.sh index 94d9181..ee0469e 100644 --- a/docker/my-dojo/whirlpool/restart.sh +++ b/docker/my-dojo/whirlpool/restart.sh @@ -22,6 +22,10 @@ else whirlpool_options+=(--cli.dojo.url="http://172.30.1.3:80/v2/") fi +if [ "$WHIRLPOOL_RESYNC" == "on" ]; then + whirlpool_options+=(--resync) +fi + if [ "$WHIRLPOOL_DEBUG" == "on" ]; then whirlpool_options+=(--debug) fi From 9ecd515fe888c2b931270c930d491d0becc604f0 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Fri, 10 Jul 2020 13:27:25 +0200 Subject: [PATCH 20/20] update release notes --- RELEASES.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 39d6d62..8ec57a7 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -30,9 +30,11 @@ This strict mode enforces a few additional checks on a selected subset of the ou See this [doc](https://code.samourai.io/dojo/samourai-dojo/-/blob/develop/doc/POST_pushtx.md) for detailed information. -#### Upgrade of whirlpool to v0.10.7 #### +#### Upgrade of whirlpool to v0.10.8 #### -Upgrade to [whirlpool-cli](https://code.samourai.io/whirlpool/whirlpool-client-cli) v0.10.7 +Upgrade to [whirlpool-cli](https://code.samourai.io/whirlpool/whirlpool-client-cli) v0.10.8 + +A new config parameter `WHIRLPOOL_RESYNC` is added to docker-whirlpool.conf. When set to `on`, mix counters are resynchronized on startup of whirlpool-cli. ### Change log ### @@ -47,11 +49,13 @@ Upgrade to [whirlpool-cli](https://code.samourai.io/whirlpool/whirlpool-client-c - [#mr146](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/146) upgrade whirlpool to whirlpool-cli 0.10.7 - [#mr147](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/147) add new optional strict_mode_vouts to pushtx endpoints - [#mr148](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/148) status code pushtx endpoints +- [#mr149](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/149) upgrade whirlpool to whirlpool-cli 0.10.8 #### Credits ### - kenshin-samourai +- zeroleak