Skip to content
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

[Feature Request] API to get current available pools with status #10

Closed
xrdavies opened this issue Jan 23, 2019 · 6 comments
Closed

[Feature Request] API to get current available pools with status #10

xrdavies opened this issue Jan 23, 2019 · 6 comments

Comments

@xrdavies
Copy link
Contributor

Currently there is no way to get status of available pools that wallet cannot connect to the correct pool to query and transfer.

One API to get list of current available pools with status would be helpful for wallets.

@kbs1
Copy link
Collaborator

kbs1 commented Jan 23, 2019

Hi, this feature request coincides with active pools monitoring I am about to implement, so maybe I can implement it as a feature of the explorer itself :) I can check all pools from whitelist periodically and return healthy pools in an API call.

The only problem with this is that the miner port(s) are not a part of whitelist file. Therefore I am unable to obtain them for wallet connection. It also happens pools tend to listen on multiple ports (as for example ca1.xdag.org listens on 443 and 13654 for miners). But only port 16775 (the pool port) is in whitelist file.

So we need to add information to the repository.

Option 1: we could change the format of whitelist files to for example the following:

ip:pool_port miners_port,miners_port,miners_port,.... pool_name

It must be checked if such markup (or similar) can be compatible with current versions of XDAG, I think it would not pass validation.

Option 2: If we can not find a way to add information to current whitelist files so they still pass validation with current nodes, we can always create new files, for example netdb-white-details.txt (and testnet counterpart). These files would not be used by xdag, but read by explorer. These new files can have any suitable format, for example the one shown above, or JSON (and then also have .json file extension). Pool port must still be listed, as multiple pools can run on the same IP. When going with this approach, care must be then taken to ensure files won't get desynced and always contain the same IPs and pool ports when updating whitelist entries.

When we are ready, the explorer could provide 2 API points:

  • get a list of current healthy pools (this will also pick up the most firewall-friendly port for a given returned pool, for example if 443 and 13654 are listed, 443 would be returned)
  • get a list of long-dead pools (for periodical whitelist removal purposes)

@xrdavies
Copy link
Contributor Author

@kbs1

That's great!

Currently the pool section in xdag.io webpage, we can see the status of listed pools. It could be helpful for this purpose.

The best solution in my mind would be let pools report their configurations to our API that we can collect as many information as possible.

@kbs1
Copy link
Collaborator

kbs1 commented Jan 23, 2019

@xrdavies - that list is hardcoded, we need to get a process going where each new pool addition also comes with miner ports and possibly pool name just for everyone's reference :) Hardcoding these values is not a viable solution as then everyone who would like to run the explorer would just have to keep updating the code every time the whitelist changes.

@xrdavies
Copy link
Contributor Author

xrdavies commented Jan 24, 2019

@kbs1 So can we have a pool list on GitHub temporarily to solve this problem? Later we can implement in pool code to report configuration to our community maintained explorer. For example, in XDAG code, we can add post request every 15 mins when pool is launched that we can received the pool configuration from this post request.

@kbs1
Copy link
Collaborator

kbs1 commented Jan 24, 2019

@xrdavies Yes, sure! :) The new file should be in this format:

ip:pool_port miners_port,miners_port,miners_port,.... pool_name

The file should also exist for testnet. A feature where other nodes would inform their peers of their config would be great. But with ports, it's not always possible to do so. For example I can configure the daemon to listen on 5555 for miners but I will forward 1234 on the firewall. So the daemon can't really know it's miners port, and there can also be multiple ports open for mining.

@kbs1
Copy link
Collaborator

kbs1 commented Mar 21, 2019

@xrdavies similar functionality is now available here: https://explorer.xdag.io/node-statistics - it serves as an overview for nodes in the whitelist. However, pool ports are not considered as we still don't have any way to obtain them.

@kbs1 kbs1 closed this as completed Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants