Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Superalgos/Superalgos in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
Mhnramin committed Jan 2, 2022
2 parents 930514f + 9868234 commit de9b317
Show file tree
Hide file tree
Showing 399 changed files with 34,488 additions and 20,394 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ assignees: ''

There are two requirements to open an issue:

1. You must first follow the [Troubleshooting Guide](https://docs.superalgos.org/suite-how-to-troubleshoot-an-issue.html)
1. You must first follow the Troubleshooting Guide in the built-in Docs.

2. If your issue hasn't been resolved by following the Troubleshooting Guide, then follow the guide on [How to Report an Issue](https://docs.superalgos.org/suite-how-to-report-an-issue.html).
2. If your issue hasn't been resolved by following the Troubleshooting Guide, then follow the guide on How to Report an Issue, also in the Docs.

## Context

Expand Down
30 changes: 11 additions & 19 deletions DesktopReact/DesktopApp.js → DesktopReact/DesktopAppBackend.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const express = require("./backend/src/index");
exports.newDesktopApp = function newDesktopApp() {
exports.newDesktopAppBackend = function newDesktopAppBackend() {

let thisObject = {
userProfiles: undefined,
Expand Down Expand Up @@ -39,13 +38,18 @@ exports.newDesktopApp = function newDesktopApp() {
thisObject.p2pNetwork = SA.projects.network.modules.p2pNetwork.newNetworkModulesP2PNetwork()
await thisObject.p2pNetwork.initialize('Network Client')
/*
This is where we will process all the events comming from the p2p network.
*/
thisObject.p2pNetworkInterface = SA.projects.socialTrading.modules.p2pNetworkInterface.newSocialTradingModulesP2PNetworkInterface()
/*
Set up the connections to network nodes.
*/
thisObject.p2pNetworkPeers = SA.projects.network.modules.p2pNetworkPeers.newNetworkModulesP2PNetworkPeers()
await thisObject.p2pNetworkPeers.initialize(
'Network Client',
thisObject.p2pNetworkClientIdentity,
thisObject.p2pNetwork,
thisObject.p2pNetworkInterface,
global.env.DESKTOP_APP_MAX_OUTGOING_PEERS
)
}
Expand All @@ -54,28 +58,16 @@ exports.newDesktopApp = function newDesktopApp() {
/*
This is where we will process all the messages comming from our web app.
*/
thisObject.webAppInterface = DK.projects.socialTrading.modules.webAppInterface.newSocialTradingModulesWebAppInterface() // this sends events to the p2p network
/*
This is where we will process all the events comming from the p2p network.
*/
thisObject.p2pNetworkInterface = DK.projects.socialTrading.modules.p2pNetworkInterface.newSocialTradingModulesP2PNetworkInterface() // this receives events from p2p network
thisObject.webAppInterface = DK.projects.socialTrading.modules.webAppInterface.newSocialTradingModulesWebAppInterface()
/*
This is the Personal Social Graph for the user running this App.
*/
thisObject.socialGraph = DK.projects.socialTrading.modules.socialGraph.newSocialTradingModulesSocialGraph() //
thisObject.socialGraph = DK.projects.socialTrading.modules.socialGraph.newSocialTradingModulesSocialGraph()
await thisObject.socialGraph.initialize()


let express = require('./backend/src/index')
let expressPort = JSON.parse(DK.desktopApp.p2pNetworkClientIdentity.node.config).webPort;
express.startExpress(expressPort,SA);
console.log('express Interface ................................................ Listening at port ' + expressPort);

/*TODO change this to have a definite port number*/
let react = require('./frontend/scripts/start')
let reactPort = (+JSON.parse(DK.desktopApp.p2pNetworkClientIdentity.node.config).webPort + 1);
react.start(reactPort);
console.log('react Interface ................................................ Listening at port ' + reactPort);
let express = require('./backend/src/expressServer.js')
express.DesktopBackend(DK.desktopApp.p2pNetworkClientIdentity.node.config.webPort, SA, DK);
console.log(`express Interface ................................................ Listening at port ${DK.desktopApp.p2pNetworkClientIdentity.node.config.webPort}` );
}
}
}
22 changes: 22 additions & 0 deletions DesktopReact/DesktopAppFrontend.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
exports.newDesktopAppFrontend = function newDesktopAppFrontend() {

let thisObject = {
run: run
}

return thisObject

async function run() {

await setupServices()

async function setupServices() {

let react = require('./frontend/scripts/start')
let port = 33249;
react.start(port); // todo get port from node config
console.log(`react Interface ................................................ Listening at port ${port}`);

}
}
}
Loading

0 comments on commit de9b317

Please sign in to comment.