Compile the guardrail script
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
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
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).
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
sed -i '134d' cardano-constitution/cardano-constitution.cabal
Next, we can build the script via
cabal update
cabal run cardano-constitution:create-json-envelope -- guardrail.plutus
You can get the hash of this just compiled script via, for example
cardano-cli transaction policyid --script-file guardrail.plutus
And compare it to the one currently defined here.