generatetoaddress is for regtest only. It is only used for testing purposes. It cannot be used on mainnet. Bitcoin Core no longer has mainnet mining capability. This has been removed for a long time
What? Since when? Works fine for me:
$ ./bitcoin-cli generatetoaddress 1 bc1qw64su7f6sdf9qqawa40v2uq7crzrrmzs2qx2hl
[
]
(and setting a high max tries makes it take a long time to return while it busily tries many times).
It has an utterly negligible chance of finding a block because the little cpu miner does so little work compared to the current difficulty, of course, but it works.
Please don't conflate "this would be a waste of your time and energy" with "this will not work".
Yelling at people that they shouldn't or can't mine has done a lot of harm to Bitcoin. And a bitcoin node that couldn't mine at all-- even if the mining is only useful in a testing capacity without the help of an asic-- wouldn't deserve being called a node.
I have been trying to mine Bitcoin with my CPU merely as an experiment to see what a modern CPU (Ryzen 5950x) hash rate would be. I have tried to do so with the most recent version of Bitcoin Core as well as old as 0.10.3, but when I enter the command "generatetoaddress" it states "Method not found (code -32601)." What would be the easiest way to see what the bitcoin hash rate on a modern CPU would be? I'm fully aware that it is not profitable to do so and this wouldn't be a long term thing. I just thought it would be a fun experiment to find out how many 16 core CPU's it would take to match a modern day ASIC.