prosper-miner service#62
Draft
epineapple wants to merge 17 commits into
Draft
Conversation
This command allows for the collection of statistics at any time, instead of waiting until submitting results.
Add notification channels for the current hash rate and for submissions. This goroutine and these notification channels allow programs to provide users with current statistics.
If `InitMiners` has not completed (because LXRHash is building the 1GB table file) and the `ReportHashRate` timer is triggered, the `SendCommand` call dereferences a null pointer. (It might be a good idea to add a check in `SendCommand`.) This change defers starting the `ReportHashRate` goroutine until the end of `InitMiners`.
Add the "startfeed" and "stopfeed" commands. The feed will print a message when a share is submitted and print the current hash rate at regular intervals.
891ff3a fixed a crash by moving a goroutine. This change fixes that fix by putting the goroutine outside of the loop.
This call duplicates a call made in client.Listen, which calls client.Close when the context is cancelled.
This change, which has only been tested on Windows 10, adds a Windows service (eventually also a *NIX/macOS daemon.) The newly-added service command can start, stop, install and uninstall the service on Windows, provided the account running the command has sufficient privileges. This service has a JSON-RPC server which listens on a named pipe. The change also adds the rpc and feed commands, which can control and query the state of the miner service.
Prior to this change, subscriptions only delivered each event to one client, generally in a round-robin fashion. This change ensures that each event is delivered to all clients. Add status subscriptions. As of this commit, subscribed clients receive notifications for connection to and disconnection from the pool.
This call duplicates a call that happens when the context is cancelled and resulted in freeing a semaphore twice.
Add the selectConfigFile which handles finding the proper config file by priority. Add tests for selectConfigFile.
Author
|
I've verified that the service works on macOS, x86_64 and arm64 linux in addition to x86_64 Windows. The missing feature has been merged to LXRHash. I'm currently working on merging the configuration code used by the service and the foreground process. Last week I documented the protocol that prosper-miner speaks to controlling processes. I've documented but not implemented a flow for registration via the GUI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This collection of changes allows the prosper-miner to run as a Windows service (and hopefully a *NIX daemon soon.) This change adds the following commands to the executable:
service: install, uninstall, start and stop the servicerpc: control and query the service using JSON-RPC over a named-pipefeed: print notifications from the service when a share is submitted and regular notifications of the hash rateThis PR needs some work in the following areas:
the service does not yet work on non-Windows platformsthe service currently depends on Add InitWithPath pegnet/LXRHash#71, which has not been mergedlxr.HashParallelbecause of some unanswered questionsI'm opening this PR so the appropriate people can start reviewing and asking questions.
This PR is built on the changes submitted in #61.