Ubuntu (Fresh Install) setup for Plutus Pioneer Program
Before we can get started in lecture 1, we first must get our development environment setup.
This guide will be using a fresh install of Ubuntu Linux. If you want to use Linux but only have a computer with Windows installed, you can run a virtual environment inside of Windows. A great step by step guide for how to get started can be found here:
How to install an Ubuntu VM in Windows
You can copy and paste any of the code in this guide directly into your terminal or IDE. If you are new to Linux and are unfamiliar with terminal shell commands, this cheat sheet gives a quick overview:
Linux Command Master List
The haddock documentation is also a great source of information for all the public plutus libraries. This can be found here:
Documentation for all public Plutus Libraries
First, Open up the terminal to get started. We will first install the necessary dependencies first for a fresh copy of Linux.
We need to install Nix and get it configured properly to use IOG’s caches. In this guide we will be doing a single user install. Before we can install Nix, we need to make sure the version of Linux you are using has both curl and git installed. First run:
Now that curl is installed, we can install git. Run:
We can now install Nix single user install. Run:
Output:
Installation finished! To ensure that the necessary environment
variables are set, either log in again, or type
. /home/totinj/.nix-profile/etc/profile.d/nix.sh
Now to finish, we need to set the environment with the following command notice from above.
Very important here to replace totinj
with your current Linux user!!
We now need to add Input Outputs caches to greatly speed up the building process. Without this step, you might be running nix-shell for days rather than minutes! This can be found here: IOG Binaries. Let’s create a new config file that has the associated IOG links. Run:
totinj@penguin:~$ mkdir ~/.config/nix
echo 'substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/' >> ~/.config/nix/nix.conf
echo 'trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=' >> ~/.config/nix/nix.conf
With Nix now installed and configured, we will clone the appropriate repositories from github. We will be cloning the plutus-apps and the plutus-pioneer program. First, let’s clone plutus-apps:
Next, let’s clone the plutus-pioneer-program repo: You can now navigate to the current week01 directory in the plutus-pioneer-program folder and open the cabal.project file: Grab the plutus-apps tag inside the cabal.project file:location: https://github.com/input-output-hk/plutus-apps.git
tag:41149926c108c71831cfe8d244c83b0ee4bf5c8a
You should now be up to date and can run nix-shell in this directory. Run nix-shell:
Nix-shell will take a good amount of time to build the first time you are running it, so be patient. If you have setup your caches correctly, you will notice it building from https://hydra.iohk.io. If successful, you should see the nix-shell:Head back to the week01 folder to start running the cabal commands:
These will also take a long time to run the first time. If successful, you should now be ready to start the lecture: