Skip to content

Commit

Permalink
chore: adding requirement checks for contract build script
Browse files Browse the repository at this point in the history
  • Loading branch information
logicalmechanism committed Jan 9, 2025
1 parent 37567e0 commit 7695dd4
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion seedelf-contracts/complete_build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
#!/usr/bin/env bash
set -e

if command -v python3 &> /dev/null; then
echo -e "\033[1;35m python3 is installed and available on the PATH. \033[0m"
else
echo -e "\033[1;31m python3 is not installed or not available on the PATH.\033[0m"
echo -e "\033[1;33m sudo apt install -y python3 \033[0m"
exit 1;
fi

if python3 -c "import cbor2" 2>/dev/null; then
echo -e "\033[1;35m cbor2 is installed and available for python3. \033[0m"
else
echo -e "\033[1;31m cbor2 is not installed or not available for python3.\033[0m"
echo -e "\033[1;33m sudo apt-get install python3-cbor2 \033[0m"
exit 1;
fi

if command -v aiken &> /dev/null; then
echo -e "\033[1;35m aiken is installed and available on the PATH. \033[0m"
else
echo -e "\033[1;31m aiken is not installed or not available on the PATH.\033[0m"
echo -e "\033[1;33m https://github.com/aiken-lang/aiken \033[0m"
exit 1;
fi

if command -v cardano-cli &> /dev/null; then
echo -e "\033[1;35m cardano-cli is installed and available on the PATH. \033[0m"
else
echo -e "\033[1;31m cardano-cli is not installed or not available on the PATH.\033[0m"
echo -e "\033[1;33m https://github.com/IntersectMBO/cardano-cli \033[0m"
exit 1;
fi

# create directories if they dont exist
mkdir -p contracts
mkdir -p hashes
Expand All @@ -24,7 +56,7 @@ aiken build --trace-level silent --trace-filter user-defined
# some random string to make the contracts unique
rand="acabcafe"
rand_cbor=$(python3 -c "import cbor2; print(cbor2.dumps(bytes.fromhex('${rand}')).hex())")
echo "Random Seed:" ${rand}
echo -e "\033[1;36m\nRandom Seed: ${rand} \033[0m"

# build and apply parameters to each contract
echo -e "\033[1;37m\nBuilding Wallet Contract\033[0m"
Expand Down

0 comments on commit 7695dd4

Please # to comment.