AI and Blockchain in Smart Grids (Fundamentals, Methods, and Applications)