Some questions about "ref_block_num" and "expiration" in transaction?
The struct of a transaction is below:
{
"transaction_id": "fa821eb8dae79e3e5a5443c4fab1d881db44f5acf1c4913c852869f93b747c02",
"transaction": {
"signatures": [
"EOSKithv1WNnmnUP89ZSvp8W1enUq5XDxX41PyhuwQhZ4dSLf15QdKqn3SWjPYNPF8uMwaXfsRR1uzQ7i5FZhwVpWE4uhyPhd"
],
"compression": "none",
"packed_context_free_data": "",
"context_free_data": [],
"packed_trx": "628bd45a000077b213559e7d000000000100a6823403ea30550000000000a53176010000000000ea305500000000a8ed32321d000000000070
15d640420f000000000004454f5300000000046d656d6f",
"transaction": {
"expiration": "2018-04-16T11:39:14",
"region": 0,
"ref_block_num": 45687,
"ref_block_prefix": 2107528467,
"max_net_usage_words": 0,
"max_kcpu_usage": 0,
"delay_sec": 0,
"context_free_actions": [],
"actions": [{
"account": "eosio.token",
"name": "issue",
"authorization": [{
"actor": "eosio",
"permission": "active"
}
],
"data": {
"to": "user",
"quantity": "100.0000 EOS",
"memo": "memo"
},
"hex_data": "00000000007015d640420f000000000004454f5300000000046d656d6f"
}
]
}
}
}
I have some questions about the return message:
- what does "expiration" mean? The time that the transaction has been confirmed?
- Is the result of api "get_transactions" shows the transactions, which have been confirmed? Or not confirmed transactions also could be shown?
- Is the result of api "get_transactions" sorted by "expiration"?
- Can we get the message about which block that a transaction has been included? There is no doc about the fields, I hope someone who has read the code can answer my question.
Consider asking questions at https://area51.stackexchange.com/proposals/116927/eosio/visit
@guaiguaihw Did you get the answer? Could you share it?
Follow-up: Can someone explain the transaction struct? (if you can't see it, click this link first to get the cookie).
@kristieguo
-
what does "expiration" mean? The time that the transaction has been confirmed?
It means when the transaction is effective, which means the time that actions really execute. The confirmed time is related to the confirmed time of the block which includes the transaction. -
Is the result of api "get_transactions" shows the transactions, which have been confirmed? Or not confirmed transactions also could be shown?
I don't really comfirm about that, but I guess the transactions are all confirmed. But if you use the command:cleos get actions <account_name>, It will provide you a way to make sure about it. I suggess you to use this command, If you really want to get confirmed transactions. Here is the doc: https://github.com/EOSIO/eos/wiki/Tutorial-Exchange-Deposit-Withdraw -
Is the result of api "get_transactions" sorted by "expiration"?
According to the codes, I don't find the connection between expiration and the order -
Can we get the message about which block that a transaction has been included?
we can get the block message by using command: cleos get actions <account_name>