Actually not that much work.
Basically what he needs to do is write a SOCKS5 Client that will connect to tor, provide the destination(onion address in case of Tor)
ort etc and then exchange traffic as he normally would.
On Masternode machine, he adds the following lines in torrc file and starts tor.
Code:
HiddenServiceDir /home/masternode_hs
HiddenServicePort master_node_port 127.0.0.1:master_node_port
That's it.
With I2P its different, because I2P does not naturally support SOCKS. I hope masternodes don't use UDP and implementation of Tor will be as easy as I explained above. If they use UDP then he must use I2P.
If he was to go on forum.i2p (you need I2P to access it) and simply ask for help I am sure the I2P community will be more than welcoming to help him implement it because it is also a huge gain to the I2P network in terms of publicity, speed, anonymity and latency decrease.
Edit: FYI Tor doesn't add any additional security on top of your server except anonymity and DDOS protection. It cannot protect you from SQL Injection and other sorts of software vulnerability.