From 48c152f09a2096f1acf64e1dbdb2521a7759abe4 Mon Sep 17 00:00:00 2001 From: perturbing Date: Thu, 29 Aug 2024 13:24:47 +0200 Subject: [PATCH] add tutorial on how to compile latest guardrail script --- .../compile-the-guardrail-script.mdx | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 docs/tutorials/compile-the-guardrail-script.mdx diff --git a/docs/tutorials/compile-the-guardrail-script.mdx b/docs/tutorials/compile-the-guardrail-script.mdx new file mode 100644 index 0000000..25e541a --- /dev/null +++ b/docs/tutorials/compile-the-guardrail-script.mdx @@ -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 < 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). \ No newline at end of file