Skip to content

Commit

Permalink
Merge pull request #163 from perturbing/master
Browse files Browse the repository at this point in the history
add tutorial on how to compile latest guardrail script
  • Loading branch information
Ryun1 authored Aug 29, 2024
2 parents 8b73e1d + 48c152f commit d71efc8
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/tutorials/compile-the-guardrail-script.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
sidebar_label: Compile the guardrail script
title: Compile the guardrail script
sidebar_position: 1
slug: /tutorials/compile-guardrail
---

### How to compile the guardrail script from source

To compile the current version of the guardrail script yourself, you first have to clone the plutus repository
```bash
git clone https://github.com/IntersectMBO/plutus.git
cd plutus
```
Next we check out the version 1.31.0.0 of plutus and enter a nix development shell via
```bash
git checkout 1.31.0.0
nix develop
```
We then create a file `cabal.project.local` to override some dependencies as a hotfix (there is a circular dependency otherwise).
```cabal
cat <<EOF > cabal.project.local
allow-newer: *:plutus-ledger-api
allow-newer: *:prettyprinter-configurable
EOF
```
Next, we open in a text editor the file `cardano-constitution/cardano-constitution.cabal` and delete line 134 that reads `buildable: False` via
```bash
sed -i '134d' cardano-constitution/cardano-constitution.cabal
```
Next, we can build the script via
```bash
cabal update
cabal run cardano-constitution:create-json-envelope -- guardrail.plutus
```
You can get the hash of this just compiled script via, for example
```bash
cardano-cli transaction policyid --script-file guardrail.plutus
```
And compare it to the one currently defined [here](https://book.world.dev.cardano.org/environments/mainnet/conway-genesis.json).

0 comments on commit d71efc8

Please sign in to comment.