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 state

Back to all declarations

maxNodes

untyped bigint

Tunables.

Value

(1000 <untyped> bigint)

maxNodesPerOperator

untyped bigint

Tunables.

Value

(10 <untyped> bigint)

minHeartbeatInterval

time.Duration

Tunables.

Value

<zero>

poolBps

untyped bigint

// 14% of every job feeds the fairness pool (a nod to AtomOne's Nakamoto Bonus)

Value

(1400 <untyped> bigint)

minBonusEpoch

time.Duration

Tunables.

Value

<zero>

minOnlineWindow

time.Duration

Tunables.

Value

<zero>

maxOnlineWindow

time.Duration

Tunables.

Value

<zero>

admin

.uverse.address

Value

<gnolang.StringValue>

paused

bool

// when true, new registrations are refused

Value

false

onlineWindow

time.Duration

Value

<zero>

nextNodeID

int

Value

5

nextJobID

int

Value

7

byOperator

*v0.Tree

// operator + "/" + padID -> nodeID

Open
OID
0e24cf…a8c3:12
byOperator details

Inspect pointer

leaderboard

*v0.Tree

// rankKey(total, id) -> nodeID

Open
OID
0e24cf…a8c3:15
leaderboard details

Inspect pointer

nodeJobs

*v0.Tree

// padID(nodeID) + "/" + padID(jobID) -> jobID

Open
OID
0e24cf…a8c3:21
nodeJobs details

Inspect pointer

totalGrossCents

int64

Value

471

poolCents

int64

// undistributed fairness pool

Value

3

poolPaidCents

int64

// distributed so far

Value

60

bonusRounds

int

Value

2

lastDistribution

time.Time
Open
OID
0e24cf…a8c3:361
lastDistribution details

Inspect ref

realmURL

string

realmURL is this realm's gnoweb path, e.g. /r/\<addr>/idlewatt.

Value

"/r/g1pzn6rn8q0pfmq4xje4j8086ncnldavyz8skgp3/idlewatt"

RegisterNode

func(name string, kind string, hardware string, region string, power string, rateCents int64) int

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).

Open
OID
0e24cf…a8c3:32
RegisterNode details

Inspect func

UpdateNode

func(id int, name string, hardware string, region string, power string, rateCents int64)

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

Open
OID
0e24cf…a8c3:33
UpdateNode details

Inspect func

SetRate

func(id int, rateCents int64)

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

Open
OID
0e24cf…a8c3:34
SetRate details

Inspect func

SetAvailability

func(id int, mode string)

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

Open
OID
0e24cf…a8c3:35
SetAvailability details

Inspect func

Heartbeat

func(id int, note string)

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

Open
OID
0e24cf…a8c3:36
Heartbeat details

Inspect func

RecordJob

func(id int, workload string, minutes int) int

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.

Open
OID
0e24cf…a8c3:37
RecordJob details

Inspect func

RemoveNode

func(id int)

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

Open
OID
0e24cf…a8c3:38
RemoveNode details

Inspect func

DistributeBonus

func() int

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.

Open
OID
0e24cf…a8c3:39
DistributeBonus details

Inspect func

SetPaused

func(p bool)

SetPaused stops or resumes new registrations.

Open
OID
0e24cf…a8c3:40
SetPaused details

Inspect func

SetOnlineWindowMinutes

func(minutes int)

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

Open
OID
0e24cf…a8c3:41
SetOnlineWindowMinutes details

Inspect func

AdminRemoveNode

func(id int)

AdminRemoveNode removes a spam or abusive node.

Open
OID
0e24cf…a8c3:42
AdminRemoveNode details

Inspect func

TransferAdmin

func(newAdmin .uverse.address)

TransferAdmin hands the admin role to another address.

Open
OID
0e24cf…a8c3:43
TransferAdmin details

Inspect func

NodeCount

func() int

NodeCount returns the number of registered nodes.

Open
OID
0e24cf…a8c3:45
NodeCount details

Inspect func

Stats

func() (int, int, int64, int64)

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

Open
OID
0e24cf…a8c3:46
Stats details

Inspect func

NodeSummary

func(id int) string

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

Open
OID
0e24cf…a8c3:47
NodeSummary details

Inspect func

mustCaller

func() .uverse.address
Open
OID
0e24cf…a8c3:48
mustCaller details

Inspect func

mustGetNode

func(id int) *idlewatt.Node
Open
OID
0e24cf…a8c3:50
mustGetNode details

Inspect func

mustOwnNode

func(id int, caller .uverse.address) *idlewatt.Node
Open
OID
0e24cf…a8c3:51
mustOwnNode details

Inspect func

removeNode

func(n *idlewatt.Node)
Open
OID
0e24cf…a8c3:52
removeNode details

Inspect func

reRank

func(n *idlewatt.Node, oldTotal int64)
Open
OID
0e24cf…a8c3:53
reRank details

Inspect func

operatorNodeCount

func(op .uverse.address) int
Open
OID
0e24cf…a8c3:54
operatorNodeCount details

Inspect func

isOnlineAt

func(n *idlewatt.Node, now time.Time) bool
Open
OID
0e24cf…a8c3:55
isOnlineAt details

Inspect func

countOnline

func(now time.Time) int
Open
OID
0e24cf…a8c3:56
countOnline details

Inspect func

padID

func(id int) string

padID makes IDs sort numerically as avl keys.

Open
OID
0e24cf…a8c3:57
padID details

Inspect func

rankKey

func(totalCents int64, id int) string

rankKey sorts the highest total first, ties broken by lowest node ID.

Open
OID
0e24cf…a8c3:58
rankKey details

Inspect func

pageSize

untyped bigint

Value

(10 <untyped> bigint)

Render

func(path string) string

Render serves the gnoweb dashboard. "" network summary, live node cards, leaderboard, recent jobs "nodes?page=N" every node, paginated "node/<id>" one node, its jobs and operator actions "operator/<g1addr>" one operator's nodes "leaderboard" full ranking "jobs?page=N" job history "about" what this is, and what it is not

Open
OID
0e24cf…a8c3:59
Render details

Inspect func

renderHome

func(now time.Time) string
Open
OID
0e24cf…a8c3:61
renderHome details

Inspect func

renderNodes

func(now time.Time, page int) string
Open
OID
0e24cf…a8c3:62
renderNodes details

Inspect func

renderNode

func(now time.Time, id int) string
Open
OID
0e24cf…a8c3:63
renderNode details

Inspect func

renderOperator

func(now time.Time, addr string) string
Open
OID
0e24cf…a8c3:64
renderOperator details

Inspect func

renderLeaderboard

func(now time.Time, limit int) string
Open
OID
0e24cf…a8c3:65
renderLeaderboard details

Inspect func

renderJobs

func(page int) string
Open
OID
0e24cf…a8c3:66
renderJobs details

Inspect func

statCard

func(icon string, title string, value string, sub string) string
Open
OID
0e24cf…a8c3:70
statCard details

Inspect func

nodeCard

func(n *idlewatt.Node, now time.Time) string
Open
OID
0e24cf…a8c3:71
nodeCard details

Inspect func

cardGrid

func(cards []string, perRow int) string

cardGrid lays cards out in rows of perRow columns.

Open
OID
0e24cf…a8c3:72
cardGrid details

Inspect func

leaderboardTable

func(now time.Time, limit int) string
Open
OID
0e24cf…a8c3:73
leaderboardTable details

Inspect func

jobsTable

func(offset int, limit int, nodeID int) string

jobsTable lists jobs newest first. nodeID \< 0 means all nodes.

Open
OID
0e24cf…a8c3:74
jobsTable details

Inspect func

bonusSection

func(now time.Time) string
Open
OID
0e24cf…a8c3:75
bonusSection details

Inspect func

pager

func(route string, page int, total int) string
Open
OID
0e24cf…a8c3:77
pager details

Inspect func

pageParam

func(query string) int
Open
OID
0e24cf…a8c3:80
pageParam details

Inspect func

statusOf

func(n *idlewatt.Node, now time.Time) string
Open
OID
0e24cf…a8c3:81
statusOf details

Inspect func

kindLabel

func(kind string) string
Open
OID
0e24cf…a8c3:83
kindLabel details

Inspect func

kindIcon

func(kind string) string
Open
OID
0e24cf…a8c3:84
kindIcon details

Inspect func

powerLabel

func(p string) string
Open
OID
0e24cf…a8c3:85
powerLabel details

Inspect func

boolWord

func(b bool, yes string, no string) string
Open
OID
0e24cf…a8c3:87
boolWord details

Inspect func

fmtUSD

func(cents int64) string

fmtUSD renders cents as $1,234.56.

Open
OID
0e24cf…a8c3:88
fmtUSD details

Inspect func

fmtDuration

func(d time.Duration) string
Open
OID
0e24cf…a8c3:89
fmtDuration details

Inspect func

shortAddr

func(a .uverse.address) string
Open
OID
0e24cf…a8c3:91
shortAddr details

Inspect func

safeAddrText

func(s string) string

safeAddrText echoes a user-supplied path segment only if it looks like an address, so the page never reflects arbitrary markdown.

Open
OID
0e24cf…a8c3:92
safeAddrText details

Inspect func

plural

func(n int, word string) string
Open
OID
0e24cf…a8c3:93
plural details

Inspect func

KindHomeGPU

untyped string

Node kinds.

Value

"home-gpu"

KindVehicle

untyped string

Node kinds.

Value

"vehicle"

KindCPU

untyped string

Node kinds.

Value

"cpu"

PowerGrid

untyped string

Power sources.

Value

"grid"

PowerSolar

untyped string

Power sources.

Value

"solar"

PowerPowershare

untyped string

Power sources.

Value

"powershare-backup"

ModeAvailable

untyped string

// parked & plugged in, ready for work

Value

"available"

ModeDriving

untyped string

// vehicle in use, not renting compute

Value

"driving"

ModePaused

untyped string

// operator paused the node

Value

"paused"

Node

type

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).

Value

idlewatt.Node

Job

type

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

Value

idlewatt.Job

minNameLen

untyped bigint

Input limits.

Value

(3 <untyped> bigint)

maxNameLen

untyped bigint

Input limits.

Value

(48 <untyped> bigint)

maxHardwareLen

untyped bigint

Input limits.

Value

(80 <untyped> bigint)

minRegionLen

untyped bigint

Input limits.

Value

(2 <untyped> bigint)

maxRegionLen

untyped bigint

Input limits.

Value

(40 <untyped> bigint)

maxWorkloadLen

untyped bigint

Input limits.

Value

(60 <untyped> bigint)

maxNoteLen

untyped bigint

Input limits.

Value

(60 <untyped> bigint)

maxRateCents

untyped bigint

// $1,000/hour sanity cap

Value

(100000 <untyped> bigint)

maxJobMinutes

untyped bigint

Input limits.

Value

(1440 <untyped> bigint)

isSafeChar

func(c int32) bool

isSafeChar is the character whitelist for every free-text field. It keeps operator-supplied strings from injecting markdown, HTML, gnoweb tags or table pipes into Render output, and keeps them single-line.

Open
OID
0e24cf…a8c3:94
isSafeChar details

Inspect func

checkText

func(field string, s string, minLen int, maxLen int)

checkText validates a free-text field and panics with a readable message.

Open
OID
0e24cf…a8c3:96
checkText details

Inspect func

checkMode

func(kind string, mode string)
Open
OID
0e24cf…a8c3:100
checkMode details

Inspect func
maxNodes : untyped bigint =(1000 <untyped> bigint)
maxNodesPerOperator : untyped bigint =(10 <untyped> bigint)
minHeartbeatInterval : time.Duration =<zero>
poolBps : untyped bigint =(1400 <untyped> bigint)
minBonusEpoch : time.Duration =<zero>
minOnlineWindow : time.Duration =<zero>
maxOnlineWindow : time.Duration =<zero>
admin : .uverse.address =<gnolang.StringValue>
paused : bool =false
onlineWindow : time.Duration =<zero>
nextNodeID : int =5
nextJobID : int =7
nodes : *v0.Tree Inspect
byOperator : *v0.Tree Inspect
leaderboard : *v0.Tree Inspect
jobs : *v0.Tree Inspect
nodeJobs : *v0.Tree Inspect
totalGrossCents : int64 =471
poolCents : int64 =3
poolPaidCents : int64 =60
bonusRounds : int =2
lastDistribution : time.Time Inspect
realmURL : string ="/r/g1pzn6rn8q0pfmq4xje4j8086ncnldavyz8skgp3/idlewatt"
init.23 : func() Inspect
RegisterNode : func(name string, kind string, hardware string, region string, power string, rateCents int64) int Inspect
UpdateNode : func(id int, name string, hardware string, region string, power string, rateCents int64) Inspect
SetRate : func(id int, rateCents int64) Inspect
SetAvailability : func(id int, mode string) Inspect
Heartbeat : func(id int, note string) Inspect
RecordJob : func(id int, workload string, minutes int) int Inspect
RemoveNode : func(id int) Inspect
DistributeBonus : func() int Inspect
SetPaused : func(p bool) Inspect
SetOnlineWindowMinutes : func(minutes int) Inspect
AdminRemoveNode : func(id int) Inspect
TransferAdmin : func(newAdmin .uverse.address) Inspect
Admin : func() .uverse.address Inspect
NodeCount : func() int Inspect
Stats : func() (int, int, int64, int64) Inspect
NodeSummary : func(id int) string Inspect
mustCaller : func() .uverse.address Inspect
mustAdmin : func() Inspect
mustGetNode : func(id int) *idlewatt.Node Inspect
mustOwnNode : func(id int, caller .uverse.address) *idlewatt.Node Inspect
removeNode : func(n *idlewatt.Node) Inspect
reRank : func(n *idlewatt.Node, oldTotal int64) Inspect
operatorNodeCount : func(op .uverse.address) int Inspect
isOnlineAt : func(n *idlewatt.Node, now time.Time) bool Inspect
countOnline : func(now time.Time) int Inspect
padID : func(id int) string Inspect
rankKey : func(totalCents int64, id int) string Inspect
pageSize : untyped bigint =(10 <untyped> bigint)
Render : func(path string) string Inspect
renderHome : func(now time.Time) string Inspect
renderNodes : func(now time.Time, page int) string Inspect
renderNode : func(now time.Time, id int) string Inspect
renderOperator : func(now time.Time, addr string) string Inspect
renderLeaderboard : func(now time.Time, limit int) string Inspect
renderJobs : func(page int) string Inspect
renderAbout : func() string Inspect
navBar : func() string Inspect
disclaimer : func() string Inspect
statCard : func(icon string, title string, value string, sub string) string Inspect
nodeCard : func(n *idlewatt.Node, now time.Time) string Inspect
cardGrid : func(cards []string, perRow int) string Inspect
leaderboardTable : func(now time.Time, limit int) string Inspect
jobsTable : func(offset int, limit int, nodeID int) string Inspect
bonusSection : func(now time.Time) string Inspect
registerForm : func() string Inspect
pager : func(route string, page int, total int) string Inspect
notFound : func() string Inspect
pageParam : func(query string) int Inspect
statusOf : func(n *idlewatt.Node, now time.Time) string Inspect
rankOf : func(n *idlewatt.Node) int Inspect
kindLabel : func(kind string) string Inspect
kindIcon : func(kind string) string Inspect
powerLabel : func(p string) string Inspect
medal : func(rank int) string Inspect
boolWord : func(b bool, yes string, no string) string Inspect
fmtUSD : func(cents int64) string Inspect
fmtDuration : func(d time.Duration) string Inspect
ago : func(d time.Duration) string Inspect
shortAddr : func(a .uverse.address) string Inspect
safeAddrText : func(s string) string Inspect
plural : func(n int, word string) string Inspect
KindHomeGPU : untyped string ="home-gpu"
KindVehicle : untyped string ="vehicle"
KindCPU : untyped string ="cpu"
PowerGrid : untyped string ="grid"
PowerSolar : untyped string ="solar"
PowerPowershare : untyped string ="powershare-backup"
ModeAvailable : untyped string ="available"
ModeDriving : untyped string ="driving"
ModePaused : untyped string ="paused"
Node : type =idlewatt.Node
Job : type =idlewatt.Job
minNameLen : untyped bigint =(3 <untyped> bigint)
maxNameLen : untyped bigint =(48 <untyped> bigint)
maxHardwareLen : untyped bigint =(80 <untyped> bigint)
minRegionLen : untyped bigint =(2 <untyped> bigint)
maxRegionLen : untyped bigint =(40 <untyped> bigint)
maxWorkloadLen : untyped bigint =(60 <untyped> bigint)
maxNoteLen : untyped bigint =(60 <untyped> bigint)
maxRateCents : untyped bigint =(100000 <untyped> bigint)
maxJobMinutes : untyped bigint =(1440 <untyped> bigint)
isSafeChar : func(c int32) bool Inspect
checkText : func(field string, s string, minLen int, maxLen int) Inspect
checkKind : func(kind string) Inspect
checkPower : func(power string) Inspect
checkRate : func(rate int64) Inspect
checkMode : func(kind string, mode string) Inspect