pact-langkadena

How do I install Pact onto Windows?


I was going through the beginner tutorial and came to the Atom SDK page. I have a windows system, so installing brew doesn't work, but the tutorial only gives a way for Linux systems or Mac OS systems to install Pact. Is there any way to install Pact onto windows?


Solution

  • There is no official support for Windows (to my knowledge), but there is a possible workaround that worked for me. The workaround involves Ubuntu and WSL(Windows Subsystem for Linux).

    1. The first step is installing Ubuntu and WSL in your windows device. Those who have done this could move ahead to step two. I followed this Youtube video for setting up WSL

    2. With WSL Terminal set up, go to the terminal home directory and download the compressed pact executable from the official pact releases Github, suiting your ubuntu version, using command line curl. An example command I used for Ubuntu 20.04 and Pact v4.3 is:

        curl -LJO https://github.com/kadena-io/pact/releases/download/v4.3/pact-4.3-linux-20.04.zip
      

    3.Install unzip on command line using:

    sudo apt install unzip
    
    1. Unzip the compressed executable to the same directory using the unzip command. ex:

       unzip pact-4.3-linux-20.04.zip`
      

    this will add a pact.exe file on that directory

    1. Update the user permissions on the pact.exe file using chmod command to enable read and execute.
    chmod u=rx ./pact
    
    1. Add the directory with pact executable to terminal permanent search path. This is done by exporting a new path in the .bash_profile file. (Editing .bash_profile could be done through any command line text editor e.g. vim). I followed this tutorial to complete this step.

    And that should allow you to start pact from a windows wsl terminal.