| At present,the quality and safety of agricultural products are becoming increasingly prominent,while the traditional traceability system based on centralized database has problems such as information asymmetry,poor information authenticity and information silos.Blockchain is naturally suitable for the field of agricultural product traceability because of its characteristics such as decentralization,immutability and traceability.Therefore,this thesis aims to build a safe and reliable agricultural products traceability system based on blockchain technology.Meanwhile,the consensus mechanism in the blockchain is improved to improve the system performance and applied to the agricultural product traceability system.The main research contents of this thesis are as follows:(1)To explore the feasibility of combining agricultural product traceability system and blockchain by analyzing the current situation of domestic and foreign research on agricultural product traceability and blockchain technology.On this basis,Hyperledger Fabric is selected as the blockchain development framework,and the problems of Raft consensus algorithm in Fabric in complex network environment are deeply analyzed,including the frequent triggering of unnecessary elections by leader nodes and the strong power problem after being elected.(2)To address the leader node election problem in the Raft algorithm,this thesis proposes two improvement schemes: a follower voting strategy based on a check mechanism to reduce unnecessary elections,and a leader node replacement based on a server performance threshold to cope with the strong power problem.It is experimentally demonstrated that the improved Raft algorithm has fewer leader elections in complex network environments and can improve consensus performance by replacing leader nodes in a timely manner.(3)Designed and implemented an agricultural information traceability system based on Hyperledger Fabric.The system is designed and implemented using a software engineering approach,which aims to integrate the participants in the supply chain and solve the problems of traditional traceability systems by using the characteristics of blockchain.In addition,based on the improved Raft algorithm,this paper builds a Fabric network and deploys the corresponding smart contracts,on which the agricultural product information traceability system is implemented.Through the research,this paper expects to provide a safe and reliable agricultural products information traceability system,enhance consumers’ confidence in the quality and safety of agricultural products,and promote the healthy development of the agricultural market. |