I know that I can use eosjs to read/query multi_index table data from the chain. However, my goal is to listen to/on these changes. Specifically, I want to receive a notification whenever something happens on-chain.
Therefore, I need a persistent connection to the chain, whether using web sockets, mqtt (pub-sub) or any other real-time protocol. How to do this? does the eosjs library support this?
Of course, I can write a while(true) loop, where I send RPC requests all the time to check if something has changed, but this is not a good solution, so I'm interested if other people already solved this issue.
Also, some websites like https://eosauthority.com/ show real-time data of what is happening on the eosio network. So, how do they do this?