keep-network / keep-core

The smart contracts and reference client behind the Keep network
https://keep.network
MIT License
121 stars 75 forks source link

Present nodes list in dashboard application #2009

Open ElderOrb opened 4 years ago

ElderOrb commented 4 years ago

The idea is to add new expandable menu item named 'Network' with 'Random Beacon' and 'tBTC' sub-items inside. Clicking each sub-items would result in showing nodes list in form of simple grid (well, maybe with search) in the right pane. This should eliminate questions like 'is my node connected' once and forever.

Related to https://github.com/keep-network/keep-core/pull/1959

mhluongo commented 4 years ago

Ooh I like this "network view" idea.. though I guess the question is whether the hosted dApp, eg dashboard.test.keep.network, can access your particular node? Or whether people are running a local version of the dApp?

ElderOrb commented 4 years ago

I was thinking about using one of bootstrap nodes (assuming they will have diagnostics endpoint enabled) by default with maybe ability to specify arbitrary url.

ElderOrb commented 4 years ago

Before proceeding with implementation, do you think this is valid approach? Just to summarize, I propose:

  1. Expose bootstrap nodes list to dashboard application (specify in config file? use set of hard-coded ip addresses? query some backend?)
  2. During dashboard startup select one of bootstrap nodes with enabled 'diagnostics' endpoint and download initial peers list (ideally peers list must contain 'capabilities' entry with information about enabled diagnostics/metrics etc.).
  3. Ping bootstrap node periodically - if gone offline switch to another node with enabled 'diagnostics' endpoint
  4. Present nodes in 'network view'
  5. Allow specifying local node as the source of diagnostics data

@pdyraga @mhluongo @lukasz-zimnoch any thoughts?

ElderOrb commented 4 years ago
  1. Nodes list can be cached in browser's local storage
pdyraga commented 4 years ago

Unfortunately, I don't think mainnet bootstrap nodes or any other nodes will expose diagnostics/metrics endpoints publicly.

This should eliminate questions like 'is my node connected' once and forever.

Unfortunately, the fact one is connected to bootstrap does not mean their node is properly configured and other nodes can discover it. For example, we do observe bootstrap nodes having 200+ connected peers, and some people reporting they have only ~50 connections.

ElderOrb commented 4 years ago

Weird... Could it be the case that such situation caused by some bug? In theory if all nodes know about all nodes any node should be source of full information about network, no?

Anyway, do you see any value in working towards nodes list visualization? I feel like it could simplify troubleshooting situation you described (by switching between different nodes and comparing results) but this is just my opinion...

ElderOrb commented 4 years ago

Okay, I've taken silence as a green light and started thinking on the way of querying bootstrap nodes. At the moment it can be done either by hard-coding or by fetching & parsing docs from github. But. What if bootstrap nodes could be published to ipfs and document would be available via some kind of decentralized dns (like unstoppable domains)? Publishing bootstrap nodes to ipfs & updating dns entry could be part of release process.

Shadowfiend commented 4 years ago

Sorry for the late feedback here…

What's the scope you're aiming for? Are you trying to aim this at mainnet or testnet? Mainnet bootstraps aren't run by the Keep team, they're pretty much exclusively run by external entities. So we don't really control their release process. Moreover, bootstraps are set to maximize stability and resiliency for the network. That means adding external load that's not related to managing the network is probably not a good idea.

A better approach here would probably be something like how I believe Ethereum stats systems work, where the model is not based on an application pulling data from nodes, but rather on the nodes pushing data to the application (eventually, perhaps to ipfs or some other data storage setup---though there's a question of how you pay for this to be considered if you go decentralized).

ElderOrb commented 4 years ago

For now scope is testnet. I see your concerns and need to think on this..

ElderOrb commented 4 years ago

Is it possible to run mainnet node without stake? Will it connect to network at all?

pdyraga commented 4 years ago

Is it possible to run mainnet node without stake? Will it connect to network at all?

No, the node needs to have at least the minimum stake. If the node has no minimum stake, other nodes will refuse to connect.