Learn Plutus and become a certified Plutus Pioneer with our new series of interactive training courses by IOG
NOTE: Currently test on x86_64 GNU/Linux only.
mkdir plutus-dev
cd plutus-dev
git clone https://github.com/input-output-hk/plutus.git
git clone https://github.com/input-output-hk/plutus-pioneer-program.git
A Docker Image with Ubuntu Core and Nix for Plutus Development.
If you have a separate namespace setup for your Docker environment, you will need to disable this setting in your daemon, /etc/docker/daemon.json
and restart your Docker daemon. The Plutus development environment will not run outside the host namespace. If you are a Docker wizard and know how to do this, I would love to learn how > Telegram
Build a data container for Nix packages.
sudo docker create --name nix -v nix:/nix heathdrobertson/ubuntu-nix:latest sh
sudo docker run -it --name plutus-dev \
--network host \
--volumes-from nix \
--volume $(pwd)/:/home/plutus-dev \
--workdir /home/plutus-dev \
heathdrobertson/ubuntu-nix:latest
nix-env --version
Output: nix-env (Nix) 2.3.10
Update Nix configuration.
mkdir -p ~/.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
cd /home/plutus-dev/plutus
nix build -f default.nix plutus.haskell.packages.plutus-core
Update Cabal
nix-shell
cabal update
exit
the Nix shell.
The Plutus Pioneer Program source is made to compile and run against Plutus for a specific commit hash which is listed in each week's cabal.project
file.
cat /home/plutus-dev/plutus-pioneer-program/code/week01/cabal.project | less
e.g. tag: 3746610e53654a1167aeb4c6294c6096d16b0502
git checkout 3746610e53654a1167aeb4c6294c6096d16b0502
Then rebuild the Nix environment to match the current weeks builds.
nix build -f default.nix plutus.haskell.packages.plutus-core
exit
out of you running interactive TTY container session, which will stop the container, and restart sudo docker start plutus-dev
the container from your host machine.
Open two Terminal windows or Tmux panes and run an interactive TTY container session in each:
sudo docker exec -it plutus-dev nix-shell /home/plutus-dev/plutus/shell.nix
cd /home/plutus-dev/plutus-playground-server
plutus-playground-server
cd plutus-playground-client
npm run start
You should now be able to navigate to https://localhost:8009. The browser will complain about it being a risky website, allow it.