This commit is contained in:
Luis Fernando Molina committed 2020-11-16 10:26:11 +01:00
1 parent d1f9ce3d2e
commit 411a8ca2d7
8 files changed
+52 -28

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
#PORT NUMBERS: If any of these ports are already in use by a different app, please pick a new number between 1 and 50000.
WEB_SERVER_PORT=34248
WEB_SOCKETS_SERVER_PORT=18041
HTTP_INTERFACE_PORT=34248
WEB_SOCKETS_INTERFACE_PORT=18041
# TASK MANAGER VARIABLES:
+7 -7
View File
@@ -1,4 +1,4 @@
exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVER, PROJECT_FILE_SERVER, WEB_APP_FILE_SERVER, PLUGIN_SERVER, CCXT_SERVER, WEB3_SERVER) {
exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVER, PROJECT_FILE_SERVER, UI_FILE_SERVER, PLUGIN_SERVER, CCXT_SERVER, WEB3_SERVER) {
let thisObject = {
initialize: initialize,
@@ -13,7 +13,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
CONSOLE_ERROR_LOG = process.env.CONSOLE_ERROR_LOG === 'true'
LOG_FILE_CONTENT = process.env.LOG_FILE_CONTENT === 'true'
let port = process.env.WEB_SERVER_PORT
let port = process.env.HTTP_INTERFACE_PORT
let http = require('http')
let isHttpServerStarted = false
@@ -43,7 +43,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
isHttpServerStarted = true
/* Starting the browser now is optional */
if (process.argv.includes("noBrowser")) {
console.log('Running Backend only with no UI.')
//Running Backend only with no UI.
} else {
open('http://localhost:' + port)
}
@@ -798,9 +798,9 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
try {
let fileContent = file.toString()
fileContent = fileContent.replace('WEB_SERVER_PORT', process.env.WEB_SERVER_PORT)
fileContent = fileContent.replace('WEB_SERVER_PORT', process.env.WEB_SERVER_PORT)
fileContent = fileContent.replace('WEB_SERVER_PORT', process.env.WEB_SERVER_PORT)
fileContent = fileContent.replace('HTTP_INTERFACE_PORT', process.env.HTTP_INTERFACE_PORT)
fileContent = fileContent.replace('HTTP_INTERFACE_PORT', process.env.HTTP_INTERFACE_PORT)
fileContent = fileContent.replace('HTTP_INTERFACE_PORT', process.env.HTTP_INTERFACE_PORT)
respondWithContent(fileContent, response, 'text/css')
} catch (err) {
console.log('[ERROR] httpInterface -> mainCSS -> File Not Found: ' + fileName + ' or Error = ' + err.stack)
@@ -822,7 +822,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
try {
let fileContent = file.toString()
fileContent = fileContent.replace('WEB_SERVER_PORT', process.env.WEB_SERVER_PORT)
fileContent = fileContent.replace('HTTP_INTERFACE_PORT', process.env.HTTP_INTERFACE_PORT)
respondWithContent(fileContent, response)
} catch (err) {
console.log('[ERROR] httpInterface -> homePage -> File Not Found: ' + fileName + ' or Error = ' + err.stack)
+20 -13
View File
@@ -46,7 +46,7 @@ global.CUSTOM_FAIL_RESPONSE = {
let WEB_SERVER = require('./webServer.js')
let DATA_FILE_SERVER = require('./dataFileServer.js')
let PROJECT_FILE_SERVER = require('./projectFileServer.js')
let WEB_APP_FILE_SERVER = require('./webAppFileServer.js')
let UI_FILE_SERVER = require('./uiFileServer.js')
let PLUGIN_SERVER = require('./pluginServer.js')
let EVENT_SERVER = require('./eventServer.js')
let TASK_MANAGER_SERVER = require('./taskManagerServer.js')
@@ -58,31 +58,34 @@ let WEB_SOCKETS_INTERFACE = require('./webSocketsServer.js')
let HTTP_INTERFACE = require('./httpInterface.js')
try {
console.log('CLIENT SERVERS:')
console.log('')
WEB_SERVER = WEB_SERVER.newWebServer()
WEB_SERVER.initialize()
WEB_SERVER.run()
console.log('Web Server ......................... Started')
DATA_FILE_SERVER = DATA_FILE_SERVER.newDataFileServer()
DATA_FILE_SERVER.initialize()
DATA_FILE_SERVER.run()
console.log('Data File Server ................... Started')
UI_FILE_SERVER = UI_FILE_SERVER.newUIFileServer()
UI_FILE_SERVER.initialize()
UI_FILE_SERVER.run()
console.log('UI File Server ..................... Started')
PROJECT_FILE_SERVER = PROJECT_FILE_SERVER.newProjectFileServer()
PROJECT_FILE_SERVER.initialize()
PROJECT_FILE_SERVER.run()
console.log('Project File Server ................ Started')
WEB_APP_FILE_SERVER = WEB_APP_FILE_SERVER.newWebAppFileServer()
WEB_APP_FILE_SERVER.initialize()
WEB_APP_FILE_SERVER.run()
console.log('Web App File Server ................ Started')
PLUGIN_SERVER = PLUGIN_SERVER.newPluginServer()
PLUGIN_SERVER.initialize()
PLUGIN_SERVER.run()
console.log('Plugin Server ...................... Started')
DATA_FILE_SERVER = DATA_FILE_SERVER.newDataFileServer()
DATA_FILE_SERVER.initialize()
DATA_FILE_SERVER.run()
console.log('Data File Server ................... Started')
EVENT_SERVER = EVENT_SERVER.newEventServer()
EVENT_SERVER.initialize()
EVENT_SERVER.run()
@@ -103,15 +106,19 @@ try {
WEB3_SERVER.run()
console.log('WEB3 Server ........................ Started')
console.log('')
console.log('CLIENT INTERFACES:')
console.log('')
WEB_SOCKETS_INTERFACE = WEB_SOCKETS_INTERFACE.newWebSocketsInterface(EVENT_SERVER)
WEB_SOCKETS_INTERFACE.initialize()
WEB_SOCKETS_INTERFACE.run()
console.log('Web Sockets Interface .............. Started')
console.log('Web Sockets Interface .............. Listening at port ' + process.env.WEB_SOCKETS_INTERFACE_PORT)
HTTP_INTERFACE = HTTP_INTERFACE.newHttpInterface(WEB_SERVER, DATA_FILE_SERVER, PROJECT_FILE_SERVER, WEB_APP_FILE_SERVER, PLUGIN_SERVER, CCXT_SERVER, WEB3_SERVER)
HTTP_INTERFACE = HTTP_INTERFACE.newHttpInterface(WEB_SERVER, DATA_FILE_SERVER, PROJECT_FILE_SERVER, UI_FILE_SERVER, PLUGIN_SERVER, CCXT_SERVER, WEB3_SERVER)
HTTP_INTERFACE.initialize()
HTTP_INTERFACE.run()
console.log('Http Interface ..................... Started')
console.log('Http Interface ..................... Listening at port ' + process.env.HTTP_INTERFACE_PORT)
console.log('')
console.log("You are running Superalgos Beta 7")
@@ -1,6 +1,6 @@
exports.newWebAppFileServer = function newWebAppFileServer() {
exports.newUIFileServer = function newUIFileServer() {
const MODULE = "Web App File Server"
const MODULE = "UI File Server"
let thisObject = {
initialize: initialize,
+1 -1
View File
@@ -12,7 +12,7 @@
require('dotenv').config()
const WEB_SOCKET = require('ws')
let socketServer
let port = process.env.WEB_SOCKETS_SERVER_PORT
let port = process.env.WEB_SOCKETS_INTERFACE_PORT
return thisObject
@@ -99,7 +99,7 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, FILE_S
let http = require('http');
let url = 'http://' + process.env.WEB_SERVER_URL +
':' + process.env.WEB_SERVER_PORT +
':' + process.env.HTTP_INTERFACE_PORT +
'/Webhook/Fetch-Messages/' +
bot.exchange + "/" +
bot.market.baseAsset + "-" + bot.market.quotedAsset
+1 -1
View File
@@ -24,7 +24,7 @@
host = 'localhost'
}
if (port === undefined) {
port = process.env.WEB_SOCKETS_SERVER_PORT
port = process.env.WEB_SOCKETS_INTERFACE_PORT
}
let messageCounter = 0
+18 -1
View File
@@ -32,6 +32,11 @@ if (
return
}
console.log('')
console.log('OPTIONS ACCEPTED:')
console.log('')
let optionsAccepted = 0
let options = {
execArgv: ['--max-old-space-size=8192'],
stdio: 'inherit'
@@ -41,8 +46,20 @@ if (process.argv.includes("minMemo")) {
options = {
stdio: 'inherit'
}
console.log('Running with Minimun Memory Required.')
optionsAccepted++
console.log('minMemo ............................ Running with Minimun Required Memory.')
}
if (process.argv.includes("noBrowser")) {
optionsAccepted++
console.log('noBrowser .......................... Running without User Interface.')
}
if (optionsAccepted === 0) {
console.log('none ............................... Running without any command line options.')
}
console.log('')
const { fork } = require('child_process')
fork('./Client/server.js', process.argv, options)