Detect and mitigate blockchain-based DDoS attacks using machine learning and smart contracts