Tutorial “from stratch” for clean Windows install.
1°/ Install and update MSYS2 environment
- Download installation program at https://www.msys2.org/
- Run installation (follow guide as written on msys2’s website)
When this window appear, you’re ready to go :
Now install gcc (GNU Compiler Collection) :
pacman -S mingw-w64-x86_64-gcc
Note : Follow upgrade process on https://www.msys2.org/docs/updating/ .
In details:
pacman -Suy
After closing, repeat again :
pacman -Suy
In some case, AV program can rise up :
2°/ Cloning from GitHub
We need to install ‘git’ for msys2 :
pacman -S git
git clone https://github.com/XDagger/goXdagWallet
Same as above, AV program can rise up :
As you can see, we retreive goXdagWallet sources :
3°/ Build usefull lib
In details, enter following commands :
pacman -S autoconf perl automake-wrapper libtool make
cd
git clone https://github.com/bitcoin-core/secp256k1
cd secp256k1
./autogen.sh
./configure
make
make install
4°/ Build wallet’s /clib part
We’ll have to install some stuff :
cd
pacman -S openssl-devel cmake
Now we build :
cd goXdagWallet/clib
cmake .
make
This is the result you should get :
Rename file you obtain :
mv libxdag_runtime_MINGW64_NT-*.a libxdag_runtime_Windows.a
The end of file name could change. It’s depend of your Windows release. By example for Windows 11, could finish by ‘NT-10.0–22000.a’ . It’s not a matter !
So now you should obtain this :
5°/ Build wallet’s /wallet part
Let’s install go language :
cd
pacman -S mingw-w64-x86_64-go
Setup some vars :
export GOROOT=/mingw64/lib/go
export GOPATH=/mingw64
Install good text-editor for code. I recommend VS CODE. Get it here : https://code.visualstudio.com/
Launch VSCODE, and open C:\msys64\home\<username>\goXdagWallet\wallet\components\wallet_cgo.go
file :
On 3rd CGO line, remplace -L/usr/lib
:
By -LC:/msys64/usr/lib
:
Now the final touch :
cd
cd goXdagWallet/wallet
go mod tidy
set CGO_ENABLED=1
go build -ldflags -H=windowsgui
And the result is :
Just copy somes .DLL in wallet folder :
cp /mingw64/bin/libwinpthread-1.dll .
cp /usr/bin/msys-crypto-1.1.dll .
cp /usr/bin/msys-2.0.dll .
cp /usr/bin/msys-z.dll .
Now let’s verify if it’s working.
Open Windows Explorer C:\msys64\home\<username>\goXdagWallet\wallet\
and launch ‘goXdagWallet.exe’ :
Extra notes
You can use official golang package outside msys to compile wallet.
In this case, you don’h have :
- to do first step of 5°) phase, and do the rest inside Windows command box.
- to copy msys*.dll files
Make some tests.