Edge services provide an effective and superior means of real-time transmissions and rapid processing of information in the Industrial Internet of Things (IIoT). However, the continuous increase of the number of smart devices results in privacy leakage and insufficient model accuracy of edge services. To tackle these challenges, in this article, we propose a blockchain-based machine learning framework for edge services (BML-ES) in IIoT. Specifically, we construct novel smart contracts to encourage multiparty participation of edge services to improve the efficiency of data processing. Moreover, we propose an aggregation strategy to verify and aggregate model parameters to ensure the accuracy of decision tree models. Finally, based on the SM2 public key cryptosystem, we protect data security and prevent data privacy leakage in edge services. Theoretical analysis and simulation experiments indicate that the BML-ES framework is secure, effective, and efficient, and is better suitable to improve the accuracy of edge services in IIoT.