The latest btcd
release build is from 2015. There is a nice description how to build it for Linux/Mac, but for Windows it’s suggested to download the latest binaries, which are 626 commits behind master as of February 2018. Fortunately, with Golang we can easily build binaries for Windows, and we can follow the steps of the Linux build process. The only issue I faced was a problem in the Glide dependency manager and that’s how this little post was born.
We can attempt to build and install it for Windows with the steps below:
The first command downloads and installs Glide. The following commands create a folder where the btcd
repo will be cloned. After cloning the repo we must run glide install
to get all btcd dependencies.
The issue happens on the line glide install
and the error is something like: Unable to export dependencies to vendor directory
This seems to be a problem with the Glide tool and to fix it, we must change one line of code in $GOPATH/src/github.com/Masterminds/glide/path/winbug.go
and rebuild the Glide tool.
In the function CustomRename, we have to replace
|
|
with
|
|
Then change to the glide directory and rebuild it.
Now we’re ready to run glide install
again in the btcd
folder and everything should be fine.
If we want to change the default folder where btcd
will download and store the blockchain, we can create a symbolic link, similar to ln -s
in Linux. I wanted to change it, because I have a small 128GB SSD drive for booting Windows (C:) and 1TB spinning drive (D:) where I would like to store the data.
By default btcd
stores the blockchain in c:\Users\your-user\AppData\Local\Btcd\data
. If we want to move that directory to D: without disturbing the btcd
expectations, we can create a symbolic link with the following commands:
First create a folder on drive D: where we’ll store the blockchain, for example:
|
|
Next, we must rename (move) the current data folder created by btcd:
|
|
And create the symbolic link:
|
|
Now btcd
will have its data directory where it expects it to be, but the blockchain data will actually be stored on drive D: in the d:\btcd-data
folder.