Inside Bitcoin
Opening the selected file…
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1// Copyright (c) 2009-2010 Satoshi Nakamoto2// Copyright (c) 2009-present The Bitcoin Core developers3// Distributed under the MIT software license, see the accompanying4// file COPYING or http://www.opensource.org/licenses/mit-license.php.6#ifndef BITCOIN_COMMON_SYSTEM_H7#define BITCOIN_COMMON_SYSTEM_H9#include <bitcoin-build-config.h> // IWYU pragma: keep11#include <util/time.h>13#include <cstdint>14#include <optional>15#include <string>17/// Monotonic uptime (not affected by system time changes).18SteadyClock::duration GetUptime();20void SetupEnvironment();21[[nodiscard]] bool SetupNetworking();22#ifndef WIN3223std::string ShellEscape(const std::string& arg);24#endif25#if HAVE_SYSTEM26void runCommand(const std::string& strCommand);27#endif29/**30* Return the number of cores available on the current system.31* @note This does count virtual cores, such as those provided by HyperThreading.32*/33int GetNumCores();35/**36* Return the total RAM available on the current system, if detectable.37*/38std::optional<uint64_t> TryGetTotalRam();40#endif // BITCOIN_COMMON_SYSTEM_H