Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliorizzo committed Mar 5, 2020
1 parent 1192e29 commit 89e5d43
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
9 changes: 7 additions & 2 deletions dist/services/blocks/index.js
Original file line number Diff line number Diff line change
@@ -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"));
Expand All @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions dist/services/blocks/setup.js
Original file line number Diff line number Diff line change
@@ -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);
});
1 change: 1 addition & 0 deletions dist/services/classes/CheckBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class CheckBlocks extends _BlocksBase.BlocksBase {
}

getBlocks(check) {
check = check || {};
try {
let segments = check.missingSegments || [];
let invalid = check.invalid || [];
Expand Down
2 changes: 1 addition & 1 deletion dist/services/userEvents/ContractVerifierModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit 89e5d43

Please sign in to comment.