Daemon

A daemon is a computer program that runs as a background process, rather than being directly controlled by an interactive user, often performing system-level...

In computing, a daemon (pronounced 'dee-mon') is a type of program that runs as a background process, rather than being under the direct control of an interactive user. Daemons are typically started at boot time or when a specific service is initiated and continue to run indefinitely, waiting for events to occur or performing tasks periodically. They are often used to provide services that other programs or users can access, such as web servers (e.g., Apache httpd), database servers (e.g., mysqld), or network services (e.g., sshd). The name 'daemon' originates from Greek mythology, referring to a supernatural being, and was adopted in computing to signify a process that works tirelessly in the background. Daemons are designed to be long-running and often detached from any controlling terminal, meaning they continue to execute even if the user who started them logs out. They typically perform system-level tasks, manage resources, or respond to network requests. In the context of blockchain nodes (e.g., Bitcoin Core or Geth for Ethereum), daemon processes are crucial for maintaining the network connection, validating transactions, synchronizing the blockchain ledger, and relaying information to other nodes. These daemons listen for incoming transactions and blocks, process them according to the protocol rules, and update the local copy of the distributed ledger.

        graph LR
  Center["Daemon"]:::main
  Rel_advanced_propulsion_systems["advanced-propulsion-systems"]:::related -.-> Center
  click Rel_advanced_propulsion_systems "/terms/advanced-propulsion-systems"
  Rel_function["function"]:::related -.-> Center
  click Rel_function "/terms/function"
  classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
  classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
  classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
  classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
  linkStyle default stroke:#4b5563,stroke-width:2px;

      

🧠 Knowledge Check

1 / 5

🧒 Explain Like I'm 5

It's like a helpful robot that works quietly in the background on your computer, doing important jobs without you needing to tell it what to do all the time.

🤓 Expert Deep Dive

Daemon processes are fundamental to the operation of distributed systems, including blockchain networks. They typically run as user-level processes, often with elevated privileges, and are managed by the operating system's init system (e.g., systemd, launchd). Key characteristics include detachment from the controlling terminal (using fork and setsid system calls in Unix-like systems), continuous execution, and responsiveness to system events or network I/O. In blockchain clients, the daemon process is responsible for the core node logic: P2P networking, consensus participation, transaction mempool management, and block propagation. Robust error handling, logging, and resource management are critical for daemon stability, as failures can impact network connectivity and consensus participation. The design often involves event loops and asynchronous I/O to efficiently handle multiple concurrent network connections and tasks without blocking.

📚 Sources