diff --git a/Network/NetwokNode.js b/Network/NetwokNode.js index 3d3b993dc..22a04fbdb 100644 --- a/Network/NetwokNode.js +++ b/Network/NetwokNode.js @@ -10,14 +10,18 @@ exports.newNetworkNode = function newNetworkNode() { async function run() { /* - Let's start the Network Interfaces + Other Network Nodes and Client Apps will communicate with this Network Node via it's Websocket Interface. */ NT.webSocketsInterface = NT.projects.network.modules.webSocketsInterface.newNetworkModulesWebSocketsInterface() NT.webSocketsInterface.initialize() - + /* + The Social Graph Service is the first and for now, the only service this Network Node provides. + */ thisObject.socialGraphService = NT.projects.socialTrading.modules.socialGraph.newNetworkModulesSocialGraph() await thisObject.socialGraphService.initialize() - + /* + The Sotrage deals with persisting the Social Graph. + */ thisObject.storage = NT.projects.socialTrading.modules.storage.newSocialTradingModulesStorage() thisObject.storage.initialize() } diff --git a/Projects/Network/NT/Modules/WebSocketsInterface.js b/Projects/Network/NT/Modules/WebSocketsInterface.js index 1e4c548dc..32d00fd18 100644 --- a/Projects/Network/NT/Modules/WebSocketsInterface.js +++ b/Projects/Network/NT/Modules/WebSocketsInterface.js @@ -1,5 +1,16 @@ exports.newNetworkModulesWebSocketsInterface = function newNetworkModulesWebSocketsInterface() { + /* + This module represents the websockets interface of the Network Node. + A Network Nodes is epected to receive conections request from 2 different types + of entities: + + 1. Other Network Nodes. + 2. Clients / Apps. + + This module deals with those 2 connection types and is the one receiving from + and sending messages to those entities. + */ let thisObject = { networkClients: undefined, networkPeers: undefined, @@ -45,7 +56,6 @@ exports.newNetworkModulesWebSocketsInterface = function newNetworkModulesWebSock socketServer.on('connection', onConnectionOpened) function onConnectionOpened(socket) - /* This function is executed every time a new Websockets connection is stablished. diff --git a/Projects/Social-Trading/NT/Modules/Bootstrap.js b/Projects/Social-Trading/NT/Modules/Bootstrap.js index 303c2791a..d0b5fb2a6 100644 --- a/Projects/Social-Trading/NT/Modules/Bootstrap.js +++ b/Projects/Social-Trading/NT/Modules/Bootstrap.js @@ -3,6 +3,13 @@ exports.newBootstrap = function newBootstrap() { This module helps the Network Node to bootstrap, by loading all the services and data that needs to start operating. + + In particular, a network node operates with all User Profiles loaded in + memory maps. These profiles become part of the system in the form of User Profiles + Plugins at the Governance System, when user submit them. This means + that all these profiles are already at the local disk of the Network Node. + + From there they will be loaded into memory as part of this bootstrapping process. */ let thisObject = { /* Framework Functions */ diff --git a/Projects/Social-Trading/NT/Modules/ClientInterface.js b/Projects/Social-Trading/NT/Modules/ClientInterface.js index cb01af216..b1791258a 100644 --- a/Projects/Social-Trading/NT/Modules/ClientInterface.js +++ b/Projects/Social-Trading/NT/Modules/ClientInterface.js @@ -6,6 +6,10 @@ exports.newSocialTradingModulesClientInterface = function newSocialTradingModule * Send an Event that happened at the Network Client to the Network. * Make a Query to the Network Node for info needed at the Network Client. + + This interface is one layer above the communication protocol interface + where actual messages are received through, like for instance the + websockets interface. */ let thisObject = { messageReceived: messageReceived, diff --git a/Projects/Social-Trading/NT/Modules/PeerInterface.js b/Projects/Social-Trading/NT/Modules/PeerInterface.js index 6cb730381..e25193d5d 100644 --- a/Projects/Social-Trading/NT/Modules/PeerInterface.js +++ b/Projects/Social-Trading/NT/Modules/PeerInterface.js @@ -1,5 +1,12 @@ exports.newSocialTradingModulesPeerInterface = function newSocialTradingModulesPeerInterface() { - + /* + This module represents the Interface the Network Node have + with other Network Nodes connected to it. + + This interface is one layer above the communication protocol interface + where actual messages are received through, like for instance the + websockets interface. + */ let thisObject = { initialize: initialize, finalize: finalize, @@ -17,6 +24,6 @@ exports.newSocialTradingModulesPeerInterface = function newSocialTradingModulesP } function run() { - - } + + } } \ No newline at end of file diff --git a/Projects/Social-Trading/NT/Modules/SocialGraph.js b/Projects/Social-Trading/NT/Modules/SocialGraph.js index 7bf110fd3..2ca0f8f49 100644 --- a/Projects/Social-Trading/NT/Modules/SocialGraph.js +++ b/Projects/Social-Trading/NT/Modules/SocialGraph.js @@ -1,7 +1,7 @@ exports.newNetworkModulesSocialGraph = function newNetworkModulesSocialGraph() { /* This module represents the Social Graph Service that - this deals with the Social Graph this node mantains. + deals with the Social Graph this node mantains. The Social Graph is one of the services the Network Node provides. This service is responsible for mantaining the whole Social Graph diff --git a/Projects/Social-Trading/NT/Modules/Storage.js b/Projects/Social-Trading/NT/Modules/Storage.js index eaab5a677..fa59b092e 100644 --- a/Projects/Social-Trading/NT/Modules/Storage.js +++ b/Projects/Social-Trading/NT/Modules/Storage.js @@ -3,6 +3,15 @@ exports.newSocialTradingModulesStorage = function newSocialTradingModulesStorage This module represents the Network Node Physical Storage. It is used to save the in-memory events and also to load them when the node is starting. + + Each node has a github repository to store its social graph. + That Github repository can be used by any other node to get the history of + events that can build the social graph. + + Each Network Node saves locally all unsaved events, every one minute, + and after saving, pushes the changes to it's Github repo, which + acts as a backup of itself, and also for other new nodes to bootstrap + their own copy of the social graph. */ let thisObject = { initialize: initialize,