Gossip protocol and push-sum algorithm in a distributed environment