IP of previous node can be obtained only by standalnone using protocol? Or is way to get that info from Bitcoin client - for exmaple by ZMQ?
I believe this is how most block explorers get it (the relay IP of a new transaction that is:) (Not sure if it's still up to date either.)
Blockchain.info lists the first IP address it sees a new transaction from.
If you aren't the one creating the transaction, and aren't accidentally the node right in between the node that does and blockchain.info, it's unlikely that you're the first to do so. Furthermore, they may not even be connected to you the whole time.
To see what transactions are being relayed, start bitcoind with -debug=net, and look for 'inv' messages in the debug.log file.
Basically: the relayed_by stat is pretty darn useless.
I'm not sure if ZMQ actually gives info regarding IP adresses.
https://bitcoin.stackexchange.com/a/40755 says only
notifications for blocks/tx's.
and
https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.mdMight very well be wrong though.