A major issue facing the quickly evolving technological world is the surge in security concerns, particularly for critical internet of things (IoT) applications like health care and the military. Early security attack detection is crucial for safeguarding important resources. Our research focuses on developing an anomaly-based intrusion detection system (IDS) using machine learning (ML) models. With the use of voting strategies, bagging ensemble, boosting ensemble, and random forest, we created a robust and long-lasting IDS. The F1 score is a crucial metric for measuring accurate predictions at the class level and serves as the focus of these ML systems. Maintaining a high F1 score in critical applications highlights the constant need for development. Make use of the latest Canadian Institute for cybersecurity internet of things (CICIoT) 2023 dataset employ hyperledger fabric to create a private channel in order to bolster the security of our IDS through the usage of block-chain technology. We use block-chain's immutable record and cryptographic techniques to establish a decentralized, tamper-proof environment. Consequently, our proposed approach provides an efficient IDS that significantly enhances resource protection and alerting the user in prior with intruder information incritical regions for IoT security applications.