▶️Interact with the contract-Transaction
Within the scripts folder, create a file called
setMessage.js

Let's write our
setMessage.jsscript
Import hardhat and swisstronikJS functions
Let's use
sendShieldedTransactionto send a call/query to the blockchain
Write the
mainscript to usesendShieldedTransactionfunction
Add this by hardhat default
The final setMessage.js script should look like this:
Execute the following command in your terminal to run the script using the Swisstronik network
npx hardhat run scripts/setMessage.js --network swisstronikUpon successful execution, your terminal should display
Transaction Receipt: TransactionResponse {...}, now it's time to retrieve this message🎉
Last updated
Was this helpful?