write constructor of P2P Client