The code connects to a Kusama (or Polkadot) node using WebSocket.
In each loop, the code retrieves the latest block header (block number and hash).
The code checks whether the node is syncing and displays information about the current and highest block.
The code retrieves information about the number of peers and the sync status to determine if the node is healthy.
The program repeats the requests every 10 seconds to continuously monitor the node’s state.