<p>Regarding the order in which files are read and processed, the precise sequence can vary based on the version of Bitcoin Core and the specific actions taken by the user. However, in general, the following order is likely to occur:</p>
<ol>
<li>Read <code>bitcoin.conf</code>: The configuration file is read early in the initialization process to apply any custom settings.</li>
<li>Load Blockchain Data: Bitcoin Core begins loading and verifying the blockchain data, which is essential for the application's operation.</li>
<li>Wallet Initialization: If a wallet is present or created, the wallet data is loaded, making it possible to access your funds and perform wallet-related operations.</li>
<li>User Interface: Once the critical components are in place, the user interface is displayed, providing access to the various features of Bitcoin Core.</li>
</ol>

CC BY-SA 4.0
2023-08-07T10:42:44.103Z
But isn't the bitcoin-qt file a binary file? Are all the source files compiled into binary code for the bitcoin-qt binary file? In what way is that binary code ordered and processed by the processor?
Eoin
CC BY-SA 4.0
2023-08-07T13:56:16.817Z
@EoinMcQuinn The binary that is produced by the compiler will do exactly what the source code instructs it to do. And I think the part of your questions here relating to source files and the compilation process are off-topic here, as they're unrelated to Bitcoin. I suggest taking a programming course if you're interested in that.
Pieter Wuille
CC BY-SA 4.0
2023-08-07T06:05:49.110Z
2023-08-07T06:05:49.110Z
Mani T
<p>Does the computer read all of the files in the Bitcoin application at the same time, or which files get read and processed before other files?</p>

CC BY-SA 4.0
2023-08-06T15:43:56.863Z
By "files in the application" do you mean the data files (blockchain, wallet, mempool, fee estimates, peers data, config, ...)? The application ifself just consists of a binary executable file (bitcoin-qt.exe or bitcoind.exe, if you're on Windows).
Pieter Wuille
CC BY-SA 4.0
2023-08-06T18:02:14.420Z
Yes, I am referring to the data files and all the other files listed on github.com/bitcoin/bitcoin. I'm on Linux.
Eoin
CC BY-SA 4.0
2023-08-06T18:30:44.357Z
The files in the github repository are just the source code files from which the application is built. As a user of the software, you generally won't have those on your system even; they're just used to build the bitcoin-qt.exe file (and related binaries).
Pieter Wuille
CC BY-SA 4.0
2023-08-06T18:48:48.730Z
Is there a bitcoin-qt.exe file in a linux setup?
Eoin
CC BY-SA 4.0
2023-08-06T18:56:13.457Z
It's just called `bitcoin-qt` there (Linux systems don't use filename extensions like that).
Pieter Wuille
CC BY-SA 4.0
2023-08-06T21:02:52.473Z
So in the bitcoin-qt binary file in a  Linux setup there are just 1's and 0's? When you say binary this is how I would interpret the word 'binary'.
Eoin
CC BY-SA 4.0
2023-08-06T21:06:02.507Z
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/147730/discussion-between-eoin-mcquinn-and-pieter-wuille).
Eoin
CC BY-SA 4.0
2023-08-06T22:42:53.010Z
A "binary" is a generic computer term for files that are not human readable but are interpreted by the CPU. Pretty much all software you run on your computer consists of binaries.
Pieter Wuille
CC BY-SA 4.0
2023-08-07T10:50:49.147Z
According to https://insidebitcoincode.substack.com/p/ibc003-the-main-function there is a specific order in which the source files are processed.The main() function is processed first. It this correct? So the compiler orders the binary code to facilitate this - am I correct?
Eoin
CC BY-SA 4.0
2023-08-07T14:00:26.673Z
The compiler proceses the files in whatever order it likes, it doesn't matter (and in fact, may well be random). The outcome must be and is a binary that does what the source code instructs it to do. That substack page digs into what functions are called at startup and what order, but that has nothing to do with processing files - the files don't matter anymore after compilation. If you want to understand what the source code intends to do, I suggest taking a C++ course, as this will turn into a far too broad topic otherwise here
Pieter Wuille
CC BY-SA 4.0
2023-08-07T14:22:37.700Z
I am studying C++ at learncpp.com.
Eoin
<bitcoin-core>
What happens under the hood when the Bitcoin Core application is launched i.e. when the bitcoin icon is clicked on the computer's desktop?
Eoin
# What happens under the hood when the Bitcoin Core application is launched i.e. when the bitcoin icon is clicked on the computer's desktop?

(Asked by: username_0 on 2023-08-06)

Does the computer read all of the files in the Bitcoin application at the same time, or which files get read and processed before other files?

**Tags:** bitcoin-core

> **Comments:**
> **username_1**: By "files in the application" do you mean the data files (blockchain, wallet, mempool, fee estimates, peers data, config, ...)? The application ifself just consists of a binary executable file (bitcoin-qt.exe or bitcoind.exe, if you're on Windows).  
> **username_0**: Yes, I am referring to the data files and all the other files listed on github.com/bitcoin/bitcoin. I'm on Linux.  
> **username_1**: The files in the github repository are just the source code files from which the application is built. As a user of the software, you generally won't have those on your system even; they're just used to build the bitcoin-qt.exe file (and related binaries).  
> **username_0**: Is there a bitcoin-qt.exe file in a linux setup?  
> **username_1**: It's just called `bitcoin-qt` there (Linux systems don't use filename extensions like that).  
> **username_0**: So in the bitcoin-qt binary file in a  Linux setup there are just 1's and 0's? When you say binary this is how I would interpret the word 'binary'.  
> **username_0**: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/147730/discussion-between-username_0-mcquinn-and-username_1-username_1).  
> **username_1**: A "binary" is a generic computer term for files that are not human readable but are interpreted by the CPU. Pretty much all software you run on your computer consists of binaries.  
> **username_0**: According to https://insidebitcoincode.substack.com/p/ibc003-the-main-function there is a specific order in which the source files are processed.The main() function is processed first. It this correct? So the compiler orders the binary code to facilitate this - am I correct?  
> **username_1**: The compiler proceses the files in whatever order it likes, it doesn't matter (and in fact, may well be random). The outcome must be and is a binary that does what the source code instructs it to do. That substack page digs into what functions are called at startup and what order, but that has nothing to do with processing files - the files don't matter anymore after compilation. If you want to understand what the source code intends to do, I suggest taking a C++ course, as this will turn into a far too broad topic otherwise here  
> **username_0**: I am studying C++ at learncpp.com.  

---

## 1 answers

### Answer by username_2 on 2023-08-07. Score: 1

Regarding the order in which files are read and processed, the precise sequence can vary based on the version of Bitcoin Core and the specific actions taken by the user. However, in general, the following order is likely to occur:

1. Read `bitcoin.conf`: The configuration file is read early in the initialization process to apply any custom settings.
2. Load Blockchain Data: Bitcoin Core begins loading and verifying the blockchain data, which is essential for the application's operation.
3. Wallet Initialization: If a wallet is present or created, the wallet data is loaded, making it possible to access your funds and perform wallet-related operations.
4. User Interface: Once the critical components are in place, the user interface is displayed, providing access to the various features of Bitcoin Core.

> **Comments:**
> **username_0**: But isn't the bitcoin-qt file a binary file? Are all the source files compiled into binary code for the bitcoin-qt binary file? In what way is that binary code ordered and processed by the processor?  
> **username_1**: @EoinMcQuinn The binary that is produced by the compiler will do exactly what the source code instructs it to do. And I think the part of your questions here relating to source files and the compilation process are off-topic here, as they're unrelated to Bitcoin. I suggest taking a programming course if you're interested in that.  

---

