Skip to content

Conversation

@nullun
Copy link
Contributor

@nullun nullun commented Aug 1, 2025

Summary

I was in a situation where I had constructed/obtained a raw transaction, but couldn't figure out an easy way to see what the txid of it was. If there is another way with the existing commandline tools, please do let me know.

Since I was on a server that had just an algorand node installed, with no SDKs or programming environments easily available. I thought it would be useful to give goal clerk inspect the ability to display it. I've put it behind the --txid flag rather than change the default behaviour incase there's anyone relying on the existing format.

Test Plan

I didn't create a test, just verified it by using it. If there is a simple place to add a test for this I'd be happy to.

nullun@box demonet % goal clerk inspect -h
Loads a transaction file, attempts to decode the transaction, and displays the decoded information.

Usage:
  goal clerk inspect [input file 1] [input file 2]... [flags]

Flags:
  -h, --help   help for inspect
  -t, --txid   Display the TxID for each transaction

Global Flags:
  -d, --datadir stringArray   Data directory for the node
  -k, --kmddir string         Data directory for kmd
  -w, --wallet string         Set the wallet to be used for the selected operation

nullun@box demonet % goal clerk inspect --txid group.gtxn
group.gtxn[0] - KLVH32RQNP37O724OCEZTGCELC7IB22GAZCM6MEFJZS2MCUIQL4Q
{
  "txn": {
    "amt": 1000000,
    "fee": 1000,
    "fv": 477,
    "gen": "demonet-v1",
    "gh": "En4OJ9KcipMq+Oz+6+dPNHMUNd+gQ+N4bYB7WEs1ZL8=",
    "grp": "ba5DD2SVdcwvUtNgClAe3LXwdB3TWuHnwMQ0Al7gYAE=",
    "lv": 1477,
    "rcv": "COHXKG3PYL5XKA5J4MIG6KQUORN6YMSG6DIJXPWPROZCIEVNH6XM3SBOQY",
    "snd": "CGDGOUGKWMU7WTY7TTIM7223F2BX3VKSTXAYL63SHFKCYL2XXYD5ZJWJ7I",
    "type": "pay"
  }
}

group.gtxn[1] - 5HXFSVGRBPXXCKL3O3UXDNL64LPELSLOLQO6L6BZPP62DVNKROBQ
{
  "txn": {
    "amt": 1000000,
    "fee": 1000,
    "fv": 481,
    "gen": "demonet-v1",
    "gh": "En4OJ9KcipMq+Oz+6+dPNHMUNd+gQ+N4bYB7WEs1ZL8=",
    "grp": "ba5DD2SVdcwvUtNgClAe3LXwdB3TWuHnwMQ0Al7gYAE=",
    "lv": 1481,
    "rcv": "IZS4QX2EPG7YWZ4GG7O27IXDHBESBS7WYBJAFNWZY6Z4YYAFJ5YNJ5O6EQ",
    "snd": "CGDGOUGKWMU7WTY7TTIM7223F2BX3VKSTXAYL63SHFKCYL2XXYD5ZJWJ7I",
    "type": "pay"
  }
}

nullun@box demonet % goal clerk sign -i group.gtxn -o group.sgtxn 
nullun@box demonet % goal clerk rawsend -f group.sgtxn 
Raw transaction ID KLVH32RQNP37O724OCEZTGCELC7IB22GAZCM6MEFJZS2MCUIQL4Q issued
Raw transaction ID 5HXFSVGRBPXXCKL3O3UXDNL64LPELSLOLQO6L6BZPP62DVNKROBQ issued
Transaction 5HXFSVGRBPXXCKL3O3UXDNL64LPELSLOLQO6L6BZPP62DVNKROBQ still pending as of round 495
Transaction 5HXFSVGRBPXXCKL3O3UXDNL64LPELSLOLQO6L6BZPP62DVNKROBQ still pending as of round 496
Transaction 5HXFSVGRBPXXCKL3O3UXDNL64LPELSLOLQO6L6BZPP62DVNKROBQ committed in round 497
Transaction KLVH32RQNP37O724OCEZTGCELC7IB22GAZCM6MEFJZS2MCUIQL4Q committed in round 497

Copy link
Contributor

@jannotti jannotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me.

@codecov
Copy link

codecov bot commented Aug 5, 2025

Codecov Report

❌ Patch coverage is 37.50000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.47%. Comparing base (e11f501) to head (91f4c23).
⚠️ Report is 4 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
cmd/goal/clerk.go 37.50% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6401      +/-   ##
==========================================
- Coverage   50.66%   50.47%   -0.19%     
==========================================
  Files         661      654       -7     
  Lines      110781   110690      -91     
==========================================
- Hits        56122    55870     -252     
- Misses      51793    51947     +154     
- Partials     2866     2873       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@algorandskiy algorandskiy merged commit 0f61d1d into algorand:master Aug 6, 2025
39 checks passed
@nullun nullun deleted the fix/inspect-txid branch August 6, 2025 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants