-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mix node #113
Fix mix node #113
Conversation
src/services/NodeMonitor.ts
Outdated
@@ -54,10 +57,10 @@ export class NodeMonitor { | |||
this.isRunning = true; | |||
this.clear(); | |||
|
|||
await this.getNetworkType(); // Read network Type from provided nodes. | |||
await this.getNetworkInfo(); // Read network Type and generated hash seed from provided nodes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rename this method as it's not a getter method (doesn't return anything)?
How about fetchAndSetNetworkInfo
?
return this.fetchNodesByURL(getNodeURL(node, monitor.API_NODE_PORT)); | ||
const hostUrl = await ApiNodeService.buildHostUrl(node.host); | ||
|
||
return this.fetchNodePeersByURL(hostUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I miss it, are pulling node/peers
from every api node?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, every API node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job
The node info from
/node/peers
can't be trusted, it always gives the wrong information, causing the node list to mix with another network.Add
networkGenerationHashSeed
property in NodeMonitor classnetworkGenerationHashSeed
on add node filter, to ensure always get the right node.Removed
NETWORK_IDENTIFIER
because network type is always collected from the provided node.Update
fetchNodesByURL
->fetchNodePeersByURL
fetchNodePeersByURL
method will only collect nodes from the node/peers.getNodeListInfo
method, collect nodes info (only API roles) without condition.