With bash, you can fetch it and read it.
Here's an example where I fetch the payload and store it in a log file that is on the outside of the contract folder. (/contract/contract_fs/seed)
In this particular code I am outputting the contract id, the payload can also be outputted, if you remove the comment mark #!
Code: Select all
#!/bin/bash
output_file="../contract.log"
# Read the JSON payload from STDIN
read -r json_payload
# Dump the entire payload (like a var_dump)
#echo "Dumping entire payload:"
#echo "$json_payload" > ../payload
# Parse the contract_id from the JSON using jq and print it
contract_id=$(echo "$json_payload" | jq -r '.contract_id')
# Output the contract_id
echo "Contract ID: $contract_id" >> "$output_file"