-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from perturbing/master
add tutorial on how to compile latest guardrail script
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |