Bitcoin & Lightning Development Roadmap — Part 1
PART 1 - Setup a Bitcoin Node
Bitcoin & Lightning Development Roadmap — Part 1
PART 1 - Setup a Bitcoin Node
The bitcoin network is a peer-to-peer connection of nodes (computers) that implement the bitcoin protocol. Our goal at this stage is to join this peer-to-peer network and; in essence, become one of the peers.
Why is this important?
To participate in Bitcoin, we need to have the Bitcoin public ledger on our computer. In addition to having the public ledger, we should be able to independently verify the integrity of the information on this ledger.
We need to install “bitcoin core” to set up our Bitcoin node. The responsibility of bitcoin-core is to participate in the bitcoin consensus mechanism by validating all transactions and blocks, in addition to gossiping transactions, blocks, and node addresses to other nodes on the network.
1. Clone the Bitcoin Repo
First, we need to install Bitcoin. We can do this by first cloning the bitcoin github repository. You should note that this repo you’re about cloning is “your installation“ of bitcoin; so put a little thought into the location you select to clone this repo into.
git clone https://github.com/bitcoin/bitcoin.git
The bitcoin repository is expected to have everything we need to get our node running and operational. Hence, we’re going to be running our commands from this directory.
cd bitcoin
2. Install Bitcoin
Now that the Bitcoin repo has been cloned, we would love to run the Bitcoin Core daemon; but we shouldn’t get ahead of ourselves here…
Bitcoin core requires some other software/packages on our computer to run properly, and here is how we install them.
sudo apt install build-essential libtool autotools-dev \
automake pkg-config bsdmainutils python3 sqlite3
Here, we’re only interested in the bare minimum to get bitcoin core running. I have also added sqlite3 so that new sqlite wallet support gets compiled. There are additional tools that should make our lives easier, and they are bundled with the repo (GUI support for instance). If you would like to explore these options, you can check them out in doc/build-unix.md, located in the repo.
cat doc/build-unix.md
Next, we have to use these commands to build bitcoin, (run them one at a time)
./autogen.sh
.configure - disable-wallet
make -j`nproc`
We added -jnproc flag so that the process can use all available cores to build, which can make the process faster.
make check
The make check is used to check if the make command finished running without issues by running the unit test suite.
3. Configure your Bitcoin Node
The bitcoin configuration file is used to declare the behavior of your Bitcoin node. I will give you an example:
Currently, the size of the bitcoin chain is around 400 GB of data. You could decide not to keep all of it. That’s how you end up with a pruned node.
The bitcoin config file is named bitcoin.conf, and by default is expected to be located in the bitcoin data directory. More detailed documentation of the bitcoin configuration file can be found here if you’d like to take a closer look.
But for the sake of this exercise, we will be configuring our bitcoin to be running on regtest, and we will also be keeping our configuration file in its default directory. For this exercise, I will assume you’re using a linux computer, and your data directory is $HOME/.bitcoin/.
mkdir $HOME/.bitcoin
touch $HOME/.bitcoin/bitcoin.conf
The bitcoin data dir could be anywhere you’re comfortable with outside the default location; however, you’ll have to specify your preferred directory while you run bitcoind.
Add these lines to the configuration file you just created (with maybe VSCode or Vim).
regtest=1
txconfirmtarget=2
mintxfee=0.00001
maxtxfee=0.1
fallbackfee=0.00001
walletrbf=1
txindex=1
daemon=1
blockdir=
[regtest]
rpcauth=
rpcuser=
rpcpassword=
rpcbind=127.0.0.1
rpcport=18443
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333
The configuration options here are based on what we need to complete this exercise.
A couple of things to notice here…
First, you’ll notice that the daemon option is set to 1 (true). What this does is keeps the bitcoin core running as a daemon (i.e. as a background process).
You will also notice that I added the optional blockdir configuration option. This is to
Also, the credentials for the rpc-related configuration options here are empty. We also have to generate those. You should generate your rpc credentials by running a python script that comes bundled with our bitcoin repo (I told you, all batteries included).
Generate the credentials by running “./share/rpcauth/rpcauth.py” in this directory. I hope you’re still in the cloned bitcoin directory.
./share/rpcauth/rpcauth.py <my-username>
So, you should update your configuration file with the credentials you just generated.
4. Run Bitcoin Core (as daemon)
Now that we’ve made it this far, it is time to run our bitcoin core. Ideally, you’re meant to run bitcoind to start the bitcoin core daemon.
However,
When you run bitcoind, our software will sync with other nodes, download and verify all the blocks from the first block ever (Genesis block). We wouldn’t want that to happen, and that is why we are running on regtest [regtest=1].
To start our bitcoin core daemon, run this command
bitcoind
Here, we’re telling bitcoin core to run with $HOME/bitcoin-data-dir as the data directory. The process will use the config file in this directory, and also store some other data it needs to store in this same directory.
After we run this command, we should see “Bitcoin Core starting” as a confirmation that our bitcoin core has started running.
If our bitcoin core daemon starts running without an error, It is time to interact with bitcoin core via the terminal. We interact with bitcoin core using bitcoin-cli tool which comes installed with our running bitcoin core.
5. Start using Bitcoin
Now that our Bitcoin Core is running, here are the things we can do with our bitcoin node.
- We can mine blocks with our node (as we are running in regtest).
- We can generate new addresses to receive payments.
- We can send out payments to other bitcoin addresses
…and so much more
For the sake of this exercise, we’ll be exploring just a few of them.
Generate a wallet
Just like in traditional finance where a wallet is used to hold money, a Bitcoin wallet can be used to hold money (Bitcoin). A Bitcoin wallet is used to store private keys that infer ownership of Bitcoin sitting on the network. You need to have a private key to be able to spend funds locked to that private key (by derivative).
By default, our Bitcoin node does not come with a wallet. We have to create one. To create a wallet called “my-wallet-x”, we may use this command
bitcoin-cli createwallet my-wallet-x
Please, note that if we’ve already created a bitcoin wallet at some prior time on this same node, we will have to load the wallet with bitcoin-cli createwallet my-wallet-x.
Mine some Blocks
Simply put, mining is the process of creating new bitcoins and validating transactions on the Bitcoin network. Let us mine a few blocks; 10 will be fine.
bitcoin-cli -generate 10
You see this command up here…
When you mine these new 10 blocks, you should get rewarded. The reward you’ve received from mining these blocks is locked/ to the default wallet that came with your block. If you would like these rewards to be paid to any other address, use generatetoaddress instead.
bitcoin-cli -generatetoaddress <num_blocks> <address>
Get our wallet balance
Now that we have mined a few blocks, one way to know if we’ve been rewarded for mining is to check our balance. We do that by running this command.
bitcoin-cli getbalance
Just for fun, we could generate more blocks, and check our balance again.
WHAT’S NEXT? The Lightning Network!
I hope you find this useful 💪🏽 Happy tinkering 🎉
메타데이터
- post_id
- ef0cbff42302
- slug
- bitcoin-lightning-development-roadmap-part-1-ef0cbff42302
- url
- https://medium.com/@Adesubomi/bitcoin-lightning-development-roadmap-part-1-ef0cbff42302
- canonical_url
- https://medium.com/@Adesubomi/bitcoin-lightning-development-roadmap-part-1-ef0cbff42302
- author_url
- https://medium.com/@Adesubomi
- status
- ok
- fetched_at
- 2026-07-25 22:50:20