Documentation
¶
Overview ¶
Package nodeprofile persists the INSTALL-TIME node tier so a Lantern install runs as the class the operator chose - Light, PDP, or Full - without the operator re-passing runtime flags on every start, and crucially WITHOUT forcing the light node to carry the PDP footprint.
The tier is chosen once by the installer (get.golantern.io) and written to <home>/<network>/node-profile.json. The daemon reads it at startup to pick tier-appropriate defaults (memory vs persistent cache, block-submit availability, cache budget). Runtime flags still override, so this is a default source, not a lock.
Why a file and not a flag: a flag would mean one universal binary where every user - including a wallet-only light node - carries the machinery (and the operator has to remember the flags). Making tier an install-time property keeps the light node genuinely light and lets the installer provision only what the chosen tier needs.
Index ¶
Constants ¶
const DefaultFullCacheBytes int64 = 12 << 30
DefaultFullCacheBytes is the persistent-cache budget written for a Full tier install when the operator doesn't override --cache-gb. A Full node serves the whole chain surface (not just PDP contract subtrees), so it needs a bigger warm working set than PDP. 12 GiB is single-to-low-double- digit GB territory (see #92) with plenty of headroom for a Mac-mini deployment while staying well below Lotus's 76 GB baseline.
const DefaultPDPCacheBytes int64 = 3 << 30
DefaultPDPCacheBytes is the persistent-cache budget written for a PDP install: 3 GiB, the middle of the 2-5 GB tier target.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Profile ¶
type Profile struct {
// Tier is the node class. Empty/unknown is treated as Light.
Tier Tier `json:"tier"`
// PersistentCacheBytes is the block-cache soft budget for tiers that
// use a persistent cache (PDP/Full). 0 => tier default.
PersistentCacheBytes int64 `json:"persistent_cache_bytes,omitempty"`
// AllowBlockSubmit records that the operator opted the node in as a
// block producer / backup at install time. Still requires a VM bridge
// at run time; recorded here so the daemon can surface the requirement.
AllowBlockSubmit bool `json:"allow_block_submit,omitempty"`
}
Profile is the persisted install-time node configuration.
func Load ¶
Load reads the profile for home+network. A missing file is NOT an error: it returns a Light profile (the safe default for any pre-existing install that predates node tiers). A malformed file returns an error so the operator notices, rather than silently downgrading a PDP node.
func (Profile) CacheBytes ¶
CacheBytes returns the effective persistent-cache budget for the tier (falling back to the tier default when unset).
func (Profile) FullValidation ¶
FullValidation reports whether this tier runs the pure-Go full-node per-block consensus pipeline (chain/fullvalidate, #90). Only the Full tier does; Light/PDP rely on the F3-anchored trusted root without re-verifying every block's VRF/signature/win-count.
func (Profile) Normalize ¶
Normalize coerces an unknown/empty tier to Light so a malformed or absent profile degrades safely to the smallest footprint.
func (Profile) UsesPersistentCache ¶
UsesPersistentCache reports whether the tier wants an on-disk block cache.
type Tier ¶
type Tier string
Tier is the node class chosen at install time.
const ( // TierLight is the default ~1 GB wallet/deal-client/read node: // in-memory cache, no write/production surface beyond sending txs. TierLight Tier = "light" // TierPDP is the mid node: a persistent (2-5 GB) block cache with the // warm contract set pinned, plus the full write surface INCLUDING // block production, so it can prove/settle PDP and double as a backup // block producer (block production still needs a VM bridge - the // no-CGo wall). TierPDP Tier = "pdp" // TierFull is reserved for the full-node feasibility track. Not yet // buildable bridge-off (native FVM execution needs CGo/filecoin-ffi); // accepted here so the profile format is forward-compatible and the // installer can record the intent. TierFull Tier = "full" )