Splitting Memory and changing it to Network Project

This commit is contained in:
Luis Fernando Molina committed 2021-10-22 15:46:56 +02:00
1 parent 5712193f72
commit 3345eff347
16 files changed
+86 -46

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
exports.newNetworkGlobalsMemory = function () {
/*
Here is the Data we are going to keep in memory.
*/
let thisObject = {
maps: {
EVENTS: new Map() // This is the registry of all events received that prevents processing them more than once.
},
arrays: {
NETWORK_CLIENTS: [], // These are the Network Clients connected to this Network Node ordered by Ranking.
NETWORK_PEERS: [], // These are the Network Peers connected to this Network Node ordered by Ranking.
EVENTS: [] // This is the registry of all events in order that prevents ordering them more than once.
}
}
return thisObject
}
@@ -304,7 +304,7 @@ exports.newNetworkModulesWebSocketsInterface = function newNetworkModulesWebSock
/*
The signature gives us the blockchain account, and the account the user profile.
*/
let witnessUserProfile = NT.projects.socialTrading.globals.memory.maps.USER_PROFILES_BY_BLOCHAIN_ACCOUNT.get(caller.blockchainAccount)
let witnessUserProfile = SA.projects.network.globals.memory.maps.USER_PROFILES_BY_BLOCHAIN_ACCOUNT.get(caller.blockchainAccount)
if (witnessUserProfile === undefined) {
let response = {
+16
View File
@@ -0,0 +1,16 @@
exports.newNetworkGlobalsMemory = function () {
/*
Here is the Data we are going to keep in memory.
*/
let thisObject = {
maps: {
USER_PROFILES_BY_ID: new Map(), // Here we will store the user profiles by User Profile Id.
USER_PROFILES_BY_HANDLE: new Map(), // Here we will store the user profiles by User Profile Handle.
USER_PROFILES_BY_BLOCHAIN_ACCOUNT: new Map() // Here we will store the user profiles by Blockchain Account.
},
arrays: {
}
}
return thisObject
}
@@ -0,0 +1,12 @@
exports.newNetworkNetworkNodePicker = function newNetworkNetworkNodePicker () {
let thisObject = {
pickOneNetworkNode: pickOneNetworkNode
}
return thisObject
function pickOneNetworkNode() {
}
}