A Blockchain Model for Secure Communications in Internet of Vehicles