Chainlink Documentation

repository·develop·Indexed 27 days ago

https://github.com/smartcontractkit/chainlink

Core node software and smart contracts for Chainlink, a decentralized oracle network. Includes documentation on the Cross-Chain Interoperability Protocol (CCIP) capability launcher, active/candidate deployment patterns, TOML-based configuration, and developer tools such as the Chainlink CLI, ccip-revert-reason, and chaincli for OCR2Keepers management.

Tokens
128.5K
Snippets
326
Records
799
Agent score
91%

What's inside Chainlink

  1. Introduction to Seth

    develop

    Seth is an Ethereum client used for integration tests. It acts as a thin wrapper over the go-ethereum client, providing enhanced features for:

    • Key management
    • Transaction decoding and tracing
    • Gas estimation

    By default, Seth uses reasonable settings defined in the [Seth] section of default.toml. You can override these settings in your own TOML files (e.g., overrides.toml or product-specific files) to suit your testing needs.

  2. Overview of Devenv

    develop

    devenv is a self-contained Go module (github.com/smartcontractkit/chainlink/devenv) that provides a Docker-based development and testing environment for Chainlink products. It orchestrates local blockchain networks, Chainlink nodes, mock external adapters (fakes), and product-specific contract deployments.

    Key design principles:

    • Dependency isolation: It does not import github.com/smartcontractkit/chainlink/v2 to keep the test environment decoupled from the core node codebase.
    • TOML-driven configuration: Infrastructure and product settings are declared in composable TOML files that merge left-to-right.
    • Two-phase testing: Environment setup (via the cl CLI) and test execution (via go test) are separate processes, connected by a shared env-out.toml output file.
    • Product abstraction: Each product implements a common Product interface.
  3. Overview of HTTP Handlers V2

    develop

    HTTP Handlers V2 implements the Gateway Handler interface for the Chainlink Runtime Environment (CRE). It enables workflows to interact with external systems through two primary mechanisms:

    1. HTTP Actions: Outbound HTTP requests from workflow nodes to external endpoints, featuring caching and rate limiting.
    2. HTTP Triggers: Inbound HTTP requests that initiate workflow executions, secured via JWT-based authentication.

    The system also manages authentication metadata aggregation and provides Byzantine fault-tolerant (BFT) response aggregation.

  4. Overview of Local CRE

    develop

    Local CRE is a developer environment designed for building, running, and testing Chainlink Compute Runtime Engine (CRE) workflows locally. It manages the environment lifecycle (located in core/scripts/cre/environment) and includes smoke-test flows (located in system-tests/tests/smoke/cre).

    Use Local CRE to:

    • Bootstrap a local CRE stack on Docker or Kubernetes.
    • Select or inspect environment topologies.
    • Deploy and debug workflows.
    • Run or extend CRE smoke tests.
    • Understand how test helpers interact with a running Local CRE environment.
    • Reuse repo-local agent guidance found under docs/local-cre/agent-skills/local-cre-e2e/.
  5. Trace the general Chainlink data flow

    develop

    The Chainlink node architecture follows a producer-consumer pattern driven by blockchain events (like OnNewLongestChain or HandleLog).

    Core Flow Components

    • Headtracker: Tracks the latest block headers. It broadcasts new heads to various components like BlockHistoryEstimator, Txm (Transaction Manager), UpkeepExecuter, and the broadcaster.
    • Log Listener: Acts as the primary entry point for blockchain logs. It delivers logs to specific service listeners:
      • directrequest (Oracle requests/cancellations)
      • functions (Functions oracle events)
      • keeper (Registry synchronization)
      • ocr (OCR contract tracking)
      • vrf (VRF request logs)

    Key Data Paths

    • Chain Updates: HeadTrackable $\rightarrow$ BlockHistoryEstimator / broadcaster / Txm / UpkeepExecuter / promReporter.
    • Log Processing: Listener $\rightarrow$ directrequest / functions / RegistrySynchronizer / OCRContractTracker / vrf listener.