This article proposes a blockchain-based architecture for the optimal scheduling of the dispatchable units in the smart grids considering the high penetration of renewable energy sources. The proposed method makes use of blockchain technology to secure the data exchange among the agents in the smart grid and avoid unauthorised access to the real data of the system. Considering the flexibility which is provided by the optimal switching in the smart grid, the reconfiguration problem is also considered in the model using some remote control switches. A stochastic framework based on the unscented transform is proposed to not only capture the independent randomness of the renewables but also to handle the correlated uncertainties among them. The problem formulation is constructed as a multi-objective optimization problem optimizing the total operating cost and the reliability indices. Due to the nonlinear and complex nature of the problem, a new optimization method based on the honey bee mating (HBM) algorithm is proposed to solve the problem without any simplification or linearization. Moreover, a correction approach based on local search is proposed to increase the algorithm capability. The appropriate performance of the proposed model is examined on a test smart grid. The data for the optimal decision is based on the internet of things (IoT) data.