diff --git a/.vs/AACloudPlatform/v15/.suo b/.vs/AACloudPlatform/v15/.suo index 56a728b49..d717665d2 100644 Binary files a/.vs/AACloudPlatform/v15/.suo and b/.vs/AACloudPlatform/v15/.suo differ diff --git a/Azure File Storage.js b/Azure File Storage.js index fd6b436ea..cab5ac8be 100644 --- a/Azure File Storage.js +++ b/Azure File Storage.js @@ -8,7 +8,6 @@ exports.newAzureFileStorage = function newAzureFileStorage(BOT) { const MODULE_NAME = "Azure File Storage"; - var fs = require('fs'); var util = require('util'); var guid = require('node-uuid'); var crypto = require('crypto'); @@ -59,15 +58,16 @@ exports.newAzureFileStorage = function newAzureFileStorage(BOT) { function readConfig() { try { - - return JSON.parse(fs.readFileSync(ROOT_DIR + dataOwner + '.azure.storage.connstring', 'utf8')); - + let fs = require('fs'); + let filePath = '../' + 'Connection-Strings' + '/' + global.RUNNING_MODE + '/' + dataOwner + '.azure.storage.connstring' + '.json'; + return JSON.parse(fs.readFileSync(filePath, 'utf8')); } catch (err) { - const logText = "[ERROR] 'readConfig' - ERROR : " + err.message; - logger.write(logText); + logger.write("[ERROR] readConfig -> err = " + err.message); + logger.write("[HINT] You need to have a file at this path -> " + filePath); + logger.write("[HINT] The file must have the connection string to the Azure Storage Account. Request the file to an AA Team Member if you dont have it."); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); } - } function createFolder(folderPath, callBackFunction) { diff --git a/ExchangeAPI.js b/ExchangeAPI.js index 7497135cb..89ee69159 100644 --- a/ExchangeAPI.js +++ b/ExchangeAPI.js @@ -42,7 +42,7 @@ try { let fs = require('fs'); - let filePath = '../' + 'API-Keys' + '/' + EXCHANGE_NAME + '.json'; + let filePath = '../' + 'API-Keys' + '/' + bot.codeName + '.' + EXCHANGE_NAME + '.json'; return JSON.parse(fs.readFileSync(filePath, 'utf8')); } catch (err) { diff --git a/Run.js b/Run.js index 5473b2272..dba394ec0 100644 --- a/Run.js +++ b/Run.js @@ -1,6 +1,10 @@  const LOG_INFO = true; +/* The following global variable tells the system if it is running on test mode or production. */ + +global.RUNNING_MODE = 'Testnet'; // or 'Production' + /* First thing to do is to read the config and guess which bot we will be running. */ var fs = require('fs');