# Code Storage Source: https://docs.pulsy.app/atria/architecture/code-storage Learn where feed code lives in Atria. # Code Storage Atria stores feed code separately from feed metadata. ## What Is Stored * Filter JavaScript. * Optional function JavaScript. * File paths linked from feed records. ## Storage Backends Deployments can use local file storage or object storage depending on configuration. ## Why It Matters Keeping code in file storage allows feeds to keep metadata in PostgreSQL while loading executable code only when needed for testing or deployment. For how feed definitions point to code files, see [feed manifest](/atria/core-concepts/feed-manifest). # Delivery Source: https://docs.pulsy.app/atria/architecture/delivery See how Atria delivers matching feed results. # Delivery The Delivery service picks up feed results and invokes the feed's configured outputs. ## Delivery Flow ```mermaid theme={null} flowchart TB Runtime[Runtime publishes feed result] --> Stream[Feed result stream] Stream --> Delivery[Delivery service reads result] Delivery --> Config[Load configured outputs] Config --> Invoke[Invoke output] Invoke --> Success{Output succeeds?} Success -->|Yes| Ack[Acknowledge result] Success -->|No| Retry[Retry delivery] Retry --> Pause[Pause feed after repeated failures] ``` ## Webhooks Webhook delivery is the supported output type available today. Each webhook output includes a URL, HTTP method, headers, and timeout settings. Headers can be used to pass authentication or other verification values your endpoint requires. ## Retries The Delivery service retries failed webhook sends. If delivery keeps failing, it can request that the feed be paused. ## Decoupling Delivery is decoupled from feed execution. This lets the Runtime publish matched results while the Delivery service invokes the configured outputs separately. # Ingestion Source: https://docs.pulsy.app/atria/architecture/ingestion Learn how Atria reads blockchain data for feeds. # Ingestion The Ingestor connects to configured blockchain networks, reads block data, and writes normalized payloads into Atria's block store. EVM networks are supported today, with additional chain families on the roadmap. ## What It Reads * Blocks with transactions. * Blocks with logs. * Debug traces. ## Network Flow ```mermaid theme={null} flowchart LR RPC[HTTP RPC] --> Ingestor WS[WebSocket blocks] --> Ingestor Ingestor --> Blocks[Block data store] Ingestor --> State[Chain state store] ``` ## Realtime and Fallback The Ingestor can listen for new blocks over WebSocket and uses polling fallback so feeds can continue processing when a WebSocket signal is delayed or unavailable. For chain reorganizations, see [reorg handling](/atria/architecture/reorg-handling). # Leases and Cursors Source: https://docs.pulsy.app/atria/architecture/leases-and-cursors Understand how Atria coordinates work and progress. # Leases and Cursors Atria uses leases to decide which service instance owns work, and cursors to track feed progress. A lease is a temporary ownership claim. It is not a user-facing feed setting. It is an internal coordination mechanism that helps Atria avoid duplicate processing. ## Runtime Lease A runtime lease marks which runtime instance owns a feed. This prevents multiple runtime instances from processing the same feed at the same time. ## Delivery Lease A delivery lease coordinates delivery workers so feed outputs are not delivered by multiple workers at once. ## Cursor The cursor stores the next block number a feed should process. ```mermaid theme={null} flowchart LR Runtime[Runtime instance] --> Lease[Acquire feed lease] Lease --> Cursor[Read cursor] Cursor --> Process[Process next block] Process --> Save[Save next cursor] ``` See [cursors and block delay](/atria/core-concepts/cursors-and-block-delay). # Orchestrator Source: https://docs.pulsy.app/atria/architecture/orchestrator Learn how Atria coordinates deployments and feed health. # Orchestrator The Orchestrator coordinates feed deployment, status transitions, delivery configuration requests, and runtime health. ## Responsibilities * Handles feed deploy requests. * Tracks `Pending`, `Running`, `Paused`, `Error`, and `Completed` transitions. * Confirms runtime deployment events. * Responds to delivery services with output configuration. * Provisions feeds and outputs from manifests. ## Control Flow ```mermaid theme={null} sequenceDiagram participant Control as Control plane participant Orchestrator participant Runtime Control->>Orchestrator: feed.deploy.req Orchestrator->>Runtime: deploy feed Runtime->>Orchestrator: feed.deployed Orchestrator->>Control: update feed status ``` # Reorg Handling Source: https://docs.pulsy.app/atria/architecture/reorg-handling Learn how Atria handles chain reorganizations. # Reorg Handling Blockchain reorganizations can replace previously observed blocks. Atria tracks block hashes and parent hashes so the Ingestor can detect when the local chain view diverges from the network. ## Detection For each new block, the Ingestor compares the block parent hash with the stored hash of the previous block. A mismatch indicates a possible reorg. ## Response When a reorg is detected, Atria searches back to a common ancestor, rewinds stored state, and publishes a reorg event. ```mermaid theme={null} flowchart LR NewBlock[New block] --> Compare[Compare parent hash] Compare --> Match{Matches stored hash?} Match -->|Yes| Store[Store block] Match -->|No| Rewind[Find ancestor and rewind] Rewind --> Event[Publish reorg event] ``` ## Feed Impact Feeds receive metadata that includes `isReorg`. Feed authors can use this field when they need reorg-aware behavior. For payload shapes, see [data types](/atria/core-concepts/data-types). # Runtime Source: https://docs.pulsy.app/atria/architecture/runtime Learn how Atria runs feed logic. # Runtime The Runtime executes deployed feeds. It claims feed leases, reads block data, runs filters, optionally runs functions, and publishes feed results. A lease is a temporary ownership claim for a feed, used to keep execution coordinated when more than one runtime instance exists. ## Runtime Flow ```mermaid theme={null} flowchart LR Deploy[Deploy request] --> Lease[Runtime lease] Lease --> Cursor[Load cursor] Cursor --> Blocks[Read blocks] Blocks --> Filter[Run filter] Filter --> Function[Optional function] Function --> Results[Publish result] Results --> Cursor ``` ## Filter Execution Filters run in a V8 JavaScript environment. They are compiled once per feed deployment and executed for each payload. Bundled modules include: * `ethers` * `@atria/sdk` * `@atria/kv` For more details, see [filters](/atria/core-concepts/filters). ## Function Execution If a feed includes a function, the Runtime runs it after the filter emits a result. The function receives the filter result and can perform post-filter work such as external lookups, managed database reads, heavier business logic, or action-specific preparation. In the current runtime, functions run in a Fission-based serverless environment. If the filter returns `null` or `undefined`, the feed does not emit and the function is not called. If the feed has no function, the filter result becomes the feed result. For more details, see [functions](/atria/core-concepts/functions). ## Cursors The Runtime stores a cursor per feed. When a feed restarts, it resumes from the last stored block unless a new start block is configured. For coordination details, see [leases and cursors](/atria/architecture/leases-and-cursors). ## Limits Execution time, heap size, stack usage, and output size are bounded by runtime settings. See [security and sandboxing](/atria/architecture/security-and-sandboxing). # Security and Sandboxing Source: https://docs.pulsy.app/atria/architecture/security-and-sandboxing See how Atria keeps feed execution constrained. # Security and Sandboxing Atria runs feed filters in a constrained JavaScript environment. The goal is to let teams write useful feed logic while limiting runtime risk. ## Sandbox Controls The JavaScript wrapper and runtime disable or constrain risky behavior: * `eval` is disabled. * The `Function` constructor is blocked. * WebAssembly, shared memory primitives, and atomics are removed. * Common prototypes are frozen. * Console output is suppressed. * Execution timeout is enforced. * Heap, stack, and output size limits are enforced. ## Module Loading Filters can only `require` modules made available by the runtime configuration. Current bundled modules include `ethers`, `@atria/sdk`, and `@atria/kv`. # Storage and Messaging Source: https://docs.pulsy.app/atria/architecture/storage-and-messaging Explore the storage and messaging layers behind Atria. # Storage and Messaging Atria uses PostgreSQL for product metadata and NATS for event streams, block storage, leases, cursors, and chain state. ## PostgreSQL PostgreSQL stores: * Feeds. * Outputs. * Tags. * Feed-output links. * Deploy records. * Status history. ## NATS JetStream and KV NATS is used for: * Feed deploy requests. * Feed deployed events. * Pause events. * Feed result streams. * Block data buckets. * Chain state. * Runtime and delivery leases. * Feed cursors. ## High-Level Map ```mermaid theme={null} flowchart TB Backend[Management backend] --> PG[(PostgreSQL metadata)] Orchestrator --> PG Ingestor --> KV[(NATS KV block data)] Runtime --> KV Runtime --> JS[(JetStream results)] Delivery --> JS ``` For feed result delivery, see [delivery](/atria/architecture/delivery). # System Overview Source: https://docs.pulsy.app/atria/architecture/system-overview Meet the main services that make up Atria. # System Overview Atria is composed of focused services that separate control, ingestion, execution, and delivery. ## Services * **Dashboard**: Web UI for creating and monitoring feeds. * **Management backend**: Coordinates feed metadata, outputs, tags, configuration, deploys, and results for the Dashboard and automation. * **Orchestrator**: Deployment coordination, lease checks, status updates, and local provisioning. * **Ingestor**: Blockchain connectivity and block data ingestion. * **Runtime**: Feed execution, cursor management, filters, and optional functions. * **Delivery**: Result consumption and webhook delivery. ```mermaid theme={null} flowchart TB Blockchain[Blockchain networks] --> Ingestor Dashboard --> Backend[Management backend] Backend --> Database[(PostgreSQL)] Backend --> Orchestrator Ingestor --> NATS[(NATS JetStream and KV)] Runtime --> NATS NATS --> Runtime Orchestrator --> Runtime Runtime --> Delivery Delivery --> Webhooks[Webhook destinations] ``` ## Infrastructure Atria uses PostgreSQL for core metadata and NATS JetStream/KV for messaging, leases, cursors, chain state, and block data. See [storage and messaging](/atria/architecture/storage-and-messaging). For runtime ownership and progress tracking, see [leases and cursors](/atria/architecture/leases-and-cursors). # Atria 0.8.23 Source: https://docs.pulsy.app/atria/changelog/0-8-23 Share a feed with a public link, let anyone start from it, and read per-feed metrics in the dashboard. **Released July 24, 2026** This release adds public sharing for feeds. You can send someone a link to a feed and they can read its code and watch its events arrive live, without an account. It also gives every feed a Metrics tab, and fixes a set of problems on small screens.