2024-01-22 10:27:07 +01:00
using ArgsUniform ;
namespace TestNetRewarder
{
public class Configuration
{
2024-11-26 14:49:22 +01:00
private readonly DateTime AppStartUct = DateTime . UtcNow ;
2024-05-16 14:07:14 +02:00
[Uniform("datapath", "dp", "DATAPATH", true, "Root path where all data files will be saved.")]
2024-01-22 10:27:07 +01:00
public string DataPath { get ; set ; } = "datapath" ;
[Uniform("discordbot-host", "dh", "DISCORDBOTHOST", true, "http address of the discord bot.")]
public string DiscordHost { get ; set ; } = "host" ;
2024-05-16 14:07:14 +02:00
[Uniform("discordbot-port", "dp", "DISCORDBOTPORT", true, "port number of the discord bot reward API.")]
2024-01-22 10:27:07 +01:00
public int DiscordPort { get ; set ; } = 31080 ;
2024-05-16 14:07:14 +02:00
[Uniform("interval-minutes", "im", "INTERVALMINUTES", true, "time in minutes between reward updates.")]
2024-04-01 15:55:47 +02:00
public int IntervalMinutes { get ; set ; } = 15 ;
2024-01-22 10:27:07 +01:00
2024-11-26 14:49:22 +01:00
[Uniform("relative-history", "rh", "RELATIVEHISTORY", false, "Number of seconds into the past (from app start) that checking of chain history will start. Default: 3 hours ago.")]
public int RelativeHistorySeconds { get ; set ; } = 3600 * 3 ;
2024-01-22 10:27:07 +01:00
2024-04-07 14:04:31 +02:00
[Uniform("market-insights", "mi", "MARKETINSIGHTS", false, "Semi-colon separated integers. Each represents a multiple of intervals, for which a market insights average will be generated.")]
public string MarketInsights { get ; set ; } = "1;96" ;
2024-05-16 14:07:14 +02:00
[Uniform("events-overview", "eo", "EVENTSOVERVIEW", false, "When greater than zero, chain event summary will be generated.")]
2024-04-08 16:07:52 +02:00
public int CreateChainEventsOverview { get ; set ; } = 1 ;
2025-03-04 15:58:45 +01:00
[Uniform("proof-period-reports", "ppr", "PROOFPERIODREPORTS", false, "When greater than zero, chain event summary will include period reports of the proving system.")]
public int ShowProofPeriodReports { get ; set ; } = 1 ;
[Uniform("proof-submitted-events", "pse", "PROOFSUBMITTEDEVENTS", false, "When greater than zero, chain event summary will include proof-submitted events.")]
2025-03-05 09:57:25 +01:00
public int ShowProofSubmittedEvents { get ; set ; } = 0 ; // Defaulted to zero, aprox 7 to 10 such events every 2 minutes in testnet (from autoclient alone!)
2025-03-04 15:58:45 +01:00
2025-05-02 08:01:44 +02:00
[Uniform("proof-period-report-hours", "pprh", "PROOFPERIODREPORTHOURS", false, "Frequency in hours with which proof period reports are created.")]
public int ProofReportHours { get ; set ; } = 24 ;
2024-01-22 10:27:07 +01:00
public string LogPath
{
get
{
return Path . Combine ( DataPath , "logs" ) ;
}
}
2024-04-07 14:04:31 +02:00
public TimeSpan Interval
{
get
{
return TimeSpan . FromMinutes ( IntervalMinutes ) ;
}
}
2024-06-14 11:05:29 +02:00
public DateTime HistoryStartUtc
{
get
{
2024-11-26 14:49:22 +01:00
return AppStartUct - TimeSpan . FromSeconds ( RelativeHistorySeconds ) ;
2024-06-14 11:05:29 +02:00
}
}
2024-01-22 10:27:07 +01:00
}
}