Published on

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

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

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

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

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

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

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

    source ~/.bashrc
    
  8. Build the repository

    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.