Are there any examples of the createDryRun
algosdk
method for JavaScript? I’m struggling with how to correctly create and debug a grouped txn
Going to answer my own question here. Hope it helps someone else. There are a few steps to using the createDryRun
function.
- Create transactions and add them to an array
- Create a transaction group using
assignGroupID
and pass in the array - Sign each transaction using something like
txnGroup[0].signTxn(userAccount.sk);
- Decode these recently-signed txns using
const decodedTxn0 = decodeSignedTransaction(signedTxn0);
for each of the txns in the group - Pass these signed, decoded txns into, where
txns
represents the recently-created array of decoded, signed txns:
const dryRun = await algosdk.createDryrun({
client,
txns,
});
await fs.writeFile(
fileName,
algosdk.encodeObj(dryRun.get_obj_for_encoding(true)),
)
- Use
tealdbg debug $program_file_path --dryrun-req $dryrun_txn_path --group-index 1
, replacing the variables as necessary
Note: make sure to specify the group index! I forgot to add this
3 Likes