diff --git a/.vs/AACloud/v15/.suo b/.vs/AACloud/v15/.suo index fcee3c097..d74108c89 100644 Binary files a/.vs/AACloud/v15/.suo and b/.vs/AACloud/v15/.suo differ diff --git a/Blob Storage.js b/Blob Storage.js index 4d6ab16c4..32b22b57d 100644 --- a/Blob Storage.js +++ b/Blob Storage.js @@ -1,5 +1,5 @@  -exports.newFileStorage = function newFileStorage(BOT) { +exports.newBlobStorage = function newBlobStorage(BOT) { const FULL_LOG = true; const LOG_FILE_CONTENT = false; @@ -34,18 +34,18 @@ exports.newFileStorage = function newFileStorage(BOT) { return thisObject; - function initialize(pDataOwnerBotCodeName, callBackFunction) { + function initialize(pDataOwner, callBackFunction) { try { - if (pDataOwnerBotCodeName === undefined) { - dataOwner = bot.codeName; + if (pDataOwner === undefined) { + dataOwner = bot.devTeam; + logger.fileName = MODULE_NAME + '.' + bot.devTeam + '.' + bot.codeName; } else { - dataOwner = pDataOwnerBotCodeName; + dataOwner = pDataOwner.devTeam; + logger.fileName = MODULE_NAME + '.' + pDataOwner.devTeam + '.' + pDataOwner.bot; } - logger.fileName = MODULE_NAME + '.' + dataOwner; - if (FULL_LOG === true) { logger.write("[INFO] initialize -> Entering function."); } readConnectionStringConfigFile(onConnectionStringReady); diff --git a/Context.js b/Context.js index 51b246cbe..242eca792 100644 --- a/Context.js +++ b/Context.js @@ -1,4 +1,4 @@ -exports.newContext = function newContext(BOT, DEBUG_MODULE, FILE_STORAGE, UTILITIES, STATUS_REPORT) { +exports.newContext = function newContext(BOT, DEBUG_MODULE, BLOB_STORAGE, UTILITIES, STATUS_REPORT) { const FULL_LOG = true; const LOG_FILE_CONTENT = false; @@ -74,7 +74,7 @@ /* Storage account to be used here. */ - let cloudStorage = FILE_STORAGE.newFileStorage(bot); + let cloudStorage = BLOB_STORAGE.newBlobStorage(bot); let dependencies; @@ -97,7 +97,7 @@ function initializeStorage() { - cloudStorage.initialize(bot.codeName, onInizialized); + cloudStorage.initialize(bot, onInizialized); function onInizialized(err) { diff --git a/Datasource.js b/Datasource.js index b03af1daa..8fdd9dbc0 100644 --- a/Datasource.js +++ b/Datasource.js @@ -1,4 +1,4 @@ -exports.newDatasource = function newDatasource(BOT, DEBUG_MODULE, FILE_STORAGE, UTILITIES) { +exports.newDatasource = function newDatasource(BOT, DEBUG_MODULE, BLOB_STORAGE, UTILITIES) { const FULL_LOG = true; @@ -24,8 +24,8 @@ logger.fileName = MODULE_NAME; logger.bot = bot; - let oliviaAzureFileStorage = FILE_STORAGE.newFileStorage(bot); - let tomAzureFileStorage = FILE_STORAGE.newFileStorage(bot); + let oliviaStorage = BLOB_STORAGE.newBlobStorage(bot); + let tomStorage = BLOB_STORAGE.newBlobStorage(bot); /* Utilities needed. */ @@ -45,7 +45,7 @@ if (FULL_LOG === true) { logger.write("[INFO] initializeOliviaStorage -> Entering function."); } - oliviaAzureFileStorage.initialize("AAOlivia", onInizialized); + oliviaStorage.initialize({ bot: "AAOlivia", devTeam: "AAMasters" }, onInizialized); function onInizialized(err) { if (err.result === global.DEFAULT_OK_RESPONSE.result) { @@ -61,7 +61,7 @@ if (FULL_LOG === true) { logger.write("[INFO] initializeTomStorage -> Entering function."); } - tomAzureFileStorage.initialize("AATom", onInizialized); + tomStorage.initialize({ bot: "AATom", devTeam: "AAMasters" }, onInizialized); function onInizialized(err) { if (err.result === global.DEFAULT_OK_RESPONSE.result) { @@ -129,7 +129,7 @@ let periodTime = global.marketFilesPeriods[i][0]; let periodName = global.marketFilesPeriods[i][1]; - getFile(oliviaAzureFileStorage, "@AssetA_@AssetB.json", "@Exchange/Output/Candles/Multi-Period-Market/@Period", periodName, undefined, onFileReceived, callBack); + getFile(oliviaStorage, "@AssetA_@AssetB.json", "@Exchange/Output/Candles/Multi-Period-Market/@Period", periodName, undefined, onFileReceived, callBack); function onFileReceived(err, file) { @@ -175,7 +175,7 @@ let periodTime = global.dailyFilePeriods[i][0]; let periodName = global.dailyFilePeriods[i][1]; - getFile(oliviaAzureFileStorage, "@AssetA_@AssetB.json", "@Exchange/Output/Candles/Multi-Period-Daily/@Period/@Year/@Month/@Day", periodName, bot.processDatetime, onFileReceived, callBack); + getFile(oliviaStorage, "@AssetA_@AssetB.json", "@Exchange/Output/Candles/Multi-Period-Daily/@Period/@Year/@Month/@Day", periodName, bot.processDatetime, onFileReceived, callBack); function onFileReceived(err, file) { @@ -308,7 +308,7 @@ let periodTime = global.marketFilesPeriods[i][0]; let periodName = global.marketFilesPeriods[i][1]; - getFile(tomAzureFileStorage, "@AssetA_@AssetB.json", "@Exchange/Tom/dataSet.V1/Output/Candle-Stairs/Multi-Period-Market/@Period", periodName, undefined, onFileReceived, callBack); + getFile(tomStorage, "@AssetA_@AssetB.json", "@Exchange/Tom/dataSet.V1/Output/Candle-Stairs/Multi-Period-Market/@Period", periodName, undefined, onFileReceived, callBack); function onFileReceived(err, file) { @@ -354,7 +354,7 @@ let periodTime = global.dailyFilePeriods[i][0]; let periodName = global.dailyFilePeriods[i][1]; - getFile(tomAzureFileStorage, "@AssetA_@AssetB.json", "@Exchange/Tom/dataSet.V1/Output/Candle-Stairs/Multi-Period-Daily/@Period/@Year/@Month/@Day", periodName, bot.processDatetime, onFileReceived, callBack); + getFile(tomStorage, "@AssetA_@AssetB.json", "@Exchange/Tom/dataSet.V1/Output/Candle-Stairs/Multi-Period-Daily/@Period/@Year/@Month/@Day", periodName, bot.processDatetime, onFileReceived, callBack); function onFileReceived(err, file) { diff --git a/Dependencies.js b/Dependencies.js index 7d4db3bbb..580a66e08 100644 --- a/Dependencies.js +++ b/Dependencies.js @@ -1,4 +1,4 @@ -exports.newDependencies = function newDependencies(BOT, DEBUG_MODULE, STATUS_REPORT, FILE_STORAGE, UTILITIES) { +exports.newDependencies = function newDependencies(BOT, DEBUG_MODULE, STATUS_REPORT, BLOB_STORAGE, UTILITIES) { const FULL_LOG = true; const LOG_FILE_CONTENT = false; @@ -42,7 +42,7 @@ for (let i = 0; i < pDependenciesConfig.length; i++) { - let statusReportModule = STATUS_REPORT.newStatusReport(BOT, DEBUG_MODULE, FILE_STORAGE, UTILITIES); + let statusReportModule = STATUS_REPORT.newStatusReport(BOT, DEBUG_MODULE, BLOB_STORAGE, UTILITIES); statusReportModule.initialize(pDependenciesConfig[i], pMonth, pYear, onInitilized); diff --git a/Extraction Bot Main Loop.js b/Extraction Bot Main Loop.js index 62f2129c6..d344a0da4 100644 --- a/Extraction Bot Main Loop.js +++ b/Extraction Bot Main Loop.js @@ -63,7 +63,7 @@ /* We define here all the modules that the rest of the infraestructure, including the bots themselves can consume. */ const UTILITIES = require(ROOT_DIR + 'Utilities'); - const FILE_STORAGE = require(ROOT_DIR + 'File Storage'); + const BLOB_STORAGE = require(ROOT_DIR + 'Blob Storage'); const DEBUG_MODULE = require(ROOT_DIR + 'Debug Log'); const STATUS_REPORT = require(ROOT_DIR + 'Status Report'); const POLONIEX_CLIENT_MODULE = require(ROOT_DIR + 'Poloniex API Client'); @@ -86,7 +86,7 @@ if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeDependencies -> Entering function."); } - dependencies = DEPENDENCIES.newDependencies(bot, DEBUG_MODULE, STATUS_REPORT, FILE_STORAGE, UTILITIES); + dependencies = DEPENDENCIES.newDependencies(bot, DEBUG_MODULE, STATUS_REPORT, BLOB_STORAGE, UTILITIES); dependencies.initialize(processConfig.dependencies, pMonth, pYear, onInizialized); @@ -117,7 +117,7 @@ if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeUserBot -> Entering function."); } - usertBot = USER_BOT_MODULE.newUserBot(bot, COMMONS_MODULE, UTILITIES, DEBUG_MODULE, FILE_STORAGE, STATUS_REPORT, POLONIEX_CLIENT_MODULE); + usertBot = USER_BOT_MODULE.newUserBot(bot, COMMONS_MODULE, UTILITIES, DEBUG_MODULE, BLOB_STORAGE, STATUS_REPORT, POLONIEX_CLIENT_MODULE); usertBot.initialize(dependencies, pMonth, pYear, onInizialized); diff --git a/Indicator Bot Main Loop.js b/Indicator Bot Main Loop.js index 34ab73660..8c2497ddc 100644 --- a/Indicator Bot Main Loop.js +++ b/Indicator Bot Main Loop.js @@ -63,7 +63,7 @@ /* We define here all the modules that the rest of the infraestructure, including the bots themselves can consume. */ const UTILITIES = require(ROOT_DIR + 'Utilities'); - const FILE_STORAGE = require(ROOT_DIR + 'File Storage'); + const BLOB_STORAGE = require(ROOT_DIR + 'Blob Storage'); const DEBUG_MODULE = require(ROOT_DIR + 'Debug Log'); const STATUS_REPORT = require(ROOT_DIR + 'Status Report'); const DEPENDENCIES = require(ROOT_DIR + 'Dependencies'); @@ -85,7 +85,7 @@ if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeDependencies -> Entering function."); } - dependencies = DEPENDENCIES.newDependencies(bot, DEBUG_MODULE, STATUS_REPORT, FILE_STORAGE, UTILITIES); + dependencies = DEPENDENCIES.newDependencies(bot, DEBUG_MODULE, STATUS_REPORT, BLOB_STORAGE, UTILITIES); dependencies.initialize(processConfig.dependencies, pMonth, pYear, onInizialized); @@ -116,7 +116,7 @@ if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeUserBot -> Entering function."); } - usertBot = USER_BOT_MODULE.newUserBot(bot, COMMONS_MODULE, UTILITIES, DEBUG_MODULE, FILE_STORAGE); + usertBot = USER_BOT_MODULE.newUserBot(bot, COMMONS_MODULE, UTILITIES, DEBUG_MODULE, BLOB_STORAGE, BLOB_STORAGE); usertBot.initialize(dependencies, pMonth, pYear, onInizialized); diff --git a/Status Report.js b/Status Report.js index 8d8ba7a8b..5e8419bce 100644 --- a/Status Report.js +++ b/Status Report.js @@ -1,4 +1,4 @@ -exports.newStatusReport = function newStatusReport(BOT, DEBUG_MODULE, FILE_STORAGE, UTILITIES) { +exports.newStatusReport = function newStatusReport(BOT, DEBUG_MODULE, BLOB_STORAGE, UTILITIES) { const FULL_LOG = true; const LOG_FILE_CONTENT = false; @@ -34,7 +34,7 @@ /* Storage account to be used here. */ - let cloudStorage = FILE_STORAGE.newFileStorage(bot); + let cloudStorage = BLOB_STORAGE.newBlobStorage(bot); let month; let year; @@ -66,7 +66,7 @@ function initializeStorage() { - cloudStorage.initialize(owner.bot, onInizialized); + cloudStorage.initialize(owner, onInizialized); function onInizialized(err) { diff --git a/Trading Bot Main Loop.js b/Trading Bot Main Loop.js index 9f4c2dfac..b20d17cd7 100644 --- a/Trading Bot Main Loop.js +++ b/Trading Bot Main Loop.js @@ -63,7 +63,7 @@ /* We define here all the modules that the rest of the infraestructure, including the bots themselves can consume. */ const UTILITIES = require(ROOT_DIR + 'Utilities'); - const FILE_STORAGE = require(ROOT_DIR + 'File Storage'); + const BLOB_STORAGE = require(ROOT_DIR + 'Blob Storage'); const DEBUG_MODULE = require(ROOT_DIR + 'Debug Log'); const POLONIEX_CLIENT_MODULE = require(ROOT_DIR + 'Poloniex API Client'); const EXCHANGE_API = require(ROOT_DIR + 'ExchangeAPI'); @@ -94,7 +94,7 @@ if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeDependencies -> Entering function."); } - dependencies = DEPENDENCIES.newDependencies(bot, DEBUG_MODULE, STATUS_REPORT, FILE_STORAGE, UTILITIES); + dependencies = DEPENDENCIES.newDependencies(bot, DEBUG_MODULE, STATUS_REPORT, BLOB_STORAGE, UTILITIES); dependencies.initialize(processConfig.dependencies, undefined, undefined, onInizialized); @@ -125,7 +125,7 @@ if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeContext -> Entering function."); } - context = CONTEXT.newContext(bot, DEBUG_MODULE, FILE_STORAGE, UTILITIES, STATUS_REPORT); + context = CONTEXT.newContext(bot, DEBUG_MODULE, BLOB_STORAGE, UTILITIES, STATUS_REPORT); context.initialize(dependencies, onInizialized); function onInizialized(err) { @@ -155,7 +155,7 @@ if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeDatasource -> Entering function."); } - datasource = DATASOURCE.newDatasource(bot, DEBUG_MODULE, FILE_STORAGE, UTILITIES); + datasource = DATASOURCE.newDatasource(bot, DEBUG_MODULE, BLOB_STORAGE, UTILITIES); datasource.initialize(onInizialized); function onInizialized(err) { diff --git a/this.config.json b/this.config.json index d98f6a7ca..8888b3e01 100644 --- a/this.config.json +++ b/this.config.json @@ -35,10 +35,15 @@ "enabled": "true", "botPath": "../Bots/AAMasters/AACharly-Extraction-Bot", "process": "Poloniex-Live-Trades" + }, + { + "enabled": "false", + "botPath": "../Bots/AAMasters/AAMiguel-Indicator-Bot", + "process": "Trades-Files-To-Blobs" } ], "stopGracefully": "false", "exchangeSimulationMode": "false", - "storageConnStringFolder": "Testnet", + "storageConnStringFolder": "Production", "maxLogLoops": 5 } \ No newline at end of file