Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Selectors

Every entry in a monitor’s selectors list is a selector: a reference to one contract spec, an optional address restriction, and a choice of what that spec has on offer to actually decode. Selector keys are decoder-owned. An unrecognized key is rejected by name by that family’s compiler, not by a shared schema. Which keys a family admits, and what each kind decodes, lives on the family page.

What a selector can produce also depends on which source module happens to be feeding its network. A kind the decoder accepts can still be a no-op if that source never supplies the corresponding raw material; that pairing is family-owned too.

flowchart LR
    rpc["RPC endpoints<br/>(external chains)"]
    %% Source modules are family-owned; the running list is GET /catalog, not this map.
    sources["Sources<br/>one per network"]
    sinks["Sinks<br/>webhook · script · log"]
    storage["Storage<br/>checkpoints · dead letters · resources"]
    api["REST API"]
    metrics["Metrics"]
    engine["engine<br/>bounded channels · checkpoints"]

    subgraph pipeline["Engine pipeline"]
        direction LR
        decoder["Decoder"]
        matcher["Matcher<br/>predicates"]
        gate["Gate<br/>threshold · max_once"]
        decoder --> matcher
        matcher --> gate
    end

    rpc --> sources
    sources -->|"decode and match"| decoder
    gate --> sinks
    api -->|"manages resources"| storage
    storage <--> engine
    engine -->|"drives"| pipeline
    engine -.->|"reports"| metrics

    classDef module fill:none,stroke:#a9a3e3
    classDef core fill:none,stroke:#8a8d86,stroke-dasharray: 5 5

    class rpc,sources,sinks,decoder,matcher,gate module
    class engine,api,storage,metrics core
classDef dim fill:none,stroke:#999999,color:#999999,opacity:0.35
classDef focus fill:#ffd43b,stroke:#d9480f,stroke-width:3px,color:#1a1a1a
class rpc,sinks,storage,api,metrics,engine,decoder,matcher,gate dim
class sources focus
click sources "selectors.html"
click decoder "chain-agnosticism.html"
click matcher "predicates.html"
click gate "gates.html"
click sinks "delivery.html"
click storage "resources.html"
click api "../reference/http-api.html"
click metrics "../reference/observability.html"
click engine "pipeline.html"

Key takeaways

  • Selector keys are decoder-owned. The family’s compiler rejects an unrecognized key by name.
  • A selector’s kind keys are independent dispatch tables; leaving every kind key unset selects everything the referenced spec declares. An explicit empty array for a kind list is invalid, not “select nothing.”
  • What a given kind actually fires on depends on the network’s source. The family page states that pairing.
  • A source whose cursor is not a chain position cannot make at-least-once promises. That constraint is Delivery guarantees; which shipped sources it applies to is on the family page.

Predicates covers how a predicate reads decoded data; The pipeline covers where decoding and matching run.