Skip to content

Development of Mining Performance Analysis (performance) #57

@markoceri

Description

@markoceri

As can be seen from the DDD analysis, the Mining Performance Analysis domain is a supporting domain and can provide additional information useful for automation rules.

The main goal is to provide information about earnings, hash rates, etc. from the mining pool. If more information is needed, we can use this thread to discuss it.

For now the port (interface) has two functions get_current_hashrate() and get_recent_rewards().

class MiningPerformanceTrackerPort(ABC):
    """Port for the Mining Performance Tracker."""

    @abstractmethod
    def get_current_hashrate(self, miner_ids: List[EntityId]) -> Optional[HashRate]:
        """Gets the current hashrate from the pool or devices."""
        raise NotImplementedError

    @abstractmethod
    def get_recent_rewards(self, miner_id: Optional[EntityId] = None, limit: int = 10) -> List[MiningReward]:
        """Gets recent mining rewards."""
        raise NotImplementedError

The adapter implementing the port can follow the pattern used for the other adapters of the related domains. I imagine some extra data will needed, such as a URL and login data to ensure access to the mining pool. Other necessary data, if needed, can be provided through by adapter's constructor (its init() function)

as suggested by @riccardoaran , a first implementation of the adapter for a mining pool could be the one for Ocean.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions