Imagine an action, which is not const
, and sometimes (but not always) modify a defined multi index.
I would like to count, how many times a specific action was run. I do not want to introduce any additional iterators (counters).
EOS.IO Stack Exchange is a question and answer site for users and developers of distributed applications built on top of the blockchain operating system, EOS.IO. It only takes a minute to sign up.
Sign up to join this communityImagine an action, which is not const
, and sometimes (but not always) modify a defined multi index.
I would like to count, how many times a specific action was run. I do not want to introduce any additional iterators (counters).
Concerning the count of how many times your action has been called, you can both in mainnet and testnet see the account history of any account. There are listed all the actions called. Like here for the Jungle testnet: http://jungle.cryptolions.io/#accountHist:testexample.
In order to get the actions printed on your terminal, you can try to call:
cleos get actions <your-account-name>
or
cleos get actions <your-account-name> --console
Another pattern you can follow is performing a print("something")
in your action; then, read off-chain that print; count it every time is called off-chain, so you do not have to use RAM to store the counter on-chain.