As energy systems play a central role in essentially every aspect of human lives, it is of utmost importance to attain their efficiency and robustness. Emerging computing paradigms such as Internet of Things (IoT) and cloud computing have been increasingly used to improve traditional control systems for energy generation, which also brought new challenges. Once the equipment and the sensor network-based IoT are connected to the Internet, they would be at more risk of cyber attacks, and the consequences become even more devastating if attackers get to remotely control the system and send malicious instructions. It has been well recognized that the new threats mainly come from the cloud-based infrastructure. Besides the obvious drawback of a central server being a single point of failure, such a centralized scheme also has several other notable shortcomings for IoT energy systems. For example, the traditional server/client model is not best suited in this setting; the collapse of one node may affect the rest of the system; the centralized management of many concurrent tasks becomes cumbersome and potentially causes privacy and compatibility issues. The advent of blockchain technology offers us a promising solution to decentralizing IoT energy systems. The blockchain technology enables many participating peers to jointly maintain an append-only database (also known as a ledger), which can be viewed as a bulletin board for dispersing real-time data and instructions for actuators. We will investigate if a blockchain-based IoT energy system is able to eliminate the drawbacks of a centralized one but still with satisfactory or even higher efficiency . We propose a comprehensive study of this problem with focus on energy generation that utilizes fossil fuels. Depending on the functionalities of the energy generation system, our approach will proceed in the following steps. Design and implement a private blockchain that enables the devices to jointly manage and monitor the energy generation equipment. This also involves various methods for data analytics to better understand the system. Design and implement a private blockchain that enables the sensors and actuators to jointly optimize the combustion process, which extracts energy from fuels for later transformation. The actuators constantly scan the ledger and take immediate actions once all data sources are posted and certain conditions are satisfied. Design and implement a private blockchain that enables the sensors and actuators to jointly optimize the steam-turbine cycle that actually outputs electricity. This utilizes a similar infrastructure for combustion optimization, but the functionalities of the actuators vary according to the optimization strategy. Integrate all submodules to build a complete blockchain for the entire energy generation system, and experiment the proposed blockchain with the integrated protocols in a simulated environment for performance evaluation and feasibility test. We will develop the integrated blockchain-based software package as a product to be de- ployed in real energy systems. The package will also be made available to the broad research community to analyze and optimize blockchain protocols in other application domains.