runNetworkScript Debugged

This commit is contained in:
Luis Fernando Molina committed 2021-08-31 13:26:55 +02:00
1 parent 895c57aa0d
commit 743885aff5
6 files changed
+82 -64

No files matched your search

+12 -11
View File
@@ -3,19 +3,20 @@ exports.newEnvironment = function () {
let thisObject = {
WEB_SERVER_URL: 'localhost',
CLIENT_WEB_SOCKETS_INTERFACE_PORT: 18041,
NETWORK_WEB_SOCKETS_INTERFACE_PORT: 18042,
HTTP_INTERFACE_PORT: 34248,
PATH_TO_TASK_SERVER: '../TaskServer',
PATH_TO_DATA_STORAGE: '../Data-Storage',
PATH_TO_PROJECTS: '../Projects',
PATH_TO_LOG_FILES: '../Log-Files',
PATH_TO_TASK_SERVER: './TaskServer',
PATH_TO_DATA_STORAGE: './Data-Storage',
PATH_TO_PROJECTS: './Projects',
PATH_TO_LOG_FILES: './Log-Files',
PATH_TO_PROJECTS_REQUIRED: './Projects',
PATH_TO_PROJECT_SCHEMA: '../Projects/ProjectsSchema.json',
PATH_TO_UI: '../UI',
PATH_TO_DATA_FILES: '../UI/Data-Files/src',
PATH_TO_CLIENT: '../Client/',
PATH_TO_DEFAULT_WORKSPACE: '../Projects/Foundations/Plugins/Workspaces',
PATH_TO_MY_WORKSPACES: '../My-Workspaces',
PATH_TO_FONTS: '../Client/WebServer/Fonts'
PATH_TO_PROJECT_SCHEMA: './Projects/ProjectsSchema.json',
PATH_TO_UI: './UI',
PATH_TO_DATA_FILES: './UI/Data-Files/src',
PATH_TO_CLIENT: './Client/',
PATH_TO_DEFAULT_WORKSPACE: './Projects/Foundations/Plugins/Workspaces',
PATH_TO_MY_WORKSPACES: './My-Workspaces',
PATH_TO_FONTS: './Client/WebServer/Fonts'
}
return thisObject
+17 -52
View File
@@ -1,59 +1,24 @@
/*
The Superalgos Network offers 3 types of services:
exports.newNetworkNode = function newNetworkNode() {
* Social Graph Service
* Search Index Service
* Private Message Service
Users can decide which services to run at their node.
let thisObject = {
run: run
}
This module is the starting point of the Network Node.
return thisObject
*/
function run() {
/*
Let's start the Network Interfaces
*/
NT.webSocketsInterface = NT.projects.network.modules.webSocketsInterface.newNetworkModulesWebSocketsInterface()
NT.webSocketsInterface.initialize()
/*
The NT object is accesible everywhere at the Superalgos Network.
It provides access to all modules built for this Network.
*/
global.NT = {}
/*
The SA object is accesible everywhere at the Superalgos Network.
It provides access to all modules built for Superalgos in general.
*/
global.SA = {}
/* Load Environment Variables */
let ENVIRONMENT = require('../EnvironmentForDebug.js');
let ENVIRONMENT_MODULE = ENVIRONMENT.newEnvironment()
global.env = ENVIRONMENT_MODULE
/*
First thing is to load the project schema file.
*/
global.PROJECTS_SCHEMA = require(global.env.PATH_TO_PROJECT_SCHEMA)
/*
Setting up the modules that will be available for the Servers Running inside this Client
*/
let MULTI_PROJECT = require('../MultiProject.js');
let MULTI_PROJECT_MODULE = MULTI_PROJECT.newMultiProject()
MULTI_PROJECT_MODULE.initialize(NT, 'NT')
MULTI_PROJECT_MODULE.initialize(SA, 'SA')
/*
Setting up external dependencies.
*/
SA.nodeModules = {
fs: require('fs'),
nodeFetch: require('node-fetch'),
web3: require('web3'),
ws: require('ws')
}
/*
Let's start the Network Interfaces
*/
NT.webSocketsInterface = NT.projects.network.modules.webSocketsInterface.newNetworkModulesWebSocketsInterface()
NT.webSocketsInterface.initialize()
start()
start()
async function start() {
let socialGraphService = NT.projects.network.modules.socialGraph.newSocialGraph()
await socialGraphService.initialize()
}
async function start() {
let socialGraphService = NT.projects.network.modules.socialGraph.newSocialGraph()
await socialGraphService.initialize()
}
}
@@ -18,7 +18,7 @@ exports.newNetworkModulesWebSocketsInterface = function newNetworkModulesWebSock
}
function initialize() {
socketServer = new SA.nodeModule.ws.Server({ port: global.env.Network_WEB_SOCKETS_INTERFACE_PORT })
socketServer = new SA.nodeModules.ws.Server({ port: global.env.NETWORK_WEB_SOCKETS_INTERFACE_PORT })
clientInterface = NT.projects.network.modules.clientInterface.newNetworkModulesClientInterface()
peerInterface = NT.projects.network.modules.peerInterface.newNetworkModulesPeerInterface()
View File
File renamed without changes.
File renamed without changes.
+52
View File
@@ -0,0 +1,52 @@
/*
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 is the starting point of the Network Node.
*/
/*
The NT object is accesible everywhere at the Superalgos Network.
It provides access to all modules built for this Network.
*/
global.NT = {}
/*
The SA object is accesible everywhere at the Superalgos Network.
It provides access to all modules built for Superalgos in general.
*/
global.SA = {}
/* Load Environment Variables */
let ENVIRONMENT = require('./EnvironmentForDebug.js');
let ENVIRONMENT_MODULE = ENVIRONMENT.newEnvironment()
global.env = ENVIRONMENT_MODULE
/*
First thing is to load the project schema file.
*/
global.PROJECTS_SCHEMA = require(global.env.PATH_TO_PROJECT_SCHEMA)
/*
Setting up the modules that will be available, defined at the Project Schema file.
*/
let MULTI_PROJECT = require('./MultiProject.js');
let MULTI_PROJECT_MODULE = MULTI_PROJECT.newMultiProject()
MULTI_PROJECT_MODULE.initialize(NT, 'NT')
MULTI_PROJECT_MODULE.initialize(SA, 'SA')
/*
Setting up external dependencies.
*/
SA.nodeModules = {
fs: require('fs'),
nodeFetch: require('node-fetch'),
web3: require('web3'),
ws: require('ws')
}
NT.app = require('./Network/NetwokNode.js').newNetworkNode()
NT.app.run()
console.log('Superalgos Network is Running.')