Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

idlewatt source realm

Package idlewatt is an on-chain registry and dashboard for idle compute nodes: home GPU boxes today, and someday park...

Overview

Package idlewatt is an on-chain registry and dashboard for idle compute nodes: home GPU boxes today, and someday parked vehicles, that want to rent spare capacity on decentralized compute networks such as Akash.

IMPORTANT: every node, heartbeat and job in this realm is self-reported or simulated by its operator. There is no Tesla or Akash integration and no hardware attestation; earnings are simulated USD figures, not payments.

Constants 3

const ModeAvailable, ModeDriving, ModePaused

1const (
2	ModeAvailable = "available" // parked & plugged in, ready for work
3	ModeDriving   = "driving"   // vehicle in use, not renting compute
4	ModePaused    = "paused"    // operator paused the node
5)
source

Availability modes.

Functions 16

func DistributeBonus

crossing Action
1func DistributeBonus(cur realm) int
source

DistributeBonus splits the fairness pool equally across every node that is online and available right now, regardless of size or earnings, like AtomOne's Nakamoto Bonus splits its pool equally across validators. Anyone may call it, at most once per hour. Returns how many nodes shared.

func Heartbeat

crossing Action
1func Heartbeat(cur realm, id int, note string)
source

Heartbeat records a signed liveness ping for a node, with an optional short status note (e.g. "SoC 82%, 41C"). Only the operator.

func NodeSummary

Action
1func NodeSummary(id int) string
source

NodeSummary returns a one-line text summary of a node, or "" if unknown.

func RecordJob

crossing Action
1func RecordJob(cur realm, id int, workload string, minutes int) int
source

RecordJob records a completed (simulated) job on a node, e.g. an AI inference lease. Earnings are computed by the realm from the node's rate and the duration, so operators cannot claim arbitrary amounts. The node must be available and online. 14% of the gross goes to the fairness pool.

func RegisterNode

crossing Action
1func RegisterNode(cur realm, name, kind, hardware, region, power string, rateCents int64) int
source

RegisterNode adds a node owned by the caller and returns its ID. kind: home-gpu | vehicle | cpu. power: grid | solar | powershare-backup. rateCents: asking price in US cents per hour (e.g. 45 = $0.45/h).

func RemoveNode

crossing Action
1func RemoveNode(cur realm, id int)
source

RemoveNode deletes the caller's node. Its job history stays on the record.

func Render

1func Render(path string) string
source

Render serves the gnoweb dashboard.

Example
1""                 network summary, live node cards, leaderboard, recent jobs
2"nodes?page=N"      every node, paginated
3"node/<id>"         one node, its jobs and operator actions
4"operator/<g1addr>" one operator's nodes
5"leaderboard"       full ranking
6"jobs?page=N"       job history
7"about"             what this is, and what it is not

func SetAvailability

crossing Action
1func SetAvailability(cur realm, id int, mode string)
source

SetAvailability switches a node between available (parked & plugged in), driving (vehicles only) and paused. Only the operator.

func SetOnlineWindowMinutes

crossing Action
1func SetOnlineWindowMinutes(cur realm, minutes int)
source

SetOnlineWindowMinutes sets how long after its last heartbeat a node still counts as online (5 minutes to 7 days).

func SetPaused

crossing Action
1func SetPaused(cur realm, p bool)
source

SetPaused stops or resumes new registrations.

func SetRate

crossing Action
1func SetRate(cur realm, id int, rateCents int64)
source

SetRate changes only the hourly asking rate (US cents). Only the operator.

func Stats

Action
1func Stats() (int, int, int64, int64)
source

Stats returns nodes, online nodes, simulated gross earnings (cents) and the undistributed fairness pool (cents).

func TransferAdmin

crossing Action
1func TransferAdmin(cur realm, newAdmin address)
source

TransferAdmin hands the admin role to another address.

func UpdateNode

crossing Action
1func UpdateNode(cur realm, id int, name, hardware, region, power string, rateCents int64)
source

UpdateNode changes a node's descriptive fields and rate. Only the operator.

Types 2

type Job

struct
 1type Job struct {
 2	ID            int
 3	NodeID        int
 4	NodeName      string // snapshot, survives node removal
 5	Workload      string
 6	Minutes       int
 7	RateCents     int64
 8	GrossCents    int64 // rate x duration
 9	PoolCents     int64 // part sent to the fairness pool
10	OperatorCents int64
11	CompletedAt   time.Time
12}
source

Job is one simulated (self-reported) lease / job completion.

type Node

struct
 1type Node struct {
 2	ID        int
 3	Operator  address
 4	Name      string
 5	Kind      string
 6	Hardware  string
 7	Region    string
 8	Power     string
 9	RateCents int64 // asking price, USD cents per hour
10	Mode      string
11
12	RegisteredAt   time.Time
13	LastHeartbeat  time.Time // zero if never
14	SessionStart   time.Time // start of the current unbroken heartbeat run
15	HeartbeatCount int
16	LastNote       string
17
18	JobCount    int
19	JobMinutes  int64
20	EarnedCents int64 // operator share of simulated job earnings
21	BonusCents  int64 // share of the small-node fairness pool
22}
source

Node is one idle-compute node registered by an operator. All figures are self-reported by the operator; nothing here is verified by Akash, Tesla or any hardware attestation (yet).

Methods on Node

func TotalCents

method on Node
1func (n *Node) TotalCents() int64
source

TotalCents is what the leaderboard ranks on.

Dependencies

Source Files 7