Class FarmerProxy
Proxy that communicates with the farmer
public sealed class FarmerProxy : ServiceProxy, IServiceProxy
- Inheritance
-
FarmerProxy
- Implements
- Inherited Members
- Extension Methods
Remarks
ctor
Constructors
FarmerProxy(IRpcClient, string)
Proxy that communicates with the farmer
public FarmerProxy(IRpcClient rpcClient, string originService)
Parameters
rpcClient
IRpcClientIRpcClient instance to use for rpc communication
originService
string
Remarks
ctor
Methods
GetHarvesterPlotsDuplicates(PlotPathRequestData, CancellationToken)
Get a paginated list of duplicate plots
public Task<PaginatedPlotRequest> GetHarvesterPlotsDuplicates(PlotPathRequestData requestData, CancellationToken cancellationToken = default)
Parameters
requestData
PlotPathRequestDataInfo about the request
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<PaginatedPlotRequest>
A page of duplicate plots
GetHarvesterPlotsInvalid(PlotPathRequestData, CancellationToken)
Get a paginated list of invalid plots
Info about the requestpublic Task<PaginatedPlotRequest> GetHarvesterPlotsInvalid(PlotPathRequestData requestData, CancellationToken cancellationToken = default)
Parameters
requestData
PlotPathRequestData- Proxy that communicates with the farmer
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<PaginatedPlotRequest>
A page of invalid plots
GetHarvesterPlotsKeysMissing(PlotPathRequestData, CancellationToken)
Get a paginated list of plots with missing keys
public Task<PaginatedPlotRequest> GetHarvesterPlotsKeysMissing(PlotPathRequestData requestData, CancellationToken cancellationToken = default)
Parameters
requestData
PlotPathRequestDataInfo about the request
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<PaginatedPlotRequest>
A page of plots with missing keys
GetHarvesterPlotsValid(PlotInfoRequestData, CancellationToken)
Get a paginated list of valid plots
public Task<PaginatedPlotRequest> GetHarvesterPlotsValid(PlotInfoRequestData requestData, CancellationToken cancellationToken = default)
Parameters
requestData
PlotInfoRequestDataInfo about the request
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<PaginatedPlotRequest>
A page of valid plots
GetHarvesters(CancellationToken)
Get the list of harvesters
public Task<IEnumerable<HarvesterInfo>> GetHarvesters(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<HarvesterInfo>>
A list of harvesters
GetHarvestersSummary(CancellationToken)
Get a summary of harvesters
public Task<IEnumerable<HarvesterSummary>> GetHarvestersSummary(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<HarvesterSummary>>
A list of harvesters
GetPoolLoginLink(string, CancellationToken)
Get's the pool login link, if any
public Task<string> GetPoolLoginLink(string launcherID, CancellationToken cancellationToken = default)
Parameters
launcherID
stringThe id of the pool launcher
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
GetPoolState(CancellationToken)
Get's the state of the pool
public Task<IEnumerable<PoolStateInfo>> GetPoolState(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<PoolStateInfo>>
A list of pool states
GetRewardTargets(int, CancellationToken)
Get the farm and pool reward targets
public Task<(string FarmerTarget, string PoolTarget)> GetRewardTargets(int maxPhToSearch, CancellationToken cancellationToken = default)
Parameters
maxPhToSearch
intThe max number of puzzle hashes to search
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
GetRewardTargets(CancellationToken)
Get the farm and pool reward targets
public Task<(string FarmerTarget, string PoolTarget)> GetRewardTargets(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
GetRewardTargetsIncludingPrivateKey(int, CancellationToken)
Get the farm and pool reward targets, including private keys in the search
public Task<(string FarmerTarget, string PoolTarget, bool HaveFarmerSk, bool HavePoolSk)> GetRewardTargetsIncludingPrivateKey(int maxPhToSearch = 500, CancellationToken cancellationToken = default)
Parameters
maxPhToSearch
intThe max number of puzzle hashes to search
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<(string FarmerTarget, string PoolTarget, bool HaveFarmerSk, bool HavePoolSk)>
The farm and pool reward targets plus indicator if private keys are present
GetRewardTargetsIncludingPrivateKey(CancellationToken)
Get the farm and pool reward targets, including private keys in the search
public Task<(string FarmerTarget, string PoolTarget, bool HaveFarmerSk, bool HavePoolSk)> GetRewardTargetsIncludingPrivateKey(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<(string FarmerTarget, string PoolTarget, bool HaveFarmerSk, bool HavePoolSk)>
The farm and pool reward targets
GetSignagePoint(string, CancellationToken)
Get's a signage point by hash
public Task<(IEnumerable<(string SpHash, ProofOfSpace ProofOfSpace)> Proofs, FarmerSignagePoint SignagePoint)> GetSignagePoint(string spHash, CancellationToken cancellationToken = default)
Parameters
spHash
stringsignage point hash
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<(IEnumerable<(string SpHash, ProofOfSpace ProofOfSpace)> Proofs, FarmerSignagePoint SignagePoint)>
a signage point and proofs of space
GetSignagePoints(CancellationToken)
Get signage points
public Task<IEnumerable<(IEnumerable<(string SpHash, ProofOfSpace ProofOfSpace)> Proofs, FarmerSignagePoint SignagePoint)>> GetSignagePoints(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<(IEnumerable<(string SpHash, ProofOfSpace ProofOfSpace)> Proofs, FarmerSignagePoint SignagePoint)>>
List of signage points
OnEventMessage(Message)
protected override void OnEventMessage(Message msg)
Parameters
msg
Message
SetPayoutInstructions(string, string, CancellationToken)
Set's a pool's payout instructions
public Task SetPayoutInstructions(string launcherID, string payoutInstructions, CancellationToken cancellationToken = default)
Parameters
launcherID
stringThe id of the pool launcher
payoutInstructions
stringThe instructions
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
SetRewardTargets(string, string, CancellationToken)
Sets the farm and pool targets for the farmer
public Task SetRewardTargets(string farmerTarget, string poolTarget, CancellationToken cancellationToken = default)
Parameters
farmerTarget
stringFarmer target
poolTarget
stringPool target
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
Events
HarvesterRemoved
Event raised when a harvester is removed
public event EventHandler<dynamic>? HarvesterRemoved
Event Type
- EventHandler<dynamic>
- Proxy that communicates with the farmer
HarvesterUpdated
Event raised when a harvester is updated
public event EventHandler<dynamic>? HarvesterUpdated
Event Type
- EventHandler<dynamic>
- Proxy that communicates with the farmer
NewFarmingInfo
Event raised when new farming info is received
public event EventHandler<dynamic>? NewFarmingInfo
Event Type
- EventHandler<dynamic>
- Proxy that communicates with the farmer
NewSignagePoint
Event raised when a new signage point is received
public event EventHandler<dynamic>? NewSignagePoint
Event Type
- EventHandler<dynamic>
- Proxy that communicates with the farmer
PartialFailed
Event raised when a partial fails
public event EventHandler<dynamic>? PartialFailed
Event Type
- EventHandler<dynamic>
- Proxy that communicates with the farmer
PartialSubmitted
Event raised when a partial is submitted
public event EventHandler<dynamic>? PartialSubmitted
Event Type
- EventHandler<dynamic>
- Proxy that communicates with the farmer
Proof
Event raised when a proof message arrives
public event EventHandler<dynamic>? Proof
Event Type
- EventHandler<dynamic>
- Proxy that communicates with the farmer
Remarks
Requires registering as the metrics
service