3 Network Nodes Running in Debug Mode
This commit is contained in:
1 parent
e98b1fbd6c
commit
48c35d8148
12 files changed
+129
-14
No files matched your search
@@ -40,7 +40,9 @@ exports.newNetworkModulesWebSocketsInterface = function newNetworkModulesWebSock
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
socketServer = new SA.nodeModules.ws.Server({ port: global.env.NETWORK_WEB_SOCKETS_INTERFACE_PORT })
|
||||
let port = JSON.parse(NT.networkNode.p2pNetwork.thisNetworkNode.node.config).webSocketsPort
|
||||
|
||||
socketServer = new SA.nodeModules.ws.Server({ port: port })
|
||||
clientInterface = NT.projects.socialTrading.modules.clientInterface.newSocialTradingModulesClientInterface()
|
||||
peerInterface = NT.projects.socialTrading.modules.peerInterface.newSocialTradingModulesPeerInterface()
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ exports.newNetworkModulesP2PNetwork = function newNetworkModulesP2PNetwork() {
|
||||
let thisObject = {
|
||||
joinTheNetworkAsNetworkPeer: joinTheNetworkAsNetworkPeer,
|
||||
p2pNodesToConnect: undefined,
|
||||
thisNetworkNode: undefined,
|
||||
/* Framework Functions */
|
||||
initialize: initialize,
|
||||
finalize: finalize
|
||||
@@ -37,6 +38,8 @@ exports.newNetworkModulesP2PNetwork = function newNetworkModulesP2PNetwork() {
|
||||
let p2pNetworkNode = SA.projects.network.globals.memory.arrays.P2P_NETWORK_NODES[i]
|
||||
if (thisP2PNodeId !== p2pNetworkNode.node.id) {
|
||||
thisObject.p2pNodesToConnect.push(p2pNetworkNode)
|
||||
} else {
|
||||
thisObject.thisNetworkNode = p2pNetworkNode
|
||||
}
|
||||
}
|
||||
break
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
exports.newNetworkModulesP2PNetworkPeers = function newNetworkModulesP2PNetworkPeers() {
|
||||
/*
|
||||
This module represents the P2P Nodes we are connected to.
|
||||
*/
|
||||
let thisObject = {
|
||||
|
||||
/* Framework Functions */
|
||||
initialize: initialize,
|
||||
finalize: finalize
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function finalize() {
|
||||
|
||||
}
|
||||
|
||||
async function initialize() {
|
||||
/*
|
||||
On a first iteration, we will try to connect to 2 Network Peers, one upstream and one downstream,
|
||||
meaning one with higher ranking that us, and the other with lower ranking than us.
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user