Commit a6cb0d86 authored by Pavel Ševčík's avatar Pavel Ševčík
Browse files

Merge branch '1.12.1' into 'master'

1.12.1

See merge request dojo/samourai-dojo!257
parents c1a5d3ea 0db18929
......@@ -3,6 +3,7 @@
## Releases ##
- [v1.12.1](#1_12_1)
- [v1.12.0](#1_12_0)
- [v1.11.0](#1_11_0)
- [v1.10.1](#1_10_1)
......@@ -19,6 +20,20 @@
- [v1.2.0](#1_2_0)
- [v1.1.0](#1_1_0)
<a name="1_12_1"/>
## Samourai Dojo v1.12.1 ##
### Change log ###
#### Bug fixes ####
- [#mr254](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/254) added missing container dependencies for zeromq build
- [#mr255](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/255) fixed imports/rescans not being processed correctly
#### Credits ####
- pajasevi
- Taylor Helsper
<a name="1_12_0"/>
## Samourai Dojo v1.12.0 ##
......
......@@ -10,10 +10,10 @@
COMPOSE_CONVERT_WINDOWS_PATHS=1
DOJO_VERSION_TAG=1.12.0
DOJO_VERSION_TAG=1.12.1
DOJO_DB_VERSION_TAG=1.3.0
DOJO_BITCOIND_VERSION_TAG=1.13.0
DOJO_NODEJS_VERSION_TAG=1.12.0
DOJO_NODEJS_VERSION_TAG=1.12.1
DOJO_NGINX_VERSION_TAG=1.7.0
DOJO_TOR_VERSION_TAG=1.11.0
DOJO_EXPLORER_VERSION_TAG=1.8.0
......
......@@ -30,6 +30,7 @@ bitcoind_options=(
-txindex=1
-zmqpubhashblock=tcp://0.0.0.0:9502
-zmqpubrawtx=tcp://0.0.0.0:9501
-deprecatedrpc=addresses
)
if [ "$BITCOIND_LISTEN_MODE" == "on" ]; then
......
......@@ -6,7 +6,7 @@ ENV APP_DIR /home/node/app
ARG TOR_LINUX_GID
RUN set -ex && \
apk --no-cache add shadow bash gcc g++ make python3
apk --no-cache add shadow bash gcc g++ make python3 curl cmake
# Add node user to tor group
RUN addgroup -S -g ${TOR_LINUX_GID} tor && \
......
......@@ -16,7 +16,7 @@ module.exports = {
/*
* Dojo version
*/
dojoVersion: '1.12.0',
dojoVersion: '1.12.1',
/*
* Bitcoind
*/
......@@ -233,7 +233,7 @@ module.exports = {
* Testnet parameters
*/
testnet: {
dojoVersion: '1.12.0',
dojoVersion: '1.12.1',
bitcoind: {
rpc: {
user: 'user',
......
......@@ -93,25 +93,37 @@ class RpcClient {
/**
* Send multiple requests (batch mode)
* @param {Object[]} batch - array of objects {method: ..., params: ...}
* @return {Promise}
* @return {Promise<object[]>}
*/
async sendBatch(batch) {
return this._call(batch, true)
const batchList = util.splitList(batch, 100)
const responses = await util.seriesCall(batchList, (requests) => {
return this._call(requests, true)
})
return responses.flat()
}
/**
* Send multiple requests (flood mode)
* @param {Object[]} batch - array of objects {method: ..., params: ...}
* @return {Promise}
* @return {Promise<object[]>}
*/
async sendRequests(batch) {
return this._call(batch, false)
const batchList = util.splitList(batch, 100)
const responses = await util.seriesCall(batchList, (requests) => {
return this._call(requests, false)
})
return responses.flat()
}
/**
* Send a request
* @param {string} method - called method
* @return {Promise}
* @return {Promise<object>}
*/
async sendRequest(method, ...params) {
const batch = [{method: method, params: params}]
......@@ -123,7 +135,7 @@ class RpcClient {
* Send requests (internal method)
* @param {Object[]} data - array of objects {method: ..., params: ...}
* @param {boolean=} batched - batch requests
* @returns {Promise}
* @returns {Promise<object[]>}
*/
async _call(data, batched) {
return new Promise((resolve, reject) => {
......
......@@ -123,7 +123,7 @@ class RemoteImporter {
await db.ensureHDAccountId(xpub, type)
const addrChunks = util.splitList(addresses, 1000)
await util.parallelCall(addrChunks, chunk => {
await util.seriesCall(addrChunks, chunk => {
return db.addAddressesToHDAccount(xpub, chunk)
})
......@@ -294,20 +294,20 @@ class RemoteImporter {
*/
async _importTransactions(addresses, txs) {
const addrChunks = util.splitList(addresses, 1000)
const addrIdMaps = await util.parallelCall(addrChunks, chunk => {
const addrIdMaps = await util.seriesCall(addrChunks, chunk => {
return db.getAddressesIds(chunk)
})
const addrIdMap = Object.assign({}, ...addrIdMaps)
// Process the transactions by batches of 200 transactions
const txsChunks = util.splitList(txs, 200)
await util.parallelCall(txsChunks, chunk => {
await util.seriesCall(txsChunks, chunk => {
return this._addTransactions(chunk)
})
await util.parallelCall(txsChunks, chunk => {
await util.seriesCall(txsChunks, chunk => {
return this._addOutputs(chunk, addrIdMap)
})
await util.parallelCall(txsChunks, chunk => {
await util.seriesCall(txsChunks, chunk => {
return this._addInputs(chunk)
})
}
......@@ -340,7 +340,7 @@ class RemoteImporter {
/**
* Add a collection of transaction outputs to the database.
* @param {object[]} txs - array of transaction objects
* @params {object} addrIdMap - map address => addrId
* @param {object} addrIdMap - map address => addrId
* @returns {Promise}
*/
async _addOutputs(txs, addrIdMap) {
......
{
"name": "samourai-dojo",
"version": "1.12.0",
"version": "1.12.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "samourai-dojo",
"version": "1.12.0",
"version": "1.12.1",
"license": "AGPL-3.0-only",
"dependencies": {
"@tinyhttp/app": "1.3.13",
......
{
"name": "samourai-dojo",
"version": "1.12.0",
"version": "1.12.1",
"description": "Backend server for Samourai Wallet",
"main": "accounts/index.js",
"engines": {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment