Apr 27 2021

How to build cardano-serializer-lib using Windows WSL

Follow these instructions to successfully build cardano-serialization-lib on Windows (because using e.g. Git Bash will simply not work).

This assumes you already have Debian running on the Windows Subsystem for Linux (WSL)

  1. install python 2.7

    1
    sudo apt-get install python2.7
  2. install curl

    1
    sudo apt-get install curl
  3. install rust and choose option 1 (Proceed with installation (default))

    1
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  4. install nvm

    1
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
  5. install cmake

    1
    2
    sudo apt-get install cmake
    sudo apt-get install build-essential
  6. install wasm-pack

    1
    curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
  7. restart your bash

    1
    source ~/.bashrc
  8. build the repository

    1
    2
    3
    4
    5
    6
    7
    git clone git@github.com:Emurgo/cardano-serialization-lib.git
    cd cardano-serialization-lib
    git submodule update --init --recursive
    nvm install v12.18.1
    nvm use
    npm install
    npm run rust:build-nodejs

All done, you should now find your ready-to-use libraries inside folder rust/pkg.