The Internet of Things (IoT) has been widely adopted in many smart applications such as smart cities, healthcare, smart farms, industry etc. In recent few years, the greenhouse industry has earned significant consideration from the agriculture community due to its ability to produce fresh agricultural products with immense growth and production rate. However, labour and energy consumption costs increase the production cost of the greenhouse by 40–50% approximately. Moreover, the security and authenticity of agriculture data, particularly for yield monitoring and analysis, is also a challenging issue in current greenhouse systems.The greenhouse require optimal parameter settings with controlled environment to produce increase food production. Therefore, slight advancement can bring remarkable improvements concerning the increase in production with reduced overall cost. In this work, we contributed blockchain enabled optimization approach for greenhouse system. The proposed approach works in three steps to provide optimal greenhouse environment that are; prediction, optimization, and finally controlling. Initially, the Kalman filter algorithm is employed for predicting the greenhouse sensor data. In next step, the optimal parameters are computed for the indoor greenhouse environment. Finally, the optimized parameters are utilized by the control module to operate and regulate the actuator's state to meet the desired settings in the indoor environment. To evaluate the performance of our proposed greenhouse system, we have developed an emulation tool. The proposed system has been investigated and compared against baseline approach concerning production rate and energy consumption. The obtained results reveal that the proposed optimization approach has improved the energy consumption by 19% against the prediction based approach and 41% against the Baseline scheme. Furthermore, the proof-of-concept based on the Hyperledger Fabric network is implemented on the top of the proposed greenhouse platform. For experimental analysis, we have conducted a series of experiments using Hyperledger calliper concerning throughput, latency, and resource utilization. These results advocates the efficiency of the proposed optimal greenhouse system.