I heard a message was encoded into the blockchain, how can I read it? I have been running a few full Bitcoin nodes for a long while now and I've decided to start learning how to interact with a node to get different information. Recently, Elon Musk's two messages were added to the Bitcoin blockchain. I wondered if as a starting pointI could directly interact with my BTC node and extract information like reading these two messages?
I saw this tweet in which it was mentioned that F2Pool included a message in coinbase transaction related to Elon Musk's tweet: https://twitter.com/zackvoell/status/1355152428903985157
Block: 668197
Use the below commands to get the message:
getblockhash 668197
getblock 000000000000000000023c31edf49adb2306d0db74e6f1f032ef76deaa7a464a 2
The first tx that you see in the JSON results will have a coinbase value which can be converted from hex to ascii using https://www.rapidtables.com/convert/number/hex-to-ascii.html
Or you can use this command on Linux which uses jq and xxd to make it easier:

bitcoin-cli getblock `bitcoin-cli getblockhash 668197` 2 | jq -r '.tx[0].vin[0].coinbase' | xxd -r -p

It was mentioned by Sjors Provoost in https://twitter.com/provoost/status/1345726239676489728
Can be verified by comparing with the things that you see for block 668197 on a block explorer: https://bitaps.com/668197