I'm trying to write a node that listens all the bitcoin transactions in real time. I'm considering two ways of doing this: The first one is to check mempools of other nodes periodically and the second one is to act like a relay so that other nodes can broadcast transactions to my node. I'm not keeping any blockchain data so it is out of question for me to verify the transactions. So my question is which one would be more reliable, secure and real time? I think the first one is more reliable because in the second case it's not certain that all transactions will be broadcasted to me but again it seems like there won't be any latency in the second case. What do you think? And also are there some better ways to achieve this?
ps: i don't want to use a third party api, it all should be handled from my node.