From 56e750b39f7575d5c19608b033c62ccb98b8a37f Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 26 Dec 2019 10:45:35 +0100 Subject: [PATCH] Data Mine Refactoring --- Assistant.js | 2 +- Commons.js | 8 ++++---- Context.js | 12 ++++++------ DataDependencies.js | 2 +- DataSet.js | 18 ++++++++--------- DebugLog.js | 10 +++++----- IndicatorBot.js | 2 +- IndicatorBotProcessMainLoop.js | 8 ++++---- Integrations/Ecosystem.js | 2 +- MultiPeriod.js | 10 +++++----- MultiPeriodDaily.js | 6 +++--- MultiPeriodMarket.js | 4 ++-- ProcessExecutionEvents.js | 2 +- ProcessOutput.js | 8 ++++---- Root.js | 16 +++++++-------- SensorBotProcessMainLoop.js | 8 ++++---- StatusDependencies.js | 4 ++-- StatusReport.js | 20 +++++++++---------- TradingBot.js | 36 +++++++++++++++++----------------- TradingBotProcessMainLoop.js | 8 ++++---- server.js | 4 ++-- 21 files changed, 95 insertions(+), 95 deletions(-) diff --git a/Assistant.js b/Assistant.js index 293a657fd..adf3bc209 100644 --- a/Assistant.js +++ b/Assistant.js @@ -133,7 +133,7 @@ /* Procedure to get the current market rate. */ let key = - bot.marketRateProvider.devTeam + "-" + + bot.marketRateProvider.dataMine + "-" + bot.marketRateProvider.bot + "-" + bot.marketRateProvider.product + "-" + bot.marketRateProvider.dataSet + "-" + diff --git a/Commons.js b/Commons.js index 63ed77f00..7b0a55340 100644 --- a/Commons.js +++ b/Commons.js @@ -104,13 +104,13 @@ } if (outputDatasetNode.referenceParent.parentNode.parentNode.parentNode === undefined) { - logger.write(MODULE_NAME, "[ERROR] start -> Bot not attached to a Team. Bot = " + JSON.stringify(outputDatasetNode.referenceParent.parentNode.parentNode)); + logger.write(MODULE_NAME, "[ERROR] start -> Bot not attached to a Data Mine. Bot = " + JSON.stringify(outputDatasetNode.referenceParent.parentNode.parentNode)); callBackFunction(global.DEFAULT_FAIL_RESPONSE); return } if (outputDatasetNode.referenceParent.parentNode.parentNode.parentNode.code.codeName === undefined) { - logger.write(MODULE_NAME, "[ERROR] start -> Team witn no codeName defined. Team = " + JSON.stringify(outputDatasetNode.referenceParent.parentNode.parentNode.parentNode)); + logger.write(MODULE_NAME, "[ERROR] start -> Data Mine witn no codeName defined. Data Mine = " + JSON.stringify(outputDatasetNode.referenceParent.parentNode.parentNode.parentNode)); callBackFunction(global.DEFAULT_FAIL_RESPONSE); return } @@ -476,11 +476,11 @@ dateForPath = "/" + currentDay.getUTCFullYear() + '/' + utilities.pad(currentDay.getUTCMonth() + 1, 2) + '/' + utilities.pad(currentDay.getUTCDate(), 2); } - let filePathRoot = contextSummary.devTeam + "/" + contextSummary.bot + "." + contextSummary.botVersion.major + "." + contextSummary.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + contextSummary.dataSetVersion; + let filePathRoot = contextSummary.dataMine + "/" + contextSummary.bot + "." + contextSummary.botVersion.major + "." + contextSummary.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + contextSummary.dataSetVersion; let filePath = filePathRoot + "/Output/" + contextSummary.product + "/" + contextSummary.dataset + "/" + timePeriodLabel + dateForPath; filePath += '/' + fileName - fileStorage.createTextFile(contextSummary.devTeam, filePath, fileContent + '\n', onFileCreated); + fileStorage.createTextFile(contextSummary.dataMine, filePath, fileContent + '\n', onFileCreated); function onFileCreated(err) { diff --git a/Context.js b/Context.js index 5395ac2ca..caf859a1c 100644 --- a/Context.js +++ b/Context.js @@ -134,7 +134,7 @@ if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] initialize -> getStatusReport -> Entering function."); } - let key = bot.devTeam + "-" + bot.codeName + "-" + "Context" + "-" + bot.dataSetVersion; + let key = bot.dataMine + "-" + bot.codeName + "-" + "Context" + "-" + bot.dataSetVersion; statusReportModule = statusDependencies.statusReports.get(key); thisObject.statusReport = statusReportModule.file; @@ -168,7 +168,7 @@ let fileName = "Execution.History." + bot.startMode + "." + runIndex + ".json"; let filePath = bot.filePathRoot + "/Output/" + sessionPath + "Trading-Process/" + fileName; - fileStorage.getTextFile(bot.devTeam, filePath, onFileReceived); + fileStorage.getTextFile(bot.dataMine, filePath, onFileReceived); function onFileReceived(err, text) { @@ -229,7 +229,7 @@ let dateForPath = date.getUTCFullYear() + '/' + utilities.pad(date.getUTCMonth() + 1, 2) + '/' + utilities.pad(date.getUTCDate(), 2) + '/' + utilities.pad(date.getUTCHours(), 2) + '/' + utilities.pad(date.getUTCMinutes(), 2); let filePath = bot.filePathRoot + "/Output/" + sessionPath + "Trading-Process/" + dateForPath + fileName; - fileStorage.getTextFile(bot.devTeam, filePath, onFileReceived); + fileStorage.getTextFile(bot.dataMine, filePath, onFileReceived); function onFileReceived(err, text) { @@ -411,7 +411,7 @@ if (global.LOG_CONTROL[MODULE_NAME].logContent === true) { logger.write(MODULE_NAME, "[INFO] saveThemAll -> writeExecutionContext -> fileContent = " + fileContent); } - fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated); + fileStorage.createTextFile(bot.dataMine, filePath, fileContent + '\n', onFileCreated); function onFileCreated(err) { @@ -472,7 +472,7 @@ let fileContent = JSON.stringify(thisObject.executionHistory); - fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated); + fileStorage.createTextFile(bot.dataMine, filePath, fileContent + '\n', onFileCreated); function onFileCreated(err) { @@ -494,7 +494,7 @@ fileName = "Execution.History." + bot.startMode + "." + "Sequence" + ".json"; filePath = bot.filePathRoot + "/Output/" + sessionPath + "Trading-Process/" + fileName; - fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onSequenceFileCreated); + fileStorage.createTextFile(bot.dataMine, filePath, fileContent + '\n', onSequenceFileCreated); function onSequenceFileCreated(err) { diff --git a/DataDependencies.js b/DataDependencies.js index ec7bbbb95..084d4704e 100644 --- a/DataDependencies.js +++ b/DataDependencies.js @@ -79,7 +79,7 @@ let key; - key = thisObject.nodeArray[i].devTeam + "-" + thisObject.nodeArray[i].bot + "-" + thisObject.nodeArray[i].product + "-" + thisObject.nodeArray[i].dataSet + "-" + thisObject.nodeArray[i].dataSetVersion; + key = thisObject.nodeArray[i].dataMine + "-" + thisObject.nodeArray[i].bot + "-" + thisObject.nodeArray[i].product + "-" + thisObject.nodeArray[i].dataSet + "-" + thisObject.nodeArray[i].dataSetVersion; thisObject.keys.push(key); thisObject.dataSets.set(key, dataSetModule); diff --git a/DataSet.js b/DataSet.js index 4d6a72bc4..f4ed6b59e 100644 --- a/DataSet.js +++ b/DataSet.js @@ -66,13 +66,13 @@ exports.newDataSet = function newDataSet(BOT, logger) { } if (dataDependencyNode.referenceParent.parentNode.parentNode.parentNode === undefined) { - logger.write(MODULE_NAME, "[ERROR] initialize -> Bot not attached to a Team. Bot = " + JSON.stringify(dataDependencyNode.referenceParent.parentNode.parentNode)); + logger.write(MODULE_NAME, "[ERROR] initialize -> Bot not attached to a Data Mine. Bot = " + JSON.stringify(dataDependencyNode.referenceParent.parentNode.parentNode)); callBackFunction(global.DEFAULT_FAIL_RESPONSE); return } if (dataDependencyNode.referenceParent.parentNode.parentNode.parentNode.code.codeName === undefined) { - logger.write(MODULE_NAME, "[ERROR] initialize -> Team witn no codeName defined. Team = " + JSON.stringify(dataDependencyNode.referenceParent.parentNode.parentNode.parentNode)); + logger.write(MODULE_NAME, "[ERROR] initialize -> Data Mine witn no codeName defined. Data Mine = " + JSON.stringify(dataDependencyNode.referenceParent.parentNode.parentNode.parentNode)); callBackFunction(global.DEFAULT_FAIL_RESPONSE); return } @@ -81,7 +81,7 @@ exports.newDataSet = function newDataSet(BOT, logger) { dataDependencyNode.dataSet = dataDependencyNode.referenceParent.code.codeName dataDependencyNode.product = dataDependencyNode.referenceParent.parentNode.code.codeName dataDependencyNode.bot = dataDependencyNode.referenceParent.parentNode.parentNode.code.codeName - dataDependencyNode.devTeam = dataDependencyNode.referenceParent.parentNode.parentNode.parentNode.code.codeName + dataDependencyNode.dataMine = dataDependencyNode.referenceParent.parentNode.parentNode.parentNode.code.codeName /* This stuff is still hardcoded and unresolved. */ dataDependencyNode.botVersion = { @@ -104,11 +104,11 @@ exports.newDataSet = function newDataSet(BOT, logger) { if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] getTextFile -> Entering function."); } - let filePathRoot = dataDependencyNode.devTeam + "/" + dataDependencyNode.bot + "." + dataDependencyNode.botVersion.major + "." + dataDependencyNode.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + dataDependencyNode.dataSetVersion; + let filePathRoot = dataDependencyNode.dataMine + "/" + dataDependencyNode.bot + "." + dataDependencyNode.botVersion.major + "." + dataDependencyNode.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + dataDependencyNode.dataSetVersion; let filePath = filePathRoot + "/Output/" + pFolderPath; filePath += '/' + pFileName - fileStorage.getTextFile(dataDependencyNode.devTeam, filePath, onFileReceived); + fileStorage.getTextFile(dataDependencyNode.dataMine, filePath, onFileReceived); function onFileReceived(err, text) { @@ -132,8 +132,8 @@ exports.newDataSet = function newDataSet(BOT, logger) { if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] createTextFile -> pFolderPath = " + pFolderPath); } if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] createTextFile -> pFileName = " + pFileName); } - let ownerId = dataDependencyNode.devTeam + "-" + dataDependencyNode.bot + "-" + dataDependencyNode.botVersion.major + "-" + dataDependencyNode.botVersion.minor + "-" + dataDependencyNode.dataSetVersion; - let botId = bot.devTeam + "-" + bot.codeName + "-" + bot.version.major + "-" + bot.version.minor + "-" + bot.dataSetVersion; + let ownerId = dataDependencyNode.dataMine + "-" + dataDependencyNode.bot + "-" + dataDependencyNode.botVersion.major + "-" + dataDependencyNode.botVersion.minor + "-" + dataDependencyNode.dataSetVersion; + let botId = bot.dataMine + "-" + bot.codeName + "-" + bot.version.major + "-" + bot.version.minor + "-" + bot.dataSetVersion; if (ownerId !== botId) { @@ -146,10 +146,10 @@ exports.newDataSet = function newDataSet(BOT, logger) { return; } - let filePathRoot = dataDependencyNode.devTeam + "/" + dataDependencyNode.bot + "." + dataDependencyNode.botVersion.major + "." + dataDependencyNode.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + dataDependencyNode.dataSetVersion; + let filePathRoot = dataDependencyNode.dataMine + "/" + dataDependencyNode.bot + "." + dataDependencyNode.botVersion.major + "." + dataDependencyNode.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + dataDependencyNode.dataSetVersion; let filePath = filePathRoot + "/Output/" + pFolderPath + '/' + pFileName; - fileStorage.createTextFile(dataDependencyNode.devTeam, filePath, pFileContent, onFileCreated); + fileStorage.createTextFile(dataDependencyNode.dataMine, filePath, pFileContent, onFileCreated); function onFileCreated(err) { diff --git a/DebugLog.js b/DebugLog.js index 6374eb201..22be40b3a 100644 --- a/DebugLog.js +++ b/DebugLog.js @@ -92,22 +92,22 @@ exports.newDebugLog = function newDebugLog() { let fileToDelete = thisObject.bot.LOGS_TO_DELETE_QUEUE[0] thisObject.bot.LOGS_TO_DELETE_QUEUE.splice(0, 1) /* Will delete this file only if it does not contains ERROR inside. */ - let fileContent = fileStorage.getTextFile(thisObject.bot.devTeam, fileToDelete, onGetFile, true) + let fileContent = fileStorage.getTextFile(thisObject.bot.dataMine, fileToDelete, onGetFile, true) function onGetFile(err, fileContent) { if (err.result === global.DEFAULT_OK_RESPONSE.result) { if (fileContent.indexOf("ERROR") < 0) { /* Logs will only be deleted when they contain no ERROR in them. */ - fileStorage.deleteTextFile(thisObject.bot.devTeam, fileToDelete); + fileStorage.deleteTextFile(thisObject.bot.dataMine, fileToDelete); } } else { - fileStorage.deleteTextFile(thisObject.bot.devTeam, fileToDelete); + fileStorage.deleteTextFile(thisObject.bot.dataMine, fileToDelete); } } } function writeLog() { - fileStorage.createTextFile(thisObject.bot.devTeam, filePath + '/' + fileName, contentToPersist + '\r\n' + "]", onFileCreated); + fileStorage.createTextFile(thisObject.bot.dataMine, filePath + '/' + fileName, contentToPersist + '\r\n' + "]", onFileCreated); function onFileCreated(err) { if (err.result !== global.DEFAULT_OK_RESPONSE.result) { console.log("[ERROR] DebugLog -> persist -> onInizialized -> onFileCreated -> err = "+ err.message); @@ -149,7 +149,7 @@ exports.newDebugLog = function newDebugLog() { if (process.env.CONSOLE_LOG === "true" || message.indexOf("ERROR") > 0) { let key = '' if (thisObject.bot) { - key = thisObject.bot.devTeam + '-' + thisObject.bot.codeName + '-' + thisObject.bot.process + key = thisObject.bot.dataMine + '-' + thisObject.bot.codeName + '-' + thisObject.bot.process } console.log('*********** ' + message + ' @ ' + key) } diff --git a/IndicatorBot.js b/IndicatorBot.js index e1c5b59e7..30f834dee 100644 --- a/IndicatorBot.js +++ b/IndicatorBot.js @@ -139,7 +139,7 @@ contextSummary.dataset = outputDatasetNode.referenceParent.code.codeName contextSummary.product = outputDatasetNode.referenceParent.parentNode.code.codeName contextSummary.bot = outputDatasetNode.referenceParent.parentNode.parentNode.code.codeName - contextSummary.devTeam = outputDatasetNode.referenceParent.parentNode.parentNode.parentNode.code.codeName + contextSummary.dataMine = outputDatasetNode.referenceParent.parentNode.parentNode.parentNode.code.codeName /* This stuff is still hardcoded and unresolved. */ contextSummary.botVersion = { diff --git a/IndicatorBotProcessMainLoop.js b/IndicatorBotProcessMainLoop.js index e29c7ac60..39e613201 100644 --- a/IndicatorBotProcessMainLoop.js +++ b/IndicatorBotProcessMainLoop.js @@ -43,10 +43,10 @@ /* This bot is not ready for taking its code from the UI, then we need to load it from its repo. */ - let filePath = bot.devTeam + "/" + "bots" + "/" + bot.repo + "/" + pProcessConfig.codeName + let filePath = bot.dataMine + "/" + "bots" + "/" + bot.repo + "/" + pProcessConfig.codeName filePath += "/User.Bot.js" - fileStorage.getTextFile(bot.devTeam, filePath, onBotDownloaded); + fileStorage.getTextFile(bot.dataMine, filePath, onBotDownloaded); function onBotDownloaded(err, text) { @@ -61,10 +61,10 @@ USER_BOT_MODULE = {} USER_BOT_MODULE.newUserBot = eval(text); // TODO This needs to be changed function - filePath = bot.devTeam + "/" + "bots" + "/" + bot.repo; + filePath = bot.dataMine + "/" + "bots" + "/" + bot.repo; filePath += "/Commons.js" - fileStorage.getTextFile(bot.devTeam, filePath, onCommonsDownloaded); + fileStorage.getTextFile(bot.dataMine, filePath, onCommonsDownloaded); function onCommonsDownloaded(err, text) { diff --git a/Integrations/Ecosystem.js b/Integrations/Ecosystem.js index fcf1fd364..6c76069fe 100644 --- a/Integrations/Ecosystem.js +++ b/Integrations/Ecosystem.js @@ -21,7 +21,7 @@ exports.getEcosystem = async function () { query { web_GetEcosystem { id - devTeams { + dataMines { codeName displayName host { diff --git a/MultiPeriod.js b/MultiPeriod.js index 37ca1fff8..af432f083 100644 --- a/MultiPeriod.js +++ b/MultiPeriod.js @@ -48,7 +48,7 @@ let dataset; let dependency = dataDependencies.nodeArray[i]; - key = dependency.devTeam + "-" + + key = dependency.dataMine + "-" + dependency.bot + "-" + dependency.product + "-" + dependency.dataSet + "-" + @@ -995,7 +995,7 @@ let fileName = '/Data.Range.' + market.assetA + '_' + market.assetB + '.json'; let filePath = bot.filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + productCodeName + "/" + 'Multi-Period-Daily' + fileName; - fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated); + fileStorage.createTextFile(bot.dataMine, filePath, fileContent + '\n', onFileCreated); function onFileCreated(err) { @@ -1011,7 +1011,7 @@ logger.write(MODULE_NAME, "[INFO] start -> writeDataRange -> onFileCreated -> Content written = " + fileContent); } - let key = bot.devTeam + "-" + bot.codeName + "-" + productCodeName + "-" + currentOutputPeriodName + let key = bot.dataMine + "-" + bot.codeName + "-" + productCodeName + "-" + currentOutputPeriodName let event = { dateRange: dataRange } @@ -1034,7 +1034,7 @@ try { - let reportKey = bot.devTeam + "-" + bot.codeName + "-" + "Multi-Period" + "-" + "dataSet.V1"; + let reportKey = bot.dataMine + "-" + bot.codeName + "-" + "Multi-Period" + "-" + "dataSet.V1"; let thisReport = statusDependencies.statusReports.get(reportKey); thisReport.file.lastExecution = bot.currentDaytime; @@ -1057,7 +1057,7 @@ try { - let reportKey = bot.devTeam + "-" + bot.codeName + "-" + "Multi-Period" + "-" + "dataSet.V1"; + let reportKey = bot.dataMine + "-" + bot.codeName + "-" + "Multi-Period" + "-" + "dataSet.V1"; let thisReport = statusDependencies.statusReports.get(reportKey); thisReport.file.lastExecution = bot.processDatetime; diff --git a/MultiPeriodDaily.js b/MultiPeriodDaily.js index 30a89adb0..bd323dc57 100644 --- a/MultiPeriodDaily.js +++ b/MultiPeriodDaily.js @@ -48,7 +48,7 @@ let dataset; let dependency = dataDependencies.nodeArray[i]; - key = dependency.devTeam + "-" + + key = dependency.dataMine + "-" + dependency.bot + "-" + dependency.product + "-" + dependency.dataSet + "-" + @@ -729,7 +729,7 @@ let fileName = '/Data.Range.' + market.assetA + '_' + market.assetB + '.json'; let filePath = bot.filePathRoot + "/Output/" + productCodeName + "/" + bot.process + fileName; - fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated); + fileStorage.createTextFile(bot.dataMine, filePath, fileContent + '\n', onFileCreated); function onFileCreated(err) { @@ -761,7 +761,7 @@ try { - let reportKey = bot.devTeam + "-" + bot.codeName + "-" + "Multi-Period-Daily" + "-" + "dataSet.V1"; + let reportKey = bot.dataMine + "-" + bot.codeName + "-" + "Multi-Period-Daily" + "-" + "dataSet.V1"; let thisReport = statusDependencies.statusReports.get(reportKey); thisReport.file.lastExecution = bot.currentDaytime; diff --git a/MultiPeriodMarket.js b/MultiPeriodMarket.js index 4ee15f3e8..efc98ddb3 100644 --- a/MultiPeriodMarket.js +++ b/MultiPeriodMarket.js @@ -42,7 +42,7 @@ let dataset; let dependency = dataDependencies.nodeArray[i]; - key = dependency.devTeam + "-" + + key = dependency.dataMine + "-" + dependency.bot + "-" + dependency.product + "-" + dependency.dataSet + "-" + @@ -332,7 +332,7 @@ try { - let reportKey = bot.devTeam + "-" + bot.codeName + "-" + "Multi-Period-Market" + "-" + "dataSet.V1"; + let reportKey = bot.dataMine + "-" + bot.codeName + "-" + "Multi-Period-Market" + "-" + "dataSet.V1"; let thisReport = statusDependencies.statusReports.get(reportKey); thisReport.file.lastExecution = bot.processDatetime; diff --git a/ProcessExecutionEvents.js b/ProcessExecutionEvents.js index fd04c2efc..64f45bda4 100644 --- a/ProcessExecutionEvents.js +++ b/ProcessExecutionEvents.js @@ -83,7 +83,7 @@ if (year) { extraCallerId = extraCallerId + '-' + year } let key = processThisDependsOn.name + "-" + processThisDependsOn.type + "-" + processThisDependsOn.id - let callerId = bot.devTeam + "-" + bot.codeName + "-" + bot.process + extraCallerId + let callerId = bot.dataMine + "-" + bot.codeName + "-" + bot.process + extraCallerId let subscriptionId diff --git a/ProcessOutput.js b/ProcessOutput.js index ef74e7305..6a07bbc34 100644 --- a/ProcessOutput.js +++ b/ProcessOutput.js @@ -49,12 +49,12 @@ } if (outputDataset.referenceParent.parentNode.parentNode.parentNode !== undefined) { if (outputDataset.referenceParent.parentNode.parentNode.parentNode.code.codeName === undefined) { - logger.write(MODULE_NAME, "[ERROR] raiseEvents -> codeName at Team not defined. Team = " + JSON.stringify(outputDataset.referenceParent.parentNode.parentNode.parentNode)); + logger.write(MODULE_NAME, "[ERROR] raiseEvents -> codeName at Data Mine not defined. Data Mine = " + JSON.stringify(outputDataset.referenceParent.parentNode.parentNode.parentNode)); callBackFunction(global.DEFAULT_FAIL_RESPONSE); return } } else { - logger.write(MODULE_NAME, "[ERROR] raiseEvents -> Bot not attached to a Team. Bot = " + JSON.stringify(outputDataset.referenceParent.parentNode.parentNode)); + logger.write(MODULE_NAME, "[ERROR] raiseEvents -> Bot not attached to a Data Mine. Bot = " + JSON.stringify(outputDataset.referenceParent.parentNode.parentNode)); callBackFunction(global.DEFAULT_FAIL_RESPONSE); return } @@ -76,14 +76,14 @@ /* All good, lets emit the event. */ - let devTeam = outputDataset.referenceParent.parentNode.parentNode.parentNode.code.codeName + let dataMine = outputDataset.referenceParent.parentNode.parentNode.parentNode.code.codeName let botName = outputDataset.referenceParent.parentNode.parentNode.code.codeName let product = outputDataset.referenceParent.parentNode.code.codeName let dataset = outputDataset.referenceParent.code.codeName let statusReport = statusDependencies.reportsByMainUtility.get("Self Reference") - key = devTeam + "-" + botName + "-" + product + "-" + dataset + key = dataMine + "-" + botName + "-" + product + "-" + dataset let event = { lastFile: statusReport.file.lastFile } diff --git a/Root.js b/Root.js index 72781d834..e008574e0 100644 --- a/Root.js +++ b/Root.js @@ -173,7 +173,7 @@ if (err.result !== global.DEFAULT_OK_RESPONSE.result) { console.log(logDisplace + "Root : [ERROR] start -> getBotConfigFromFile -> onInizialized -> onFileReceived -> err = " + JSON.stringify(err)); console.log(logDisplace + "Root : [ERROR] start -> getBotConfigFromFile -> onInizialized -> onFileReceived -> filePath = " + filePath); - console.log(logDisplace + "Root : [ERROR] start -> getBotConfigFromFile -> onInizialized -> onFileReceived -> team = " + global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.code.codeName); + console.log(logDisplace + "Root : [ERROR] start -> getBotConfigFromFile -> onInizialized -> onFileReceived -> dataMine = " + global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.code.codeName); return; } @@ -207,7 +207,7 @@ botConfig.DELETE_QUEUE_SIZE = 10 // This number represents how many log files can be at the queue at any point in time, which means how many logs are not still deleted. /* Simplifying the access to basic info */ - botConfig.devTeam = global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.code.codeName + botConfig.dataMine = global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.code.codeName /* This stuff is still hardcoded and unresolved. */ botConfig.version = { @@ -220,7 +220,7 @@ botConfig.loopCounter = 0; /* File Path Root */ - botConfig.filePathRoot = botConfig.devTeam + "/" + botConfig.codeName + "." + botConfig.version.major + "." + botConfig.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + botConfig.dataSetVersion; + botConfig.filePathRoot = botConfig.dataMine + "/" + botConfig.codeName + "." + botConfig.version.major + "." + botConfig.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + botConfig.dataSetVersion; /* Process Key */ botConfig.processKey = global.TASK_NODE.bot.processes[processIndex].name + '-' + global.TASK_NODE.bot.processes[processIndex].type + '-' + global.TASK_NODE.bot.processes[processIndex].id @@ -459,9 +459,9 @@ let botId; if (pYear !== undefined) { - botId = pBotConfig.devTeam + "." + pBotConfig.codeName + "." + pBotConfig.process + "." + pYear + "." + pMonth; + botId = pBotConfig.dataMine + "." + pBotConfig.codeName + "." + pBotConfig.process + "." + pYear + "." + pMonth; } else { - botId = pBotConfig.devTeam + "." + pBotConfig.codeName + "." + pBotConfig.process; + botId = pBotConfig.dataMine + "." + pBotConfig.codeName + "." + pBotConfig.process; } if (err.result === global.DEFAULT_OK_RESPONSE.result) { @@ -533,9 +533,9 @@ let botId; if (pYear !== undefined) { - botId = pBotConfig.devTeam + "." + pBotConfig.codeName + "." + pBotConfig.process + "." + pYear + "." + pMonth; + botId = pBotConfig.dataMine + "." + pBotConfig.codeName + "." + pBotConfig.process + "." + pYear + "." + pMonth; } else { - botId = pBotConfig.devTeam + "." + pBotConfig.codeName + "." + pBotConfig.process; + botId = pBotConfig.dataMine + "." + pBotConfig.codeName + "." + pBotConfig.process; } if (err.result === global.DEFAULT_OK_RESPONSE.result) { @@ -602,7 +602,7 @@ let botId; - botId = pBotConfig.devTeam + "." + pBotConfig.codeName + "." + pBotConfig.process; + botId = pBotConfig.dataMine + "." + pBotConfig.codeName + "." + pBotConfig.process; if (err.result === global.DEFAULT_OK_RESPONSE.result) { diff --git a/SensorBotProcessMainLoop.js b/SensorBotProcessMainLoop.js index 21c1c8fab..4adb52bd2 100644 --- a/SensorBotProcessMainLoop.js +++ b/SensorBotProcessMainLoop.js @@ -41,10 +41,10 @@ return } - let filePath = bot.devTeam + "/" + "bots" + "/" + bot.repo + "/" + pProcessConfig.codeName + let filePath = bot.dataMine + "/" + "bots" + "/" + bot.repo + "/" + pProcessConfig.codeName filePath += "/User.Bot.js" - fileStorage.getTextFile(bot.devTeam, filePath, onBotDownloaded); + fileStorage.getTextFile(bot.dataMine, filePath, onBotDownloaded); function onBotDownloaded(err, text) { @@ -61,10 +61,10 @@ } USER_BOT_MODULE.newUserBot = eval(text); // TODO This needs to be changed function - filePath = bot.devTeam + "/" + "bots" + "/" + bot.repo; + filePath = bot.dataMine + "/" + "bots" + "/" + bot.repo; filePath += "/Commons.js" - fileStorage.getTextFile(bot.devTeam, filePath, onCommonsDownloaded); + fileStorage.getTextFile(bot.dataMine, filePath, onCommonsDownloaded); function onCommonsDownloaded(err, text) { diff --git a/StatusDependencies.js b/StatusDependencies.js index 542e25eec..65a888955 100644 --- a/StatusDependencies.js +++ b/StatusDependencies.js @@ -155,9 +155,9 @@ let key; if (statusDependency.dependency.processRunMonthly === true && statusDependency.month !== undefined && statusDependency.year !== undefined) { - key = statusDependency.dependency.devTeam + "-" + statusDependency.dependency.bot + "-" + statusDependency.dependency.process + "-" + statusDependency.dependency.dataSetVersion + "-" + statusDependency.year + "-" + statusDependency.month; + key = statusDependency.dependency.dataMine + "-" + statusDependency.dependency.bot + "-" + statusDependency.dependency.process + "-" + statusDependency.dependency.dataSetVersion + "-" + statusDependency.year + "-" + statusDependency.month; } else { - key = statusDependency.dependency.devTeam + "-" + statusDependency.dependency.bot + "-" + statusDependency.dependency.process + "-" + statusDependency.dependency.dataSetVersion; + key = statusDependency.dependency.dataMine + "-" + statusDependency.dependency.bot + "-" + statusDependency.dependency.process + "-" + statusDependency.dependency.dataSetVersion; } thisObject.keys.push(key); diff --git a/StatusReport.js b/StatusReport.js index 76e30eace..12c63ac16 100644 --- a/StatusReport.js +++ b/StatusReport.js @@ -83,13 +83,13 @@ } if (statusDependencyNode.referenceParent.parentNode.parentNode.parentNode === undefined) { - logger.write(MODULE_NAME, "[ERROR] initialize -> Bot not attached to a Team. Bot = " + JSON.stringify(statusDependencyNode.referenceParent.parentNode.parentNode)); + logger.write(MODULE_NAME, "[ERROR] initialize -> Bot not attached to a Data Mine. Bot = " + JSON.stringify(statusDependencyNode.referenceParent.parentNode.parentNode)); callBackFunction(global.DEFAULT_FAIL_RESPONSE); return } if (statusDependencyNode.referenceParent.parentNode.parentNode.parentNode.code.codeName === undefined) { - logger.write(MODULE_NAME, "[ERROR] initialize -> Team witn no codeName defined. Team = " + JSON.stringify(statusDependencyNode.referenceParent.parentNode.parentNode.parentNode)); + logger.write(MODULE_NAME, "[ERROR] initialize -> Data Mine witn no codeName defined. Data Mine = " + JSON.stringify(statusDependencyNode.referenceParent.parentNode.parentNode.parentNode)); callBackFunction(global.DEFAULT_FAIL_RESPONSE); return } @@ -98,7 +98,7 @@ statusDependencyNode.bot = statusDependencyNode.referenceParent.parentNode.parentNode.code.codeName statusDependencyNode.process = statusDependencyNode.referenceParent.parentNode.code.codeName statusDependencyNode.bottype = statusDependencyNode.referenceParent.parentNode.parentNode.type - statusDependencyNode.devTeam = statusDependencyNode.referenceParent.parentNode.parentNode.parentNode.code.codeName + statusDependencyNode.dataMine = statusDependencyNode.referenceParent.parentNode.parentNode.parentNode.code.codeName /* Let's see if the process is run monthly or not. */ if (statusDependencyNode.referenceParent.parentNode.code.startMode !== undefined) { @@ -151,11 +151,11 @@ let fileName = "Status.Report." + global.MARKET.assetA + '_' + global.MARKET.assetB + ".json"; let filePath; - let ownerId = statusDependencyNode.devTeam + "-" + statusDependencyNode.bot + "-" + statusDependencyNode.botVersion.major + "-" + statusDependencyNode.botVersion.minor + "-" + statusDependencyNode.process + "-" + statusDependencyNode.dataSetVersion; - let botId = bot.devTeam + "-" + bot.codeName + "-" + bot.version.major + "-" + bot.version.minor + "-" + bot.process + "-" + bot.dataSetVersion; + let ownerId = statusDependencyNode.dataMine + "-" + statusDependencyNode.bot + "-" + statusDependencyNode.botVersion.major + "-" + statusDependencyNode.botVersion.minor + "-" + statusDependencyNode.process + "-" + statusDependencyNode.dataSetVersion; + let botId = bot.dataMine + "-" + bot.codeName + "-" + bot.version.major + "-" + bot.version.minor + "-" + bot.process + "-" + bot.dataSetVersion; if (ownerId !== botId) { - let rootPath = statusDependencyNode.devTeam + "/" + statusDependencyNode.bot + "." + statusDependencyNode.botVersion.major + "." + statusDependencyNode.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + statusDependencyNode.dataSetVersion; + let rootPath = statusDependencyNode.dataMine + "/" + statusDependencyNode.bot + "." + statusDependencyNode.botVersion.major + "." + statusDependencyNode.botVersion.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + statusDependencyNode.dataSetVersion; filePath = rootPath + "/Reports/" + sessionPath + statusDependencyNode.process + timePath; } else { filePath = bot.filePathRoot + "/Reports/" + sessionPath + statusDependencyNode.process + timePath; @@ -163,7 +163,7 @@ filePath += '/' + fileName - fileStorage.getTextFile(statusDependencyNode.devTeam, filePath, onFileReceived); + fileStorage.getTextFile(statusDependencyNode.dataMine, filePath, onFileReceived); function onFileReceived(err, text) { @@ -231,8 +231,8 @@ if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] save -> Entering function."); } - let ownerId = statusDependencyNode.devTeam + "-" + statusDependencyNode.bot + "-" + statusDependencyNode.botVersion.major + "-" + statusDependencyNode.botVersion.minor + "-" + statusDependencyNode.process + "-" + statusDependencyNode.dataSetVersion; - let botId = bot.devTeam + "-" + bot.codeName + "-" + bot.version.major + "-" + bot.version.minor + "-" + bot.process + "-" + bot.dataSetVersion; + let ownerId = statusDependencyNode.dataMine + "-" + statusDependencyNode.bot + "-" + statusDependencyNode.botVersion.major + "-" + statusDependencyNode.botVersion.minor + "-" + statusDependencyNode.process + "-" + statusDependencyNode.dataSetVersion; + let botId = bot.dataMine + "-" + bot.codeName + "-" + bot.version.major + "-" + bot.version.minor + "-" + bot.process + "-" + bot.dataSetVersion; if (ownerId !== botId && statusDependencyNode.process !== "Context") { // Context is a special case where the report is created by the Context.js module itself. @@ -251,7 +251,7 @@ filePath += '/' + fileName let fileContent = JSON.stringify(thisObject.file); - fileStorage.createTextFile(statusDependencyNode.devTeam, filePath, fileContent + '\n', onFileCreated); + fileStorage.createTextFile(statusDependencyNode.dataMine, filePath, fileContent + '\n', onFileCreated); function onFileCreated(err) { diff --git a/TradingBot.js b/TradingBot.js index c04bad9d1..d8cf1766c 100644 --- a/TradingBot.js +++ b/TradingBot.js @@ -221,11 +221,11 @@ let fileName = '' + market.assetA + '_' + market.assetB + '.json'; - let filePathRoot = bot.devTeam + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timePeriodLabel; filePath += '/' + fileName - fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated); + fileStorage.createTextFile(bot.dataMine, filePath, fileContent + '\n', onFileCreated); function onFileCreated(err) { @@ -299,11 +299,11 @@ fileContent = "[" + JSON.stringify(tradingSystem) + "," + fileContent + "]"; let fileName = '' + market.assetA + '_' + market.assetB + '.json'; - let filePathRoot = bot.devTeam + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + CONDITIONS_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timePeriodLabel; filePath += '/' + fileName - fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated); + fileStorage.createTextFile(bot.dataMine, filePath, fileContent + '\n', onFileCreated); function onFileCreated(err) { @@ -369,11 +369,11 @@ fileContent = "[" + fileContent + "]"; let fileName = '' + market.assetA + '_' + market.assetB + '.json'; - let filePathRoot = bot.devTeam + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + STRATEGIES_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timePeriodLabel; filePath += '/' + fileName - fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated); + fileStorage.createTextFile(bot.dataMine, filePath, fileContent + '\n', onFileCreated); function onFileCreated(err) { @@ -442,11 +442,11 @@ fileContent = "[" + fileContent + "]"; let fileName = '' + market.assetA + '_' + market.assetB + '.json'; - let filePathRoot = bot.devTeam + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + TRADES_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timePeriodLabel; filePath += '/' + fileName - fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated); + fileStorage.createTextFile(bot.dataMine, filePath, fileContent + '\n', onFileCreated); function onFileCreated(err) { @@ -568,11 +568,11 @@ let fileName = '' + market.assetA + '_' + market.assetB + '.json'; - let filePathRoot = bot.devTeam + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timePeriodLabel; filePath += '/' + fileName - fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated); + fileStorage.createTextFile(bot.dataMine, filePath, fileContent + '\n', onFileCreated); function onFileCreated(err) { @@ -675,11 +675,11 @@ let dateForPath = currentDay.getUTCFullYear() + '/' + utilities.pad(currentDay.getUTCMonth() + 1, 2) + '/' + utilities.pad(currentDay.getUTCDate(), 2); let fileName = '' + market.assetA + '_' + market.assetB + '.json'; - let filePathRoot = bot.devTeam + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timePeriodLabel + "/" + dateForPath; filePath += '/' + fileName - fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated); + fileStorage.createTextFile(bot.dataMine, filePath, fileContent + '\n', onFileCreated); function onFileCreated(err) { @@ -763,11 +763,11 @@ let dateForPath = currentDay.getUTCFullYear() + '/' + utilities.pad(currentDay.getUTCMonth() + 1, 2) + '/' + utilities.pad(currentDay.getUTCDate(), 2); let fileName = '' + market.assetA + '_' + market.assetB + '.json'; - let filePathRoot = bot.devTeam + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + CONDITIONS_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timePeriodLabel + "/" + dateForPath; filePath += '/' + fileName - fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated); + fileStorage.createTextFile(bot.dataMine, filePath, fileContent + '\n', onFileCreated); function onFileCreated(err) { @@ -840,11 +840,11 @@ let dateForPath = currentDay.getUTCFullYear() + '/' + utilities.pad(currentDay.getUTCMonth() + 1, 2) + '/' + utilities.pad(currentDay.getUTCDate(), 2); let fileName = '' + market.assetA + '_' + market.assetB + '.json'; - let filePathRoot = bot.devTeam + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + STRATEGIES_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timePeriodLabel + "/" + dateForPath; filePath += '/' + fileName - fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated); + fileStorage.createTextFile(bot.dataMine, filePath, fileContent + '\n', onFileCreated); function onFileCreated(err) { @@ -920,11 +920,11 @@ let dateForPath = currentDay.getUTCFullYear() + '/' + utilities.pad(currentDay.getUTCMonth() + 1, 2) + '/' + utilities.pad(currentDay.getUTCDate(), 2); let fileName = '' + market.assetA + '_' + market.assetB + '.json'; - let filePathRoot = bot.devTeam + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; + let filePathRoot = bot.dataMine + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion; let filePath = filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + TRADES_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + timePeriodLabel + "/" + dateForPath; filePath += '/' + fileName - fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated); + fileStorage.createTextFile(bot.dataMine, filePath, fileContent + '\n', onFileCreated); function onFileCreated(err) { diff --git a/TradingBotProcessMainLoop.js b/TradingBotProcessMainLoop.js index c4230dbde..9bf8b9926 100644 --- a/TradingBotProcessMainLoop.js +++ b/TradingBotProcessMainLoop.js @@ -53,10 +53,10 @@ bot.resumeExecution = processConfig.framework.startDate.resumeExecution // We are inherating this from root, but from here we need it at bot - let filePath = bot.devTeam + "/" + "bots" + "/" + bot.repo + "/" + pProcessConfig.codeName + let filePath = bot.dataMine + "/" + "bots" + "/" + bot.repo + "/" + pProcessConfig.codeName filePath += "/User.Bot.js" - fileStorage.getTextFile(bot.devTeam, filePath, onBotDownloaded); + fileStorage.getTextFile(bot.dataMine, filePath, onBotDownloaded); function onBotDownloaded(err, text) { @@ -72,10 +72,10 @@ //USER_BOT_MODULE.newUserBot = require(process.env.BOTS_PATH + '/aamasters/AAMasters/bots/AAJason-Trading-Engine-Bot/Multi-Period/User.Bot').newUserBot // Use this for a better debugging experience. You need to bring this js module to this folder in order to work. USER_BOT_MODULE.newUserBot = eval(text); // Use this for production - filePath = bot.devTeam + "/" + "bots" + "/" + bot.repo; + filePath = bot.dataMine + "/" + "bots" + "/" + bot.repo; filePath += "/Commons.js" - fileStorage.getTextFile(bot.devTeam, filePath, onCommonsDownloaded); + fileStorage.getTextFile(bot.dataMine, filePath, onCommonsDownloaded); function onCommonsDownloaded(err, text) { diff --git a/server.js b/server.js index c5be5c422..2f7e669ff 100644 --- a/server.js +++ b/server.js @@ -187,7 +187,7 @@ function bootLoader() { } if (global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode === undefined) { - console.log("[WARN] Task Server -> server -> bootLoader -> Bot Definition without parent Team. -> Bot Definition = " + JSON.stringify(global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode)); + console.log("[WARN] Task Server -> server -> bootLoader -> Bot Definition without parent Data Mine. -> Bot Definition = " + JSON.stringify(global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode)); continue } @@ -202,7 +202,7 @@ function bootLoader() { } if (global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.code.codeName === undefined) { - console.log("[WARN] Task Server -> server -> bootLoader -> Team without a codeName defined. -> Team Definition = " + JSON.stringify(global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode)); + console.log("[WARN] Task Server -> server -> bootLoader -> Data Mine without a codeName defined. -> Data Mine Definition = " + JSON.stringify(global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode)); continue }