From 871681261093eaf9fdcfb4ed6c3ada0ecca28a6c Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 22 Oct 2021 16:21:56 +0200 Subject: [PATCH] User Profiles Module --- .../SA/Modules/UserProfiles.js} | 17 ++++++---------- ...icker.js => AppClientNetworkNodePicker.js} | 2 +- Projects/ProjectsSchema.json | 20 +++++++++---------- .../Social-Trading/NT/Modules/SocialGraph.js | 7 ++++--- 4 files changed, 21 insertions(+), 25 deletions(-) rename Projects/{Social-Trading/NT/Modules/Bootstrap.js => Network/SA/Modules/UserProfiles.js} (82%) rename Projects/Network/SA/Utilities/{NetworkNodePicker.js => AppClientNetworkNodePicker.js} (60%) diff --git a/Projects/Social-Trading/NT/Modules/Bootstrap.js b/Projects/Network/SA/Modules/UserProfiles.js similarity index 82% rename from Projects/Social-Trading/NT/Modules/Bootstrap.js rename to Projects/Network/SA/Modules/UserProfiles.js index 45c5dad80..a4c73b8fd 100644 --- a/Projects/Social-Trading/NT/Modules/Bootstrap.js +++ b/Projects/Network/SA/Modules/UserProfiles.js @@ -1,15 +1,10 @@ -exports.newBootstrap = function newBootstrap() { +exports.newNetworkModulesUserProfiles = function newNetworkModulesUserProfiles() { /* - 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. + This module is usefull for all Apps that needs to operate with all User Profiles loaded in + memory maps. + + User Profiles are plugins of the Governance System. Besides the info they carry, we also + need to read the blockchain for each one in order to calculate their ranking. */ let thisObject = { /* Framework Functions */ diff --git a/Projects/Network/SA/Utilities/NetworkNodePicker.js b/Projects/Network/SA/Utilities/AppClientNetworkNodePicker.js similarity index 60% rename from Projects/Network/SA/Utilities/NetworkNodePicker.js rename to Projects/Network/SA/Utilities/AppClientNetworkNodePicker.js index a80bc58e4..6fa659579 100644 --- a/Projects/Network/SA/Utilities/NetworkNodePicker.js +++ b/Projects/Network/SA/Utilities/AppClientNetworkNodePicker.js @@ -1,4 +1,4 @@ -exports.newNetworkNetworkNodePicker = function newNetworkNetworkNodePicker () { +exports.newAppClientNetworkNetworkNodePicker = function newAppClientNetworkNetworkNodePicker () { let thisObject = { pickOneNetworkNode: pickOneNetworkNode } diff --git a/Projects/ProjectsSchema.json b/Projects/ProjectsSchema.json index 1f033bcc4..14d4f5fb6 100644 --- a/Projects/ProjectsSchema.json +++ b/Projects/ProjectsSchema.json @@ -1390,14 +1390,20 @@ "propertyName": "webSocketsAppClient", "functionName": "newNetworkModulesWebSocketsAppClient", "fileName": "WebSocketsAppClient.js" + }, + { + "name": "User Profiles", + "propertyName": "userProfiles", + "functionName": "newNetworkModulesUserProfiles", + "fileName": "UserProfiles.js" } ], "utilities": [ { - "name": "Network Node Picker", - "propertyName": "networkNodePicker", - "functionName": "newNetworkNetworkNodePicker", - "fileName": "NetworkNodePicker.js" + "name": "App Client Network Node Picker", + "propertyName": "appClientNetworkNodePicker", + "functionName": "newAppClientNetworkNetworkNodePicker", + "fileName": "AppClientNetworkNodePicker.js" } ] } @@ -1486,12 +1492,6 @@ "functionName": "newSocialTradingModulesSocialGraph", "fileName": "SocialGraph.js" }, - { - "name": "Bootstrap", - "propertyName": "bootstrap", - "functionName": "newSocialTradingModulesBootstrap", - "fileName": "Bootstrap.js" - }, { "name": "Query", "propertyName": "query", diff --git a/Projects/Social-Trading/NT/Modules/SocialGraph.js b/Projects/Social-Trading/NT/Modules/SocialGraph.js index 2ca0f8f49..41e169911 100644 --- a/Projects/Social-Trading/NT/Modules/SocialGraph.js +++ b/Projects/Social-Trading/NT/Modules/SocialGraph.js @@ -9,9 +9,10 @@ exports.newNetworkModulesSocialGraph = function newNetworkModulesSocialGraph() { their posts. */ let thisObject = { + userProfiles: undefined, /* Framework Functions */ initialize: initialize, - finalize: finalize + finalize: finalize } return thisObject @@ -21,7 +22,7 @@ exports.newNetworkModulesSocialGraph = function newNetworkModulesSocialGraph() { } async function initialize() { - let bootstrapProcess = NT.projects.socialTrading.modules.bootstrap.newBootstrap() - await bootstrapProcess.initialize() + thisObject.userProfiles = SA.projects.network.modules.userProfiles.newNetworkModulesUserProfiles() + await thisObject.userProfiles.initialize() } } \ No newline at end of file