- Setup a windows virtual machine. Free images are available at here
- Launch the virtual machine
- Download Visual Studio Community Edition 2017 (these instructions also work with Visual Studio Professional 2017)
- Check the boxes for the Desktop development with C++ and Linux Development with C++
- In the summary portion on the right hand side also check C++/CLI support
- Click install
- Download git-scm for windows here
- Install git for windows using:
- Use Git from Git Bash Only so it doesn't change any path settings of the command prompt
- Checkout as is, commit Unix-style line endings. You shouldn't be commiting anything anyway but just in case
- Use MinTTY
- Check all the boxes for:
- Enable file system caching
- Enable Git Credential Manager
- Enable symbolic links
- Download rust for windows here
- Choose installation option 1
- Open a the Git Bash command prompt
- Change directories to Downloads:
cd Downloads
- Clone the indy-sdk repository from github.
git clone https://github.com/hyperledger/indy-sdk.git
- Download the prebuilt dependencies here
- Extract them into the folder C:\BIN\x64
It really doesn't matter where you put these as long as you remember where so you can set the environment variables to this path
- If you are not building dependencies from source you may skip to Build
- https://www.npcglib.org/~stathis/downloads/openssl-1.0.2k-vs2017.7z
- https://download.libsodium.org/libsodium/releases/old/libsodium-1.0.14-msvc.zip
Download http://www.sqlite.org/2017/sqlite-amalgamation-3180000.zip
Create an empty static library project in Visual Studio and add sqlite.c
file and 2 headers from extracted
archive. Then just build it.
Follow to http://zeromq.org/intro.
- Download sources from last stable release for Windows.
- Open
zeromq-x.x.x/builds/msvc/vs2015/libzmq.sln
with Visual Studio - If necessary change solution platforms on x64(if you are working on x64 arch).
- On main menu bar choose build->build libzmq.
- If build project was successful, two files
libzmq.dll
andlibzmq.lib
should appear in pathzeromq-x.x.x/bin/x64/Debug/vXXX/dynamic
. - rename
libzmq.lib
tozmq.lib
.
-
Get binary dependencies (libamcl*, openssl, libsodium, libzmq, sqlite3).
-
Put all *.{lib,dll} into one directory and headers into include/ subdirectory.
-
Open a windows command prompt
-
Configure MSVS environment to privide 64-bit builds by execution of
vcvars64.bat
:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\"vcvars64.bat
Note that depending on the version of Visual Studio placement of vcvars64.bat can be different. For example, it can be
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
-
Execute
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
-
Point path to this directory using environment variables:
set INDY_PREBUILT_DEPS_DIR=C:\BIN\x64
set INDY_CRYPTO_PREBUILT_DEPS_DIR=C:\BIN\x64
set MILAGRO_DIR=C:\BIN\x64
set LIBZMQ_PREFIX=C:\BIN\x64
set SODIUM_LIB_DIR=C:\BIN\x64
set OPENSSL_DIR=C:\BIN\x64
-
Set PATH to find .dlls:
set PATH=C:\BIN\x64\lib;%PATH%
-
change dir to
indy-sdk/libindy
and runcargo build
(you may want to add--release --target x86_64-pc-windows-msvc
keys to cargo)
If your windows build fails complaining on gdi32.lib you should edit
~/.cargo/registry/src/github.com-*/openssl-sys-*/build.rs
and add
println!("cargo:rustc-link-lib=dylib=gdi32");
to the end of main()
function.
Then try to rebuild whole project.
-
Start local nodes pool on
127.0.0.1:9701-9708
with Docker:docker build -f ci/indy-pool.dockerfile -t indy_pool . docker run -itd -p 9701-9709:9701-9709 indy_pool
Please note that this port mapping between container and local host requires latest Docker for Windows (linux containers) and windows system with Hyper-V support.
If you use some Docker distribution based on Virtual Box you can use Virtual Box's port forwarding future to map 9701-9709 container ports to local 9701-9709 ports.
-
Run tests
RUST_TEST_THREADS=1 cargo test