The massive adoption of Electric Vehicles (EVs) requires the grid system to coordinate with a large number of energy transactions, where the current grid network poses vulnerability against the excessive power loads and attacks. The difficulty of an efficient charging/discharging control mechanism lies on the randomness of future events and scalability of the transaction platform. In this paper, a Proof-of-Benefit consensus mechanism with Online benefit generating (ONPoB) algorithm is proposed on the blockchain platform to handle the EV charging/discharging loads to flatten the overall power load fluctuation. It is demonstrated that all EVs can be charged and achieves a best-known competitive ratio of 2.39. The ONPoB consensus mechanism is approved to better accommodate the EV scenario compared with other mechanisms. And the ONPoB algorithm is able to substantially reduce the Power Fluctuation Level (PFL) in comparison with popular scheduling algorithms.