Table of Contents

Class HarvesterProxy

Namespace
chia.dotnet
Assembly
chia-dotnet.dll

Proxy that communicates with the harvester

public sealed class HarvesterProxy : ServiceProxy, IServiceProxy
Inheritance
HarvesterProxy
Implements
Inherited Members
Extension Methods

Remarks

ctor

Constructors

HarvesterProxy(IRpcClient, string)

Proxy that communicates with the harvester

public HarvesterProxy(IRpcClient rpcClient, string originService)

Parameters

rpcClient IRpcClient

IRpcClient instance to use for rpc communication

originService string

Origin

Remarks

ctor

Methods

AddPlotDirectory(string, CancellationToken)

Add a plot directory to the harvester configuration

public Task AddPlotDirectory(string dirname, CancellationToken cancellationToken = default)

Parameters

dirname string

The plot directory to add

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task

An awaitable Task

DeletePlot(string, CancellationToken)

Permanently delete a plot file

public Task DeletePlot(string filename, CancellationToken cancellationToken = default)

Parameters

filename string

the file name of the plot

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task

An awaitable Task

Remarks

Calling this DELETES the plot file. Proceed with caution.

GetHarvesterConfig(CancellationToken)

Gets harvester configuration.

public Task<HarvesterConfig> GetHarvesterConfig(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<HarvesterConfig>

HarvesterConfig

GetPlotDirectories(CancellationToken)

Get the list of plot directories from the harvester configuration

public Task<IEnumerable<string>> GetPlotDirectories(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<IEnumerable<string>>

List of directories

GetPlots(CancellationToken)

Get the list of plot files

public Task<(IEnumerable<string> FailedToOpenFilenames, IEnumerable<string> NotFoundFileNames, IEnumerable<PlotInfo> Plots)> GetPlots(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(IEnumerable<string> FailedToOpenFilenames, IEnumerable<string> NotFoundFileNames, IEnumerable<PlotInfo> Plots)>

A list of plots

OnEventMessage(Message)

protected override void OnEventMessage(Message msg)

Parameters

msg Message

RefreshPlots(CancellationToken)

Refresh the list of plots

public Task RefreshPlots(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task

An awaitable Task

RemovePlotDirectory(string, CancellationToken)

Removes a plot directory from the harvester configuration

public Task RemovePlotDirectory(string dirname, CancellationToken cancellationToken = default)

Parameters

dirname string

The plot directory to remove

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task

An awaitable Task

UpdateHarvesterConfig(bool?, int?, bool?, bool?, int?, int?, bool?, uint?, CancellationToken)

Sets harvester configuration.

public Task UpdateHarvesterConfig(bool? useGpuHarvesting = null, int? gpuIndex = null, bool? enforceGpuIndex = null, bool? disableCpuAffinity = null, int? parallelDecompressorCount = null, int? decompressorThreadCount = null, bool? recursivePlotScan = null, uint? refreshParameterIntervalSeconds = null, CancellationToken cancellationToken = default)

Parameters

useGpuHarvesting bool?
gpuIndex int?
enforceGpuIndex bool?
disableCpuAffinity bool?
parallelDecompressorCount int?
decompressorThreadCount int?
recursivePlotScan bool?
refreshParameterIntervalSeconds uint?
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task

An awaitable task>

Events

FarmingInfoChanged

Event raised when the farming info changes

public event EventHandler<dynamic>? FarmingInfoChanged

Event Type

EventHandler<dynamic>
Proxy that communicates with the harvester

PlotsChanged

Event raised when the plots change

public event EventHandler<dynamic>? PlotsChanged

Event Type

EventHandler<dynamic>
Proxy that communicates with the harvester