Smart devices are connected to IoT networks and the security risks are substantial. Using blockchain technology, which is decentralized and distributed, 5G-enabled IoT networks might be able to tackle security issues. In order to simplify the implementation and security of IoT networks, we propose a multi-level blockchain security model. As part of the multi-level architecture, the communication between levels is facilitated by clustering. IoT networks define unknown clusters with applications that utilize the evolutionary computation method coupled with anatomy simulation and genetic methodologies. Authentication and authorization are performed locally by the super node. The super node and relevant base stations can communicate using local private blockchain implementations. A blockchain improves security and enhances trustworthiness by providing network authentication and credibility assurance. The proposed model is developed using the open-source Hyperledger Fabric blockchain platform. Stations communicate securely using a global blockchain. Compared to the earlier reported clustering algorithms, simulations demonstrate the efficacy of the proposed algorithm. In comparison with the global blockchain, the lightweight blockchain is more suitable for balancing network throughput and latency.