Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add report for active contracts #915

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions farmerbot/internal/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type NodeReport struct {
ID uint32 `json:"id"`
State string `json:"state"`
HasActiveRentContract bool `json:"rented"`
HasActiveContracts bool `json:"has_active_contracts"`
Dedicated bool `json:"dedicated"`
PublicConfig bool `json:"public_config"`
UsagePercentage uint8 `json:"usage_percentage"`
Expand Down Expand Up @@ -64,6 +65,7 @@ func createNodeReport(n node) NodeReport {
ID: nodeID,
State: state,
HasActiveRentContract: n.hasActiveRentContract,
HasActiveContracts: n.hasActiveContracts,
Dedicated: n.dedicated,
PublicConfig: n.PublicConfig.HasValue,
UsagePercentage: usage,
Expand All @@ -86,6 +88,7 @@ func (f *FarmerBot) report() string {
"Dedicated",
"public config",
"Usage",
"Active node contracts",
"Random wake-ups",
"Periodic wake-up",
"last time state changed",
Expand Down Expand Up @@ -113,6 +116,7 @@ func (f *FarmerBot) report() string {
nodeReport.Dedicated,
nodeReport.PublicConfig,
fmt.Sprintf("%d%%", nodeReport.UsagePercentage),
nodeReport.HasActiveContracts,
nodeReport.TimesRandomWakeUps,
periodicWakeup,
nodeReport.SincePowerStateChanged,
Expand Down
Loading