Inside Bitcoin
Opening the selected file…
Inside Bitcoin
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) The Bitcoin Core developers2# Distributed under the MIT software license, see the accompanying3# file COPYING or https://opensource.org/license/mit/.5{ pkgs ? import (builtins.fetchTarball {6# Pin, to keep the versions of the toolchain aligned with the versions used by Guix.7url = "https://github.com/NixOS/nixpkgs/archive/531670d871c0e29724a02f3cbcac170adc65b58c.tar.gz";8}) {} }:10let11host = builtins.getEnv "HOST";12baseCrossPkgs = if host == "x86_64-w64-mingw32ucrt"13then pkgs.pkgsCross.ucrt6414else if host == "x86_64-w64-mingw32"15then pkgs.pkgsCross.mingwW6416else throw "Unsupported HOST: ${host}";17crossPkgs = baseCrossPkgs.extend (_: _: {18threads = {19model = "posix";20package = null;21};22});23toolchain = crossPkgs.stdenv.cc.targetPrefix;24pthreads = crossPkgs.windows.pthreads;25crossGcc = crossPkgs.buildPackages.gcc14;26gcc = crossGcc.override {27cc = crossGcc.cc.overrideAttrs (old: {28# Keep target pthread headers out of GCC's native build tools.29env = old.env // {30EXTRA_FLAGS_FOR_TARGET =31"${old.env.EXTRA_FLAGS_FOR_TARGET} -idirafter ${pthreads}/include -B${pthreads}/lib";32EXTRA_LDFLAGS_FOR_TARGET =33"${old.env.EXTRA_LDFLAGS_FOR_TARGET} -Wl,-L${pthreads}/lib";34};35});36extraPackages = [ pthreads ];37};38in40pkgs.mkShellNoCC {41packages = [ gcc pkgs.nsis ];43shellHook = ''44export CC=$(command -v ${toolchain}gcc)45export CXX=$(command -v ${toolchain}g++)46export LD=$(command -v ${toolchain}ld)47export AR=$(command -v ${toolchain}ar)48export AS=$(command -v ${toolchain}as)49export RANLIB=$(command -v ${toolchain}ranlib)50export NM=$(command -v ${toolchain}nm)51export STRIP=$(command -v ${toolchain}strip)52export OBJCOPY=$(command -v ${toolchain}objcopy)53export OBJDUMP=$(command -v ${toolchain}objdump)54export READELF=$(command -v ${toolchain}readelf)55export SIZE=$(command -v ${toolchain}size)56export WINDRES=$(command -v ${toolchain}windres)57export RC=$(command -v ${toolchain}windres)58'';59}
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.