Closed-loop Cyber-Physical Systems (CPSs) are significant constituent elements for smart city applications. However, security and resiliency of closed-loop CPSs can be compromised due to the centralized control structure, network interdependency and power/computational constraints. In this paper, towards addressing this problem, we propose a blockchain based de-centralized closed-loop CPS framework. Sensed measurements are stored on the blockchain and controller implementation and actuation is realized using smart contracts. The feasibility of the proposed approach is demonstrated via its simulative implementation on a distributed frequency control system within an islanded microgrid. A co-simulation framework is developed that incorporates a microgrid simulated in Matlab interfaced with Ethereum blockchain. Actuated signals from smart contracts embedded with a distributed frequency control algorithm dictate the microgrid's operating frequency to its nominal value. The effectiveness of the proposed method is demonstrated through the convergence of the time-dependent signals to their expected nominal values. In addition, the feedback delays involved in transacting the sensed data and generating the actuation signals are characterized and found to be of the order of a few seconds, which is acceptable for the purpose of secondary frequency control and does not lead to instability. The effect of the block size and the crypto puzzle difficulty level on the delays is also investigated and while the difficulty does not affect the delay significantly, the increase in block size can lead to excessive delay values.