Closed bart closed 2 years ago
@bart Please go through web3 documentation. You will find what types you can subscribe for. Here's the link for newBlockHeaders. Thanks. https://web3js.readthedocs.io/en/v1.2.11/web3-eth-subscribe.html#subscribe-newblockheaders
Hey, great work and an awesome post you wrote about this topic. Thanks a lot, appreciate it. While looking through your code I saw the subscription on
newBlockHeaders
event. What is this subscription actually for? Is it just used as a trigger for price monitoring? As far as I can see I could also be replaced by a simple while(true){} loop that sleeps for a couple of seconds every loop, correct? Or do I miss something here?