In this article, we utilize Digital Twins (DT) with edge networks using blockchain technology for reliable real-time data processing and provide a secure, scalable solution to bridge the gap between physical edge networks and digital systems. Then, we suggest a Federated Learning (FL) framework for collaborative computing that runs on a blockchain and is powered by the DT edge network. This framework increases data privacy while enhancing system security and reliability. The provision of sustainable Resource Allocation (RA) and ensure real-time data-processing interaction between Internet of Things (IoT) devices and edge servers depends on a balance between system latency and Energy Consumption (EC) based on the proposed DT-empowered Deep Reinforcement Learning (Deep-RL) agent. The Deep-RL agent evaluates the performance action based on RA actions in DT to distribute its bandwidth resources to IoT devices based on iteration and the actions taken to generate the best policy and enhance learning efficiency at every step. The simulation results show that the proposed Deep-RL-agent-based DT is able to exploit the best policy, select 47.5% of computing activities that are to be carried out locally with 1 MHz bandwidth and minimize the weighted cost of the transmission policy of edge-computing strategies.