While edge computing has the potential to offer low-latency services and overcome the limitations of traditional cloud computing, it presents new challenges in terms of trust, security, and privacy (TSP) in IoT environments. Cooperative edge computing (CEC) has emerged as a solution to address these challenges through resource sharing among edge nodes. However, for multi-infrastructure providers, incentive and trust mechanisms among edge nodes are crucial technical issues that must be addressed alongside system latency and reliability to meet performance requirements. In this paper, we propose a blockchain-assisted intelligent edge cooperation system (BIECS) to systematically solve these issues. By leveraging blockchain technology, we construct trust among edge nodes and employ an incentive mechanism for resource sharing among multi-infrastructure providers. We formulate the system performance optimization as a multi-objective joint optimization problem and solve it efficiently through a two-stage strategy for selecting edge nodes. We first design an improved Long Short Term Memory (LSTM) model for resource prediction and then select edge nodes for executing offloaded tasks and handling the corresponding blockchain process related to each task execution. To evaluate the performance of BIECS, we implement the system based on Hyperledger Fabric and design extensive experiments. Our proposed system achieves better performance in terms of system delay, throughput, and resource utilization compared to state-of-the-art schemes for edge cooperation.