Table of Contents

Class FarmerProxy

Namespace
chia.dotnet
Assembly
chia-dotnet.dll

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 IRpcClient

IRpcClient instance to use for rpc communication

originService string

Origin

Remarks

ctor

Methods

GetHarvesterPlotsDuplicates(PlotPathRequestData, CancellationToken)

Get a paginated list of duplicate plots

public Task<PaginatedPlotRequest> GetHarvesterPlotsDuplicates(PlotPathRequestData requestData, CancellationToken cancellationToken = default)

Parameters

requestData PlotPathRequestData

Info about the request

cancellationToken CancellationToken

A 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 request
public Task<PaginatedPlotRequest> GetHarvesterPlotsInvalid(PlotPathRequestData requestData, CancellationToken cancellationToken = default)

Parameters

requestData PlotPathRequestData
Proxy that communicates with the farmer
cancellationToken CancellationToken

A 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 PlotPathRequestData

Info about the request

cancellationToken CancellationToken

A 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 PlotInfoRequestData

Info about the request

cancellationToken CancellationToken

A 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 CancellationToken

A 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 CancellationToken

A token to allow the call to be cancelled

Returns

Task<IEnumerable<HarvesterSummary>>

A list of harvesters

Get's the pool login link, if any

public Task<string> GetPoolLoginLink(string launcherID, CancellationToken cancellationToken = default)

Parameters

launcherID string

The id of the pool launcher

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<string>

The link

GetPoolState(CancellationToken)

Get's the state of the pool

public Task<IEnumerable<PoolStateInfo>> GetPoolState(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A 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 int

The max number of puzzle hashes to search

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(string MyDid, string CoinID)>

the farm and pool reward targets

GetRewardTargets(CancellationToken)

Get the farm and pool reward targets

public Task<(string FarmerTarget, string PoolTarget)> GetRewardTargets(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(string MyDid, string CoinID)>

the farm and pool reward targets

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 int

The max number of puzzle hashes to search

cancellationToken CancellationToken

A 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 CancellationToken

A 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 string

signage point hash

cancellationToken CancellationToken

A 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 CancellationToken

A 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 string

The id of the pool launcher

payoutInstructions string

The instructions

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task

An awaitable Task

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 string

Farmer target

poolTarget string

Pool target

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task

An awaitable Task

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