diff --git a/.vscode/Desktop-App-1.code-workspace b/.vscode/Desktop-App-1.code-workspace new file mode 100644 index 000000000..97e2d4c8f --- /dev/null +++ b/.vscode/Desktop-App-1.code-workspace @@ -0,0 +1,10 @@ +{ + "folders": [ + { + "path": "C:\\Superalgos" + } + ], + "settings": { + "search.maintainFileSearchCache": true + } +} \ No newline at end of file diff --git a/.vscode/Desktop-App-2.code-workspace b/.vscode/Desktop-App-2.code-workspace new file mode 100644 index 000000000..97e2d4c8f --- /dev/null +++ b/.vscode/Desktop-App-2.code-workspace @@ -0,0 +1,10 @@ +{ + "folders": [ + { + "path": "C:\\Superalgos" + } + ], + "settings": { + "search.maintainFileSearchCache": true + } +} \ No newline at end of file diff --git a/.vscode/Desktop-App-3.code-workspace b/.vscode/Desktop-App-3.code-workspace new file mode 100644 index 000000000..97e2d4c8f --- /dev/null +++ b/.vscode/Desktop-App-3.code-workspace @@ -0,0 +1,10 @@ +{ + "folders": [ + { + "path": "C:\\Superalgos" + } + ], + "settings": { + "search.maintainFileSearchCache": true + } +} \ No newline at end of file diff --git a/Desktop/DesktopApp.js b/Desktop/DesktopApp.js index 5da36f492..ad3aa22dd 100644 --- a/Desktop/DesktopApp.js +++ b/Desktop/DesktopApp.js @@ -17,8 +17,8 @@ exports.newDesktopApp = function newDesktopApp() { async function run() { - setupNetwork() - setupServices() + await setupNetwork() + await setupServices() async function setupNetwork() { /* @@ -59,11 +59,11 @@ exports.newDesktopApp = function newDesktopApp() { */ thisObject.webSocketsInterface = DK.projects.socialTrading.modules.webSocketsInterface.newDesktopModulesWebSocketsInterface() thisObject.webSocketsInterface.initialize() - console.log('Desktop Client Web Sockets Interface ....................................... Listening at port ' + global.env.DESKTOP_WEB_SOCKETS_INTERFACE_PORT) + console.log('Desktop Client Web Sockets Interface ......................................... Listening at port ' + JSON.parse(DK.desktopApp.p2pNetworkClient.node.config).webSocketsPort) thisObject.httpInterface = DK.projects.socialTrading.modules.httpInterface.newDesktopModulesHttpInterface() thisObject.httpInterface.initialize() - console.log('Desktop Client Http Interface .............................................. Listening at port ' + global.env.DESKTOP_HTTP_INTERFACE_PORT) + console.log('Desktop Client Http Interface ................................................ Listening at port ' + JSON.parse(DK.desktopApp.p2pNetworkClient.node.config).webPort) } } } diff --git a/Desktop/UI/Globals.js b/Desktop/UI/Globals.js index 4599bca36..2c5646491 100644 --- a/Desktop/UI/Globals.js +++ b/Desktop/UI/Globals.js @@ -4,6 +4,7 @@ let UI = { projects: {}, schemas: { projectSchema: undefined }, environment: undefined, + clientNode: undefined, running: {} } diff --git a/Desktop/UI/WebAppPreLoader.js b/Desktop/UI/WebAppPreLoader.js index 0c691e566..548e3da05 100644 --- a/Desktop/UI/WebAppPreLoader.js +++ b/Desktop/UI/WebAppPreLoader.js @@ -22,6 +22,15 @@ function loadSuperalgos() { function onResponse(err, file) { UI.environment = JSON.parse(file) + setupClientNode() + } + } + + function setupClientNode() { + httpRequest(undefined, 'ClientNode', onResponse) + + function onResponse(err, file) { + UI.clientNode = JSON.parse(file) setupProjectsSchema() } } diff --git a/DesktopRoot.js b/DesktopRoot.js index ee7267baf..5a95acdf1 100644 --- a/DesktopRoot.js +++ b/DesktopRoot.js @@ -10,7 +10,7 @@ exports.newDesktopRoot = function newDesktopRoot() { return thisObject - async function run() { + async function run(debugSettings) { /* The DK object is accessible everywhere at the Superalgos Desktop App. It provides access to all modules built for this App. @@ -25,6 +25,10 @@ exports.newDesktopRoot = function newDesktopRoot() { let ENVIRONMENT = require('./Environment.js'); let ENVIRONMENT_MODULE = ENVIRONMENT.newEnvironment() global.env = ENVIRONMENT_MODULE + + if (debugSettings !== undefined && debugSettings.DESKTOP_APP_SIGNING_ACCOUNT !== undefined) { + global.env.DESKTOP_APP_SIGNING_ACCOUNT = debugSettings.DESKTOP_APP_SIGNING_ACCOUNT + } /* First thing is to load the project schema file. */ diff --git a/Environment.js b/Environment.js index eadf95fe3..311a33c80 100644 --- a/Environment.js +++ b/Environment.js @@ -12,11 +12,11 @@ exports.newEnvironment = function () { BASE_PATH: basePath, WEB_SERVER_URL: 'localhost', PLATFORM_WEB_SOCKETS_INTERFACE_PORT: 18041, - DESKTOP_WEB_SOCKETS_INTERFACE_PORT: 17042, - NETWORK_WEB_SOCKETS_INTERFACE_PORT: 18042, + NETWORK_WEB_SOCKETS_INTERFACE_PORT: 17041, + DESKTOP_WEB_SOCKETS_INTERFACE_PORT: 16041, DESKTOP_WEB_SOCKETS_INTERFACE_HOST: 'localhost', PLATFORM_HTTP_INTERFACE_PORT: 34248, - DESKTOP_HTTP_INTERFACE_PORT: 34249, + DESKTOP_HTTP_INTERFACE_PORT: 33248, PATH_TO_DATA_STORAGE: path.join(basePath, './Platform/My-Data-Storage'), PATH_TO_PROJECTS: path.join(basePath, './Projects'), PATH_TO_LOG_FILES: path.join(basePath, './Platform/My-Log-Files'), diff --git a/Network/NetwokNode.js b/Network/NetwokNode.js index 8edc1c6f4..4bd5f705c 100644 --- a/Network/NetwokNode.js +++ b/Network/NetwokNode.js @@ -64,7 +64,7 @@ exports.newNetworkNode = function newNetworkNode() { */ thisObject.webSocketsInterface = NT.projects.network.modules.webSocketsInterface.newNetworkModulesWebSocketsInterface() thisObject.webSocketsInterface.initialize() - console.log('Network Node Web Sockets Interface ....................................... Listening at port ' + JSON.parse(NT.networkNode.p2pNetworkNode.node.config).webSocketsPort) + console.log('Network Node Web Sockets Interface ........................................... Listening at port ' + JSON.parse(NT.networkNode.p2pNetworkNode.node.config).webSocketsPort) } } } diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 8b9800284..14668a46b 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -17012,17 +17012,17 @@ "signingAccountChild": { "type": "Social Trading Desktop App", "name": "Social Trading Desktop App # 1", - "config": "{\n \"codeName\": \"Social-Trading-Desktop-App-1\"\n}", + "config": "{\n \"codeName\": \"Social-Trading-Desktop-App-1\",\n \"host\": \"localhost\",\n \"webPort\": \"33248\",\n \"webSocketsPort\": \"17042\"\n}", "project": "Governance", "id": "012c74dd-1a61-4784-bc8a-e18555b4974e", "savedPayload": { "position": { - "x": 32588.466416509047, - "y": 18618.508094196695 + "x": 32596.44477289305, + "y": 18664.939393355322 }, "targetPosition": { - "x": 32885.89987492119, - "y": 18579.35023653068 + "x": 32889.88905311319, + "y": 18602.565886109995 }, "floatingObject": { "isPinned": false, @@ -17040,8 +17040,8 @@ "id": "3863ebb9-c69f-40b2-8bbd-eb8f2b60a49c", "savedPayload": { "position": { - "x": 32885.89987492119, - "y": 18579.35023653068 + "x": 32889.88905311319, + "y": 18602.565886109995 }, "targetPosition": { "x": 33183.333333333336, @@ -17068,17 +17068,17 @@ "signingAccountChild": { "type": "Social Trading Mobile App", "name": "Social Trading Mobile App # 1", - "config": "{\n \"codeName\": \"Social-Trading-Mobile-App-1\"\n}", + "config": "{\n \"codeName\": \"Social-Trading-Mobile-App-1\",\n \"host\": \"localhost\",\n \"webSocketsPort\": \"15042\"\n}", "project": "Governance", "id": "2d03d11f-b553-4b01-9291-9e13da15dd54", "savedPayload": { "position": { - "x": 32603.777837559894, - "y": 18384.900951803153 + "x": 32586.62019611237, + "y": 18477.475300904072 }, "targetPosition": { - "x": 32893.555585446615, - "y": 18462.54666533391 + "x": 32884.97676472285, + "y": 18508.83383988437 }, "floatingObject": { "isPinned": false, @@ -17096,8 +17096,8 @@ "id": "c84e9e64-7527-4dec-ac58-93696e19a756", "savedPayload": { "position": { - "x": 32893.555585446615, - "y": 18462.54666533391 + "x": 32884.97676472285, + "y": 18508.83383988437 }, "targetPosition": { "x": 33183.333333333336, @@ -17124,17 +17124,17 @@ "signingAccountChild": { "type": "Social Trading Server App", "name": "Social Trading Server App # 1", - "config": "{\n \"codeName\": \"Social-Trading-Server-App-1\"\n}", + "config": "{\n \"codeName\": \"Social-Trading-Server-App-1\",\n \"host\": \"localhost\",\n \"webSocketsPort\": \"16042\"\n}", "project": "Governance", "id": "c3d218ee-119f-4bd9-9349-8a194844ecd9", "savedPayload": { "position": { - "x": 32707.321329158593, - "y": 18174.935521459432 + "x": 32635.20605874777, + "y": 18296.15039301919 }, "targetPosition": { - "x": 32945.327331245964, - "y": 18357.56395016205 + "x": 32909.26969604055, + "y": 18418.17138594193 }, "floatingObject": { "isPinned": false, @@ -17152,8 +17152,8 @@ "id": "75f17a55-bf33-4e69-b842-b424a6f517e8", "savedPayload": { "position": { - "x": 32945.327331245964, - "y": 18357.56395016205 + "x": 32909.26969604055, + "y": 18418.17138594193 }, "targetPosition": { "x": 33183.333333333336, @@ -17185,12 +17185,12 @@ "id": "bcffb701-754d-4685-ad09-8bf3f09265d9", "savedPayload": { "position": { - "x": 32883.333333333336, - "y": 18020.577136594 + "x": 32737.446438046896, + "y": 18138.71401504935 }, "targetPosition": { - "x": 33033.333333333336, - "y": 18280.384757729335 + "x": 32960.389885690114, + "y": 18339.45319695701 }, "floatingObject": { "isPinned": false, @@ -17208,8 +17208,8 @@ "id": "377ee3ed-49e4-415d-87b3-946024f0a1ef", "savedPayload": { "position": { - "x": 33033.333333333336, - "y": 18280.384757729335 + "x": 32960.389885690114, + "y": 18339.45319695701 }, "targetPosition": { "x": 33183.333333333336, @@ -17241,12 +17241,12 @@ "id": "bb0f0417-9dfb-47a3-941f-dcfa82fbaea1", "savedPayload": { "position": { - "x": 33105.0176180013, - "y": 17945.325462040382 + "x": 32883.333333333336, + "y": 18020.577136594 }, "targetPosition": { - "x": 33144.17547566732, - "y": 18242.758920452525 + "x": 33033.333333333336, + "y": 18280.384757729335 }, "floatingObject": { "isPinned": false, @@ -17264,8 +17264,8 @@ "id": "7c5f14f9-63c2-42fa-98ee-1d4a36590cf4", "savedPayload": { "position": { - "x": 33144.17547566732, - "y": 18242.758920452525 + "x": 33033.333333333336, + "y": 18280.384757729335 }, "targetPosition": { "x": 33183.333333333336, @@ -17297,12 +17297,12 @@ "id": "76fa8a24-9ab4-4eaf-82f2-458ba557b204", "savedPayload": { "position": { - "x": 33338.62476039485, - "y": 17960.636883091225 + "x": 33058.58631884268, + "y": 17953.303818424385 }, "targetPosition": { - "x": 33260.97904686409, - "y": 18250.414630977946 + "x": 33120.95982608801, + "y": 18246.748098644526 }, "floatingObject": { "isPinned": false, @@ -17320,8 +17320,8 @@ "id": "48544424-5b62-417b-897d-9164b26fcd56", "savedPayload": { "position": { - "x": 33260.97904686409, - "y": 18250.414630977946 + "x": 33120.95982608801, + "y": 18246.748098644526 }, "targetPosition": { "x": 33183.333333333336, @@ -17353,12 +17353,12 @@ "id": "297e57c2-3c1a-4170-b710-d2705804205b", "savedPayload": { "position": { - "x": 33548.59019073856, - "y": 18064.180374689924 + "x": 33246.05041129393, + "y": 17943.479241643705 }, "targetPosition": { - "x": 33365.96176203595, - "y": 18302.186376777296 + "x": 33214.69187231363, + "y": 18241.835810254186 }, "floatingObject": { "isPinned": false, @@ -17376,8 +17376,120 @@ "id": "b39e1c4d-4170-4134-ae85-fc9fa7f3eb47", "savedPayload": { "position": { - "x": 33365.96176203595, - "y": 18302.186376777296 + "x": 33214.69187231363, + "y": 18241.835810254186 + }, + "targetPosition": { + "x": 33183.333333333336, + "y": 18540.192378864667 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + } + } + }, + { + "type": "Signing Account", + "name": "New Signing Account", + "config": "{\n \"signature\": {\n \"message\": \"Luis-Fernando-Molina\",\n \"messageHash\": \"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\n \"v\": \"0x1b\",\n \"r\": \"0xa21640401c1e1ab44678fd6024654d6200025d75998a38d06a2dbb84d2b965b4\",\n \"s\": \"0x7c1308809675605bf120654214f7566a833158cc54471e8eefbee64e8031a5ce\",\n \"signature\": \"0xa21640401c1e1ab44678fd6024654d6200025d75998a38d06a2dbb84d2b965b47c1308809675605bf120654214f7566a833158cc54471e8eefbee64e8031a5ce1b\"\n }\n}", + "project": "Governance", + "signingAccountChild": { + "type": "Social Trading Desktop App", + "name": "Social Trading Desktop App # 2", + "config": "{\n \"codeName\": \"Social-Trading-Desktop-App-2\",\n \"host\": \"localhost\",\n \"webPort\": \"33249\",\n \"webSocketsPort\": \"17043\"\n}", + "project": "Governance", + "id": "e6f2b6f6-5e40-42d2-92d8-fdd17680a1c7", + "savedPayload": { + "position": { + "x": 33427.37531917882, + "y": 17992.065104279107 + }, + "targetPosition": { + "x": 33305.35432625608, + "y": 18266.128741571887 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + } + } + }, + "id": "530b3376-a820-4710-a7a0-bab877e4c4be", + "savedPayload": { + "position": { + "x": 33305.35432625608, + "y": 18266.128741571887 + }, + "targetPosition": { + "x": 33183.333333333336, + "y": 18540.192378864667 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + } + } + }, + { + "type": "Signing Account", + "name": "New Signing Account", + "config": "{\n \"signature\": {\n \"message\": \"Luis-Fernando-Molina\",\n \"messageHash\": \"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\n \"v\": \"0x1c\",\n \"r\": \"0x4e4870f2f0061fa5a6e5fca672f1543420e140944a65a294ea25f1c2ef1c5dbe\",\n \"s\": \"0x58ba993a911c9092967b51da47be22ad85062d5ce49c6b2de4f6a593c67850c6\",\n \"signature\": \"0x4e4870f2f0061fa5a6e5fca672f1543420e140944a65a294ea25f1c2ef1c5dbe58ba993a911c9092967b51da47be22ad85062d5ce49c6b2de4f6a593c67850c61c\"\n }\n}", + "project": "Governance", + "signingAccountChild": { + "type": "Social Trading Desktop App", + "name": "Social Trading Desktop App # 3", + "config": "{\n \"codeName\": \"Social-Trading-Desktop-App-3\",\n \"host\": \"localhost\",\n \"webPort\": \"33250\",\n \"webSocketsPort\": \"17044\"\n}", + "project": "Governance", + "id": "00ca860e-bb19-42b4-8bce-b67f9a1f9af7", + "savedPayload": { + "position": { + "x": 33584.81169714865, + "y": 18094.30548357823 + }, + "targetPosition": { + "x": 33384.072515240994, + "y": 18317.24893122145 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + } + } + }, + "id": "72de2a17-d6f1-491b-847b-4e110a122cf6", + "savedPayload": { + "position": { + "x": 33384.072515240994, + "y": 18317.24893122145 }, "targetPosition": { "x": 33183.333333333336, diff --git a/Projects/Governance/Schemas/App-Schema/social-trading-desktop-app.json b/Projects/Governance/Schemas/App-Schema/social-trading-desktop-app.json index d984011d3..32a0a255f 100644 --- a/Projects/Governance/Schemas/App-Schema/social-trading-desktop-app.json +++ b/Projects/Governance/Schemas/App-Schema/social-trading-desktop-app.json @@ -25,7 +25,7 @@ "config": true }, "initialValues": { - "config": "{}" + "config": "{ \n\"codeName\": \"localhost\", \n\"host\": \"localhost\", \n\"webPort\": \"34248\", \n\"webSocketsPort\": \"17042\"\n}" }, "addLeftIcons": true, "level": 1, diff --git a/Projects/Governance/Schemas/App-Schema/social-trading-mobile-app.json b/Projects/Governance/Schemas/App-Schema/social-trading-mobile-app.json index 7fa33665c..97202f837 100644 --- a/Projects/Governance/Schemas/App-Schema/social-trading-mobile-app.json +++ b/Projects/Governance/Schemas/App-Schema/social-trading-mobile-app.json @@ -25,7 +25,7 @@ "config": true }, "initialValues": { - "config": "{}" + "config": "{ \n\"codeName\": \"localhost\", \n\"host\": \"localhost\", \n\"webSocketsPort\": \"15042\"\n}" }, "addLeftIcons": true, "level": 1, diff --git a/Projects/Governance/Schemas/App-Schema/social-trading-server-app.json b/Projects/Governance/Schemas/App-Schema/social-trading-server-app.json index 5e15298e5..45d284b28 100644 --- a/Projects/Governance/Schemas/App-Schema/social-trading-server-app.json +++ b/Projects/Governance/Schemas/App-Schema/social-trading-server-app.json @@ -25,7 +25,7 @@ "config": true }, "initialValues": { - "config": "{}" + "config": "{ \n\"codeName\": \"localhost\", \n\"host\": \"localhost\", \n\"webSocketsPort\": \"16042\"\n}" }, "addLeftIcons": true, "level": 1, diff --git a/Projects/Network/SA/Modules/WebSocketsNetworkClient.js b/Projects/Network/SA/Modules/WebSocketsNetworkClient.js index 1542e743f..65efc4a74 100644 --- a/Projects/Network/SA/Modules/WebSocketsNetworkClient.js +++ b/Projects/Network/SA/Modules/WebSocketsNetworkClient.js @@ -55,7 +55,7 @@ exports.newNetworkModulesWebSocketsNetworkClient = function newNetworkModulesWeb thisObject.socket = new SA.nodeModules.ws('ws://' + thisObject.host + ':' + thisObject.port) await setUpWebSocketClient() - console.log('Websockets Client Connected to Network Node via Web Sockets ................ Connected to ' + thisObject.p2pNetworkNode.userProfile.userProfileHandle + ' -> ' + thisObject.p2pNetworkNode.node.name + ' -> ' + thisObject.host + ':' + thisObject.port) + console.log('Websockets Client Connected to Network Node via Web Sockets .................. Connected to ' + thisObject.p2pNetworkNode.userProfile.userProfileHandle + ' -> ' + thisObject.p2pNetworkNode.node.name + ' -> ' + thisObject.host + ':' + thisObject.port) thisObject.isConnected = true } @@ -223,7 +223,7 @@ exports.newNetworkModulesWebSocketsNetworkClient = function newNetworkModulesWeb function onConnectionClosed() { if (thisObject.isConnected === true) { - console.log('Websockets Client Disconnected from Network Node via Web Sockets ......... Disconnected from ' + thisObject.p2pNetworkNode.userProfile.userProfileHandle + ' -> ' + thisObject.p2pNetworkNode.node.name + ' -> ' + thisObject.host + ':' + thisObject.port) + console.log('Websockets Client Disconnected from Network Node via Web Sockets ............. Disconnected from ' + thisObject.p2pNetworkNode.userProfile.userProfileHandle + ' -> ' + thisObject.p2pNetworkNode.node.name + ' -> ' + thisObject.host + ':' + thisObject.port) } if (thisObject.onConnectionClosedCallBack !== undefined) { thisObject.onConnectionClosedCallBack(thisObject.id) diff --git a/Projects/Social-Trading/DK/modules/WebSocketsInterface.js b/Projects/Social-Trading/DK/modules/WebSocketsInterface.js index a3f2111be..d1e363c3b 100644 --- a/Projects/Social-Trading/DK/modules/WebSocketsInterface.js +++ b/Projects/Social-Trading/DK/modules/WebSocketsInterface.js @@ -22,7 +22,9 @@ exports.newDesktopModulesWebSocketsInterface = function newDesktopModulesWebSock } function initialize() { - socketServer = new SA.nodeModules.ws.Server({ port: global.env.DESKTOP_WEB_SOCKETS_INTERFACE_PORT }) + let port = JSON.parse(DK.desktopApp.p2pNetworkClient.node.config).webSocketsPort + + socketServer = new SA.nodeModules.ws.Server({ port: port }) webAppInterface = DK.projects.socialTrading.modules.webAppInterface.newSocialTradingModulesWebAppInterface() setUpWebSocketServer() @@ -45,7 +47,7 @@ exports.newDesktopModulesWebSocketsInterface = function newDesktopModulesWebSock webApp = { socket: socket } - console.log('Desktop Web App Connected to Web Sockets Interface ......................... Connected to port ' + global.env.DESKTOP_WEB_SOCKETS_INTERFACE_PORT) + console.log('Desktop Web App Connected to Web Sockets Interface ............................. Connected to port ' + global.env.DESKTOP_WEB_SOCKETS_INTERFACE_PORT) webApp.socket.on('close', onConnectionClosed) webApp.socket.on('message', onMenssage) diff --git a/Projects/Social-Trading/DK/modules/httpInterface.js b/Projects/Social-Trading/DK/modules/httpInterface.js index f99ebcd87..639e1e360 100644 --- a/Projects/Social-Trading/DK/modules/httpInterface.js +++ b/Projects/Social-Trading/DK/modules/httpInterface.js @@ -15,15 +15,16 @@ exports.newDesktopModulesHttpInterface = function newDesktopModulesHttpInterface } function initialize() { + let port = JSON.parse(DK.desktopApp.p2pNetworkClient.node.config).webPort /* We will create an HTTP Server and leave it running forever. */ - SA.nodeModules.http.createServer(onHttpRequest).listen(global.env.DESKTOP_HTTP_INTERFACE_PORT) + SA.nodeModules.http.createServer(onHttpRequest).listen(port) /* Starting the browser now is optional */ if (process.argv.includes("noBrowser")) { //Running Client only with no UI. } else { - SA.nodeModules.open('http://localhost:' + global.env.DESKTOP_HTTP_INTERFACE_PORT) + SA.nodeModules.open('http://localhost:' + port) } } @@ -39,6 +40,11 @@ exports.newDesktopModulesHttpInterface = function newDesktopModulesHttpInterface SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(global.env), httpResponse) } break + case 'ClientNode': + { + SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(DK.desktopApp.p2pNetworkClient.node), httpResponse) + } + break case 'ProjectsSchema': { let path = global.env.PATH_TO_PROJECTS + '/' + 'ProjectsSchema.json' diff --git a/Projects/Social-Trading/UI/modules/WebSocketsWebClient.js b/Projects/Social-Trading/UI/modules/WebSocketsWebClient.js index e0512c462..da9fb2730 100644 --- a/Projects/Social-Trading/UI/modules/WebSocketsWebClient.js +++ b/Projects/Social-Trading/UI/modules/WebSocketsWebClient.js @@ -24,7 +24,7 @@ function newSocialTradingModulesWebSocketsWebClient() { async function initialize() { - socketClient = new WebSocket('ws://' + UI.environment.DESKTOP_WEB_SOCKETS_INTERFACE_HOST + ':' + UI.environment.DESKTOP_WEB_SOCKETS_INTERFACE_PORT) + socketClient = new WebSocket('ws://' + JSON.parse(UI.clientNode.config).host + ':' + JSON.parse(UI.clientNode.config).webSocketsPort) await setUpWebsocketClient() } diff --git a/desktop-app-1.js b/desktop-app-1.js new file mode 100644 index 000000000..fb4dd79c1 --- /dev/null +++ b/desktop-app-1.js @@ -0,0 +1,8 @@ +/* +This is to start a new instance of a test desktop app running with identity #1 as +defined at the Environment.js file. +*/ + +let APP_ROOT = require('./DesktopRoot.js') +let APP_ROOT_MODULE = APP_ROOT.newDesktopRoot() +APP_ROOT_MODULE.run({DESKTOP_APP_SIGNING_ACCOUNT: 'Social-Trading-Desktop-App-1'}) \ No newline at end of file diff --git a/desktop-app-2.js b/desktop-app-2.js new file mode 100644 index 000000000..85e705d77 --- /dev/null +++ b/desktop-app-2.js @@ -0,0 +1,8 @@ +/* +This is to start a new instance of a test desktop app running with identity #2 as +defined at the Environment.js file. +*/ + +let APP_ROOT = require('./DesktopRoot.js') +let APP_ROOT_MODULE = APP_ROOT.newDesktopRoot() +APP_ROOT_MODULE.run({DESKTOP_APP_SIGNING_ACCOUNT: 'Social-Trading-Desktop-App-2'}) \ No newline at end of file diff --git a/desktop-app-3.js b/desktop-app-3.js new file mode 100644 index 000000000..215b8a445 --- /dev/null +++ b/desktop-app-3.js @@ -0,0 +1,8 @@ +/* +This is to start a new instance of a test desktop app running with identity #3 as +defined at the Environment.js file. +*/ + +let APP_ROOT = require('./DesktopRoot.js') +let APP_ROOT_MODULE = APP_ROOT.newDesktopRoot() +APP_ROOT_MODULE.run({DESKTOP_APP_SIGNING_ACCOUNT: 'Social-Trading-Desktop-App-3'}) \ No newline at end of file diff --git a/network-node-1.js b/network-node-1.js index ffb2ccd1e..1e58b469f 100644 --- a/network-node-1.js +++ b/network-node-1.js @@ -1,14 +1,6 @@ /* -The Superalgos Network offers 3 types of services: - - * Social Graph Service - * Search Index Service - * Private Message Service - -Users can decide which services to run at their node.(TODO) - -This module represents the Nodejs command that users have to start the Network Node.. - +This is to start a new instance of a test node running with Node identity #1 as +defined at the Environment.js file. */ let APP_ROOT = require('./NetworkRoot.js') diff --git a/network-node-2.js b/network-node-2.js index 0f36a5e2d..5d28e627c 100644 --- a/network-node-2.js +++ b/network-node-2.js @@ -1,14 +1,6 @@ /* -The Superalgos Network offers 3 types of services: - - * Social Graph Service - * Search Index Service - * Private Message Service - -Users can decide which services to run at their node.(TODO) - -This module represents the Nodejs command that users have to start the Network Node.. - +This is to start a new instance of a test node running with Node identity #2 as +defined at the Environment.js file. */ let APP_ROOT = require('./NetworkRoot.js') diff --git a/network-node-3.js b/network-node-3.js index f8a3ac41e..30d2c5141 100644 --- a/network-node-3.js +++ b/network-node-3.js @@ -1,14 +1,6 @@ /* -The Superalgos Network offers 3 types of services: - - * Social Graph Service - * Search Index Service - * Private Message Service - -Users can decide which services to run at their node.(TODO) - -This module represents the Nodejs command that users have to start the Network Node.. - +This is to start a new instance of a test node running with Node identity #3 as +defined at the Environment.js file. */ let APP_ROOT = require('./NetworkRoot.js')