You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using web3js to subscribe to logs for specific contracts. This list of contracts is pulled from a database. However, every once in a while this list will be updated. I am not sure of the best way to keep this in sync with the server that is running the code below. I was thinking of using a cronjob to update this every X interval, but that doesn't seem ideal, as the best would be if it can detect the changes and either restart or re-subscribe. There are re-subscription arguments described in the web3js docs (https://web3js.readthedocs.io/en/v1.7.4/web3-eth-subscribe.html) but I am unsure how to get that working with what I am trying to accomplish
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am using web3js to subscribe to logs for specific contracts. This list of contracts is pulled from a database. However, every once in a while this list will be updated. I am not sure of the best way to keep this in sync with the server that is running the code below. I was thinking of using a cronjob to update this every X interval, but that doesn't seem ideal, as the best would be if it can detect the changes and either restart or re-subscribe. There are re-subscription arguments described in the web3js docs (https://web3js.readthedocs.io/en/v1.7.4/web3-eth-subscribe.html) but I am unsure how to get that working with what I am trying to accomplish
Beta Was this translation helpful? Give feedback.
All reactions