This is me documenting my journey with a completely hands-on approach to open source development in Bitcoin. This is the first time I’m attempting to run and test a Bitcoin-related codebase so I am pretty excited. My goal is to document the exact steps and my thought process throughout. So let’s begin!
Run https://github.com/rustyrussell/lnprototest against c-lightning and deliver the output in a Gist. Write a short essay about how far you’ve come in learning open source tools and how you recommend other junior developers practice this exercise (include the Gist to your output!).
<aside> ✅ The Output Gist: https://gist.github.com/induviduality/8b83cc3034ea728357703cf971fa45bf
</aside>
lnprototest
I headed to the repository on GitHub. There I went through the README.md
file. The lnprototest
repository required me to have both bitcoind
and lightningd
set up and configured. So I decided to setup the same. I tried to compile the two from source on my local machine. But I had trouble setting up the repositories for testing.
That was around the time I had a discussion with my Des Femmes Mentor - Yuval, and clarified if my understanding about the task was correct. He then pointed out that I need to use docker to set up nodes. So I got back to surfing the internet to fetch the docker containers. Luckily, I stumbled up the Mastering the Lightning Network book, which put both the repositories along with docker files for lnd
as well as eclair
into a neat package.
I was just about to install Docker onto my local machine, but that when I remembered that I always wanted to experiment with Gitpod and its workspaces. I pulled up a new workspace on Gitpod, got on to the terminal. I had a slight hunch that docker would be installed, so I ran docker -v
to check. To my surprise, it was!
Then I followed some of the instructions on the book to pull the docker containers for bitcoind
and lightningd
. I set up bitcoind and let it simulate mining 6 blocks every 10 seconds. Meanwhile, I opened another terminal tab and played with some basic bitcoin cli commands. After that, I opened up a new terminal and pulled up the c-lightning container and built it. Here are some of the console outputs from my setup. Click the triangle on the left to toggle them open.
Next came connecting these nodes together. For that, I created a docker network onto which I added the bitcoind node as well as the c-lightning node.
bitcoind
on the networkc-lightning
on the networkFinally it was time to run lnprototest
. I cloned the repository using the following command
$ git clone <https://github.com/rustyrussell/lnprototest.git>