diff --git a/CHANGELOG.md b/CHANGELOG.md index 364ca038..f77c0b9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [1.0.5] - 2019-03-05 + +### Fixed + +- Blocks service: Db error on the first run +- Errors when running against a regtest node + +### Changed + +- Docker: expose api documentation + ## [1.0.4] - 2019-02-27 ### Added diff --git a/dist/services/blocks/index.js b/dist/services/blocks/index.js index 4b177793..06f97508 100644 --- a/dist/services/blocks/index.js +++ b/dist/services/blocks/index.js @@ -1,4 +1,4 @@ -"use strict";var _path = _interopRequireDefault(require("path")); +"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.setupBlocks = setupBlocks;var _path = _interopRequireDefault(require("path")); var _child_process = require("child_process"); var _config = _interopRequireDefault(require("../../lib/config")); var _Logger = _interopRequireDefault(require("../../lib/Logger")); @@ -13,9 +13,14 @@ config.log = log; startBlocks(); -async function startBlocks() { +async function setupBlocks() { const setup = await (0, _Setup.default)({ log }); await setup.createCollections(); + return setup; +} + +async function startBlocks() { + const setup = await setupBlocks(); const { db, initConfig } = await setup.start(); config.initConfig = initConfig; const Status = new _BlocksStatus.BlocksStatus(db, config); diff --git a/dist/services/blocks/setup.js b/dist/services/blocks/setup.js new file mode 100644 index 00000000..3c2ec39a --- /dev/null +++ b/dist/services/blocks/setup.js @@ -0,0 +1,8 @@ +"use strict";var _index = require("./index.js"); + +(0, _index.setupBlocks)().then(() => { + process.exit(0); +}).catch(err => { + console.log(err); + process.exit(9); +}); \ No newline at end of file diff --git a/dist/services/classes/CheckBlocks.js b/dist/services/classes/CheckBlocks.js index c98217c4..5fa5ed7b 100644 --- a/dist/services/classes/CheckBlocks.js +++ b/dist/services/classes/CheckBlocks.js @@ -101,6 +101,7 @@ class CheckBlocks extends _BlocksBase.BlocksBase { } getBlocks(check) { + check = check || {}; try { let segments = check.missingSegments || []; let invalid = check.invalid || []; diff --git a/dist/services/userEvents/ContractVerifierModule.js b/dist/services/userEvents/ContractVerifierModule.js index 98d46d57..c06406d9 100644 --- a/dist/services/userEvents/ContractVerifierModule.js +++ b/dist/services/userEvents/ContractVerifierModule.js @@ -5,7 +5,7 @@ var _mongodb = require("mongodb");function _interopRequireDefault(obj) {return o const versionsId = '_contractVerifierVersions';exports.versionsId = versionsId; -function ContractVerifierModule(db, collections, { url }, { log }) { +function ContractVerifierModule(db, collections, { url } = {}, { log } = {}) { log = log || console; const storedConfig = (0, _StoredConfig.StoredConfig)(db); const socket = _socket.default.connect(url, { reconnect: true }); diff --git a/package-lock.json b/package-lock.json index 4042a94b..00137085 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "rsk-explorer-api", - "version": "1.0.4", + "version": "1.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3208,14 +3208,15 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.11.tgz", + "integrity": "sha512-+ux3lx6peh0BpvY0JebGyZoiR4D+oYzdPZMKJwkZ+sFkNJzpL7tXc/wehS49gUAxg3tmMHPHZkA8JU2rhhgDHw==", "dev": true, "optional": true, "requires": { + "bindings": "^1.5.0", "nan": "^2.12.1", - "node-pre-gyp": "^0.12.0" + "node-pre-gyp": "*" }, "dependencies": { "abbrev": { @@ -3263,7 +3264,7 @@ } }, "chownr": { - "version": "1.1.1", + "version": "1.1.3", "bundled": true, "dev": true, "optional": true @@ -3293,7 +3294,7 @@ "optional": true }, "debug": { - "version": "4.1.1", + "version": "3.2.6", "bundled": true, "dev": true, "optional": true, @@ -3320,12 +3321,12 @@ "optional": true }, "fs-minipass": { - "version": "1.2.5", + "version": "1.2.7", "bundled": true, "dev": true, "optional": true, "requires": { - "minipass": "^2.2.1" + "minipass": "^2.6.0" } }, "fs.realpath": { @@ -3351,7 +3352,7 @@ } }, "glob": { - "version": "7.1.3", + "version": "7.1.6", "bundled": true, "dev": true, "optional": true, @@ -3380,7 +3381,7 @@ } }, "ignore-walk": { - "version": "3.0.1", + "version": "3.0.3", "bundled": true, "dev": true, "optional": true, @@ -3399,7 +3400,7 @@ } }, "inherits": { - "version": "2.0.3", + "version": "2.0.4", "bundled": true, "dev": true, "optional": true @@ -3441,7 +3442,7 @@ "optional": true }, "minipass": { - "version": "2.3.5", + "version": "2.9.0", "bundled": true, "dev": true, "optional": true, @@ -3451,12 +3452,12 @@ } }, "minizlib": { - "version": "1.2.1", + "version": "1.3.3", "bundled": true, "dev": true, "optional": true, "requires": { - "minipass": "^2.2.1" + "minipass": "^2.9.0" } }, "mkdirp": { @@ -3469,24 +3470,24 @@ } }, "ms": { - "version": "2.1.1", + "version": "2.1.2", "bundled": true, "dev": true, "optional": true }, "needle": { - "version": "2.3.0", + "version": "2.4.0", "bundled": true, "dev": true, "optional": true, "requires": { - "debug": "^4.1.0", + "debug": "^3.2.6", "iconv-lite": "^0.4.4", "sax": "^1.2.4" } }, "node-pre-gyp": { - "version": "0.12.0", + "version": "0.14.0", "bundled": true, "dev": true, "optional": true, @@ -3500,7 +3501,7 @@ "rc": "^1.2.7", "rimraf": "^2.6.1", "semver": "^5.3.0", - "tar": "^4" + "tar": "^4.4.2" } }, "nopt": { @@ -3514,13 +3515,22 @@ } }, "npm-bundled": { - "version": "1.0.6", + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", "bundled": true, "dev": true, "optional": true }, "npm-packlist": { - "version": "1.4.1", + "version": "1.4.7", "bundled": true, "dev": true, "optional": true, @@ -3591,7 +3601,7 @@ "optional": true }, "process-nextick-args": { - "version": "2.0.0", + "version": "2.0.1", "bundled": true, "dev": true, "optional": true @@ -3632,7 +3642,7 @@ } }, "rimraf": { - "version": "2.6.3", + "version": "2.7.1", "bundled": true, "dev": true, "optional": true, @@ -3659,7 +3669,7 @@ "optional": true }, "semver": { - "version": "5.7.0", + "version": "5.7.1", "bundled": true, "dev": true, "optional": true @@ -3712,18 +3722,18 @@ "optional": true }, "tar": { - "version": "4.4.8", + "version": "4.4.13", "bundled": true, "dev": true, "optional": true, "requires": { "chownr": "^1.1.1", "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", "mkdirp": "^0.5.0", "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" + "yallist": "^3.0.3" } }, "util-deprecate": { @@ -3748,7 +3758,7 @@ "optional": true }, "yallist": { - "version": "3.0.3", + "version": "3.1.1", "bundled": true, "dev": true, "optional": true diff --git a/package.json b/package.json index 5ae51c28..9b5fd892 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rsk-explorer-api", - "version": "1.0.4", + "version": "1.0.5", "description": "", "main": "index.js", "scripts": { diff --git a/public/swagger.json b/public/swagger.json index 972515dc..1cb6ba7e 100644 --- a/public/swagger.json +++ b/public/swagger.json @@ -1,7 +1,7 @@ { "info": { "title": "rsk-explorer-api", - "version": "1.0.4", + "version": "1.0.5", "description": "explorer API Documentation" }, "swagger": "2.0",