Skip to content

Instantly share code, notes, and snippets.

@Sajjon
Created December 21, 2020 08:40
Show Gist options
  • Save Sajjon/88fc793615ddca0bf7333f58ebf0dbe0 to your computer and use it in GitHub Desktop.
Save Sajjon/88fc793615ddca0bf7333f58ebf0dbe0 to your computer and use it in GitHub Desktop.
Get status of Zilliqa transaction using command line interface and API: https://dev.zilliqa.com/docs/apis/api-transaction-get-transaction-status
curl -d '{
"id": "1",
"jsonrpc": "2.0",
"method": "GetTransactionStatus",
"params": ["<YOUR_TRANSACTION_HASH_WITHOUT_LEADING_0x_CHARS_GOES_HERE>"]
}' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/" | python -m json.tool
@Sajjon
Copy link
Author

Sajjon commented Dec 21, 2020

How to use:

  1. open your Terminal application, on Mac it is called ”Terminal” and is placed in the ”Utility” folder in the ”Applications” folder. On Windows you might wanna download Cygwin see more info here
  2. Copy paste all the code in the “gist” above into your favorite text editor
  3. Make your Zilliqa transaction, e.g. withdrawing your Zilliqa Staking Reward from Zillion, and make sure to copy the Transaction Hash shown in the pop up dialog
  4. in your favorite text editor Paste the transaction hash into the <YOUR_TRANSACTION_HASH_WITHOUT_LEADING_0x_CHARS_GOES_HERE> , thus replacing it completely, so that you do not see any < or > but so that you see [“ before your transaction hash and ”] immediately after - with no space in between. 💡Important: make sure to remove any leading characters ”0x” from the transaction hash!
  5. Copy paste the whole command into the Terminal app and hit “enter”
  6. Hit the up arrow key and enter every 5 second or so to repeat the command and watch how the “status” changes value from 1 to 3 (and 2 in between?)

@Sajjon
Copy link
Author

Sajjon commented Dec 21, 2020

If you are curious about what the status numbers mean, here is the code mapping it to a status message, a code update part of the Pull Request #269 merged on 2020-12-15 (not a coder? A 'Pull Request' is like "an update of code with a 'report'").

@bb111189
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment