This question already has an answer here:
- What is meant by the term “gas”? 7 answers
Let say I have a code that print "Hello World". I deploy it to the blockchain and pay 1000 gas for it. Will my code keep running for every subsequent block till it runs out of gas? Or will it only run when other user interact with it?