- Checkout submodules
private-alonzo-testnet
andexunits-calculator
by runninggit submodule update --init
- Download cardano-node binaries by running
./private-testnet/scripts/install.sh
- Install
exunits-calculator
dependencies by runningcd exunits-calculator && npm install && npm install -g ts-node
- You need to run private testnet first by
./private-testnet/scripts/reset.sh
- There are 2 bash scripts
run.sh
andrun_optimize.sh
, each script will trigger a mock transaction to plutus script defined onOnChain.hs
file. The transaction data will be stored ontx.raw
andtx_optimized.raw
which will be analyzed later - Basic steps:
- Run the private testnet node
- Run the
run.sh
script - Stop the node and re-run
- Run the
run_optimized.sh
script - Open
main.ts
then append two lines:printExUnitsFromTxBody("../tx.raw");
printExUnitsFromTxBody("../tx_optimized.raw");
- Run
cd exunits-calculator && ts-node main.ts
, you can see the difference of execution unit and the script size between two implementation methods.