Documentation
¶
Overview ¶
validator.go reads the hanzo.network (the Hanzo EVM) mainnet validator set — the source of truth for the FREE fleet-billing tier. A connected box whose validator address is in the set is natively available to the cloud at no fee (it already earns validator economics and secures the chain). The chain is READ, never written, and is authoritative.
HONESTY CONTRACT (never fabricate an on-chain fact): the free exemption is granted ONLY on a POSITIVE, verified membership read. When the lookup is not wired, or a wired lookup errors, the exemption is NOT granted — it is flagged "pending chain wiring" / "lookup error" and the box is billed like any device until the chain confirms it. So a real validator's exemption activates automatically once the operator wires the lookup; nothing is ever exempted on an unverified claim.
Index ¶
Constants ¶
const ( ValidatorStatusExempt = "exempt" // verified on-chain validator → free ValidatorStatusBilled = "billed" // verified NOT a validator → billed as a device ValidatorStatusPending = "pending-chain-wiring" // lookup unwired → cannot verify → billed, flagged ValidatorStatusError = "lookup-error" // wired lookup failed → billed (fail-safe), flagged )
Exemption status strings surfaced to the meter, logs, and the connect response.
Variables ¶
This section is empty.
Functions ¶
func ValidatorExemption ¶
ValidatorExemption reports whether address qualifies for the free validator tier.
not wired -> (false, ValidatorStatusPending, nil) // never fabricate; billed, flagged wired + in set -> (true, ValidatorStatusExempt, nil) // free / native wired + not in set -> (false, ValidatorStatusBilled, nil) // billed as a device wired + error -> (false, ValidatorStatusError, err) // fail-safe: billed, error surfaced
The caller grants the free tier iff the returned bool is true, and records status for observability regardless.
func ValidatorLookupWired ¶
func ValidatorLookupWired() bool
ValidatorLookupWired reports whether the validator-set lookup is configured.
Types ¶
type ChainClientInterface ¶
type ChainClientInterface interface {
Commit(data string) (string, string, error)
Query(txId string, data string) (string, error)
}
func NewChainClient ¶
type ChainTencentChainmakerClient ¶
type ChainTencentChainmakerClient struct {
ClientId string
ClientSecret string
Region string
NetworkId string
ChainId string
Client *tbaas.Client
}
type ChainTencentChainmakerDemoClient ¶
type ChainTencentChainmakerDemoClient struct {
ClientId string
ClientSecret string
Region string
NetworkId string
ChainId string
Client *tbaas.Client
}