1

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).

  • Do you want the action count in your smart contract or you want this off-chain? – Riccardo Persiani Sep 27 '18 at 9:42
2

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.

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.