5

When I use the command cleos get actions <account_name> -j,I got three actions which have different receivers, but belong to the same transfer. I know that the three actions are for accounts who has contract、who is the from account and who is the to account. Could I use the field act_digest to mark one transfer action, because I don't want to write down three repeated actions?

{
    "actions": [{
        "global_action_seq": 6516,
        "account_action_seq": 1,
        "block_num": 6506,
        "block_time": "2018-05-15T03:43:15.000",
        "action_trace": {
            "receipt": {
                "receiver": "eosio.token",
                "act_digest": "cc3d56ed6ebe9f34a39a5e042c5d6c3a28131c5f60a708b8eaa6518b1a391540",
                "global_sequence": 6516,
                "recv_sequence": 4,
                "auth_sequence": [
                    ["user",
                        1
                    ]
                ]
            },
            "act": {
                "account": "eosio.token",
                "name": "transfer",
                "authorization": [{
                    "actor": "user",
                    "permission": "active"
                }],
                "data": {
                    "from": "user",
                    "to": "tester",
                    "quantity": "2500.0000 EOS",
                    "memo": "m"
                },
                "hex_data": "00000000007015d6000000005c95b1ca40787d010000000004454f5300000000016d"
            },
            "elapsed": 620,
            "cpu_usage": 0,
            "console": "transfer from user to tester 2500.0000 EOS\nuser balance: 17500.0000 EOS\ntester balance: 2500.0000 EOS\n",
            "total_cpu_usage": 0,
            "trx_id": "a4b4d3303c8034dd2298f87c8481a001e009871a16e3365a74703bf138dfdf47",
            "inline_traces": [{
                "receipt": {
                    "receiver": "user",
                    "act_digest": "cc3d56ed6ebe9f34a39a5e042c5d6c3a28131c5f60a708b8eaa6518b1a391540",
                    "global_sequence": 6517,
                    "recv_sequence": 2,
                    "auth_sequence": [
                        ["user",
                            2
                        ]
                    ]
                },
                "act": {
                    "account": "eosio.token",
                    "name": "transfer",
                    "authorization": [{
                        "actor": "user",
                        "permission": "active"
                    }],
                    "data": {
                        "from": "user",
                        "to": "tester",
                        "quantity": "2500.0000 EOS",
                        "memo": "m"
                    },
                    "hex_data": "00000000007015d6000000005c95b1ca40787d010000000004454f5300000000016d"
                },
                "elapsed": 4,
                "cpu_usage": 0,
                "console": "",
                "total_cpu_usage": 0,
                "trx_id": "a4b4d3303c8034dd2298f87c8481a001e009871a16e3365a74703bf138dfdf47",
                "inline_traces": []
            }, {
                "receipt": {
                    "receiver": "tester",
                    "act_digest": "cc3d56ed6ebe9f34a39a5e042c5d6c3a28131c5f60a708b8eaa6518b1a391540",
                    "global_sequence": 6518,
                    "recv_sequence": 1,
                    "auth_sequence": [
                        ["user",
                            3
                        ]
                    ]
                },
                "act": {
                    "account": "eosio.token",
                    "name": "transfer",
                    "authorization": [{
                        "actor": "user",
                        "permission": "active"
                    }],
                    "data": {
                        "from": "user",
                        "to": "tester",
                        "quantity": "2500.0000 EOS",
                        "memo": "m"
                    },
                    "hex_data": "00000000007015d6000000005c95b1ca40787d010000000004454f5300000000016d"
                },
                "elapsed": 4,
                "cpu_usage": 0,
                "console": "",
                "total_cpu_usage": 0,
                "trx_id": "a4b4d3303c8034dd2298f87c8481a001e009871a16e3365a74703bf138dfdf47",
                "inline_traces": []
            }]
        }
    }, {
        "global_action_seq": 6517,
        "account_action_seq": 2,
        "block_num": 6506,
        "block_time": "2018-05-15T03:43:15.000",
        "action_trace": {
            "receipt": {
                "receiver": "user",
                "act_digest": "cc3d56ed6ebe9f34a39a5e042c5d6c3a28131c5f60a708b8eaa6518b1a391540",
                "global_sequence": 6517,
                "recv_sequence": 2,
                "auth_sequence": [
                    ["user",
                        2
                    ]
                ]
            },
            "act": {
                "account": "eosio.token",
                "name": "transfer",
                "authorization": [{
                    "actor": "user",
                    "permission": "active"
                }],
                "data": {
                    "from": "user",
                    "to": "tester",
                    "quantity": "2500.0000 EOS",
                    "memo": "m"
                },
                "hex_data": "00000000007015d6000000005c95b1ca40787d010000000004454f5300000000016d"
            },
            "elapsed": 4,
            "cpu_usage": 0,
            "console": "",
            "total_cpu_usage": 0,
            "trx_id": "a4b4d3303c8034dd2298f87c8481a001e009871a16e3365a74703bf138dfdf47",
            "inline_traces": []
        }
    }, {
        "global_action_seq": 6518,
        "account_action_seq": 3,
        "block_num": 6506,
        "block_time": "2018-05-15T03:43:15.000",
        "action_trace": {
            "receipt": {
                "receiver": "tester",
                "act_digest": "cc3d56ed6ebe9f34a39a5e042c5d6c3a28131c5f60a708b8eaa6518b1a391540",
                "global_sequence": 6518,
                "recv_sequence": 1,
                "auth_sequence": [
                    ["user",
                        3
                    ]
                ]
            },
            "act": {
                "account": "eosio.token",
                "name": "transfer",
                "authorization": [{
                    "actor": "user",
                    "permission": "active"
                }],
                "data": {
                    "from": "user",
                    "to": "tester",
                    "quantity": "2500.0000 EOS",
                    "memo": "m"
                },
                "hex_data": "00000000007015d6000000005c95b1ca40787d010000000004454f5300000000016d"
            },
            "elapsed": 4,
            "cpu_usage": 0,
            "console": "",
            "total_cpu_usage": 0,
            "trx_id": "a4b4d3303c8034dd2298f87c8481a001e009871a16e3365a74703bf138dfdf47",
            "inline_traces": []
        }
    }],
    "last_irreversible_block": 112987
}
1

I think you could use act_digest to group them because analyzing the code here: https://github.com/EOSIO/eos/blob/3016381ec3a899e19623377d92bd63af534cacfe/libraries/chain/apply_context.cpp#L59 -- it looks like it uses the same act_digest while it increment the others fields sequences.

But I would consider to filter by receiver because I'm pretty sure that you can always be specific on your application wants to trace: the contract (eosio.token), the transfer sender tester or the transfer receiver user?

|improve this answer|||||
  • Yes, we can filter it by receiver. But in my circumstances, I should monitor not only sender account, but also receiver account. If I can't make sure one unique action, there would be many repeated actions in my db.It seems that act_digest is the value of action hash. Thank you very much. – guaiguaihw May 17 '18 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.