Files
mesh-host/internal/buckets/buckets.go
T

35 lines
1.8 KiB
Go

// Package buckets holds the names of the bus buckets the node-engine reads and writes, and how many revisions it keeps of
// each. A contract carries the local name of a state, not the module that holds it (ADR 0625 §4, §7); the node-engine
// reads through grants composed in code, so the holder's name is kept here, in its own code (ADR 0634 §1, finding F4).
package buckets
import (
assigner "git.novox.be/novox/mesh-contracts/placement/go/clients/meshmoduleassignerclient"
seat "git.novox.be/novox/mesh-contracts/placement/go/seats/meshmoduleassigner"
wants "git.novox.be/novox/mesh-contracts/placement/go/seats/meshwants"
)
// The node-engine's own states and the have state, written by every node's engine for its own keys.
const (
// Have holds a module's have on a node, `<node>.<module>`, and the node's own facts, `<node>.node`.
Have = "node-engine_have"
// Data holds a module's data items on a node.
Data = "mesh-host_data"
// Health holds a node's own health report.
Health = "mesh-host_health"
)
// HaveHistory is the number of revisions the have bucket keeps per key.
const HaveHistory = 20
// The states of the placement seat's holder and of the wants seat's holder that the engine reads, named by the holder's
// module as every state is (ADR 0634 §1, finding F4: the holder's name is kept here, in the engine's code).
const (
// Placement holds a node's placement, `<node>.node`, and each of its modules, `<node>.<module>`.
Placement = assigner.PlacementBucket
// PlacementCandidates holds a node's candidate of a proposal, `<proposal>.<node>`.
PlacementCandidates = assigner.Module + "_" + seat.StateCandidates
// Wants holds what each node should run, `want.<node>.<module>` and `want.<node>.node`.
Wants = assigner.Module + "_" + wants.StateWants
)