I'm trying to learn about deferred transactions.

I'm creating a bogus deferred transaction that invokes a non-existent action "fakeaction":

transaction out{};
out.actions.emplace_back(permission_level{_self, "active"_n}, _self, "fakeaction"_n, std::make_tuple(from, quantity));
out.delay_sec = 1;
out.send(now(), payer);

Nodeos is happily informing me that the deferred transaction is being included into a block (the first "trxs: 1" is the cleos-dispatched transaction, and the second "trxs: 1", after the 1sec delay (2 blocks) can only mean the deferred transaction).

info  2019-02-15T15:53:21.002 thread-0  producer_plugin.cpp:1584      produce_block        ] Produced block 00000b45028c637f... #2885 @ 2019-02-15T15:53:21.000 signed by eosio [trxs: 1, lib: 2884, confirmed: 0]
info  2019-02-15T15:53:21.502 thread-0  producer_plugin.cpp:1584      produce_block        ] Produced block 00000b4681cc00e7... #2886 @ 2019-02-15T15:53:21.500 signed by eosio [trxs: 0, lib: 2885, confirmed: 0]
info  2019-02-15T15:53:22.002 thread-0  producer_plugin.cpp:1584      produce_block        ] Produced block 00000b47f7199509... #2887 @ 2019-02-15T15:53:22.000 signed by eosio [trxs: 1, lib: 2886, confirmed: 0]

Invoking an action that is supposed to exist in my code yields the same behavior.

The onError() mechanism for catching failed deferred transactions doesn't seem to be triggering.

Is the deferred transaction error logged anywhere in nodeos? How can I debug deferred transactions when I'm running everything in my local machine?

Also, if I print() from a deferred transaction (or the onError() handler), then where is the output supposed to go to?

I am able to feed a custom "logging.json" file into nodeos and I can increase the log level of the console output, but I'm not sure I'm providing the correct logging config to allow me to debug deferred transactions.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.