#[non_exhaustive]pub enum ControlMethod {
Show 37 variants
Status,
ConfigGet,
ConfigSetUpstream,
LogSetLevel,
CacheGet,
CacheSetCap,
CacheClear,
HostedStoresList,
HostedStoresPin,
HostedStoresUnpin,
HostedStoresStatus,
SyncStatus,
SyncTrigger,
UpdaterStatus,
UpdaterSetChannel,
UpdaterPause,
UpdaterResume,
UpdaterCheckNow,
PairingList,
PairingApprove,
PairingRevoke,
PeerStatus,
PeerCounts,
PeersConnect,
PeersDisconnect,
Subscribe,
Unsubscribe,
ListSubscriptions,
WalletBalance,
WalletCoins,
WalletCoinById,
WalletArrivals,
WalletPeak,
WalletSyncStatus,
WalletBroadcast,
PairingRequest,
PairingPoll,
}Expand description
A dig-node CONTROL method.
#[non_exhaustive] so adding a method in a minor release is additive; downstream matches must
carry a _ => … arm. Convert to/from the wire name with ControlMethod::name /
ControlMethod::from_name.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Status
control.status — a rich node status snapshot.
ConfigGet
control.config.get — the node’s effective configuration.
ConfigSetUpstream
control.config.setUpstream — persist an upstream-RPC override (effective on restart).
LogSetLevel
control.log.setLevel — live-swap the running node’s tracing level filter.
CacheGet
control.cache.get — the on-disk cache view (cap/used/dir/shared).
CacheSetCap
control.cache.setCap — set the cache size cap (floored at 64 MiB).
CacheClear
control.cache.clear — delete all locally cached content.
HostedStoresList
control.hostedStores.list — every held/pinned store with its cached capsules.
HostedStoresPin
control.hostedStores.pin — pin a store (and pre-fetch when a root is given).
HostedStoresUnpin
control.hostedStores.unpin — unpin a store and evict its cached capsules.
HostedStoresStatus
control.hostedStores.status — per-store pinned flag + cached capsules.
SyncStatus
control.sync.status — whether authenticated whole-store sync is available + pin coverage.
SyncTrigger
control.sync.trigger — trigger a §21 sync for one capsule (storeId + root).
UpdaterStatus
control.updater.status — the DIG auto-update beacon’s current status.
UpdaterSetChannel
control.updater.setChannel — set the beacon’s update channel.
UpdaterPause
control.updater.pause — suspend auto-updates (optionally until a unix time).
UpdaterResume
control.updater.resume — resume auto-updates.
UpdaterCheckNow
control.updater.checkNow — force an immediate update check.
PairingList
control.pairing.list — list pending pairing requests + issued paired tokens.
PairingApprove
control.pairing.approve — approve a pending pairing, minting a scoped token.
PairingRevoke
control.pairing.revoke — revoke an issued paired token.
PeerStatus
control.peerStatus — live peer-pool + relay-reservation snapshot.
PeerCounts
control.peerCounts — how many peers this node holds on EACH network (DIG and Chia).
PeersConnect
control.peers.connect — dial a peer by address / resolve a connected peer_id.
PeersDisconnect
control.peers.disconnect — drop a pooled peer by peer_id.
Subscribe
control.subscribe — subscribe the node to a store (watch + gap-fill).
Unsubscribe
control.unsubscribe — stop watching a store.
ListSubscriptions
control.listSubscriptions — the node’s persisted subscription set.
WalletBalance
control.wallet.balance — read an address’s confirmed spendable balance for an asset.
WalletCoins
control.wallet.coins — read an address’s spendable coin records for an asset.
WalletCoinById
control.wallet.coinById — read ONE coin record by coin id, spent or unspent.
WalletArrivals
control.wallet.arrivals — read confirmed INCOMING funds since a cursor position.
WalletPeak
control.wallet.peak — read the node’s current chain peak height.
WalletSyncStatus
control.wallet.syncStatus — read whether the wallet’s chain replica is being kept current.
WalletBroadcast
control.wallet.broadcast — push an ALREADY-SIGNED spend bundle to the network.
PairingRequest
pairing.request — request a control-token pairing (returns a code to compare).
PairingPoll
pairing.poll — poll a pairing; once the operator approves, returns the scoped token once.
Implementations§
Source§impl ControlMethod
impl ControlMethod
Sourcepub const ALL: &'static [ControlMethod]
pub const ALL: &'static [ControlMethod]
Every catalogued method, in a stable order — the enumeration a machine reads to discover the full control surface, and the anchor the conformance KATs pin against.
Sourcepub const fn name(self) -> &'static str
pub const fn name(self) -> &'static str
The stable JSON-RPC wire name. Never derived from anything else — the published contract.
Sourcepub fn from_name(name: &str) -> Option<ControlMethod>
pub fn from_name(name: &str) -> Option<ControlMethod>
Resolve a wire name back to its ControlMethod, or None for an unknown name.
Sourcepub const fn requires_auth(self) -> bool
pub const fn requires_auth(self) -> bool
Does calling this method require the local control token?
Three groups are reachable WITHOUT one, and they are open for two different reasons:
- the pairing bootstrap (
pairing.request/pairing.poll), so a token-less client can obtain a token at all; - the PEER COUNTS (
control.peerCounts), which disclose two integers about this node’s own connectivity and no address, endpoint or secret; - the wallet CALLER-ADDRESSED CHAIN READS (
control.wallet.balance/.coins/.coinById) and the node’s own chain POSITION (.peak/.syncStatus), because each needs only PUBLIC chain data the CALLER already named — an address, or a coin id; never a seed, a key, or a signature — and dig-node has servedcontrol.wallet.balanceopen since #1851. A person whose node runs as a service with an unreadable token file can still see their own money.
Two wallet methods are deliberately NOT in that second group.
control.wallet.broadcast puts bytes on the network, so the token is what stands between a
local process and a broadcast. control.wallet.arrivals names the wallet’s OWN watched
puzzle hashes back to a caller that supplied nothing — see
ControlMethod::is_open_read. On both, UNAUTHORIZED genuinely means unauthorized.
Sourcepub const fn is_open_read(self) -> bool
pub const fn is_open_read(self) -> bool
Is this an OPEN READ — served without a control token?
Two kinds of method qualify, and they are open for different reasons:
- the wallet CHAIN READS (
control.wallet.balance/.coins/.coinById/.peak/.syncStatus), which need only PUBLIC chain data — an address, or a coin id; never a seed, a key, or a signature. On the first three the CALLER supplies the address or coin id, so the node relays a public fact and discloses no association with itself; the last two name the node’s own chain position and no address at all; control.peerCounts, which is NOT a chain read: it discloses two integers about this node’s own connectivity, and no address, endpoint, peer identity or secret. The identity and topology half of the same subject stays gated behindcontrol.peerStatus.
Naming both reasons matters more than it looks. The test for membership is does this disclose only data that is already public, or a bare count of this node’s own state? — NOT is it a chain read? A future method judged against the narrower phrasing, and found to contradict a member that was already there, invites widening the predicate by analogy rather than against the rule.
control.wallet.arrivals is the worked example, and it was briefly a member. It passes the
narrower phrasing — every field it returns is a public chain fact — and fails the rule: the
caller supplies NOTHING, so the node volunteers its OWN watched puzzle hashes together with
the full receive history behind them. The individual facts are public; the ASSOCIATION
between this node and those addresses is not, and that association is the whole answer. A
token-less caller could then feed those addresses back into the caller-addressed reads.
Membership turns on who names the address, never on whether the bytes are on chain.
Stated on the contract rather than discovered by calling, because the two refusals a client
can get here demand OPPOSITE remedies. On an open read, UNAUTHORIZED can only come from a
node build that predates the method and gates it generically, so the remedy is an upgrade.
On a gated method — the push — UNAUTHORIZED means exactly what it says, and the remedy is
the token. A client that maps the two the same way sends somebody to fix the wrong thing.
Sourcepub const fn is_pairing_admin(self) -> bool
pub const fn is_pairing_admin(self) -> bool
Is this a PAIRING-ADMINISTRATION method that requires the MASTER control token specifically?
A paired (scoped) token can drive ordinary control.* mutations but MUST NOT mint more
tokens or revoke itself — so listing/approving/revoking pairings requires the master token
(a local file read), never a paired token.
Trait Implementations§
Source§impl Clone for ControlMethod
impl Clone for ControlMethod
Source§fn clone(&self) -> ControlMethod
fn clone(&self) -> ControlMethod
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more