Unable to make custom Bitcoin command I'm writing a thesis on Bitcoin system and as a part of my assignment i have to explore Bitcoin-core source code.

I 've downloaded the code, compiled it and manage to run it.
However, I wanted to make a trivial change to the code and add some simple custom command as part of blockchain.cpp.
Problem is that my changes are not visible after i run make and when I run bitcoin-cli -testnet .

I always get:
error code: -32601
error message:
Method not found

Also, i tried commenting out one already functional method and tried to run bitcoin-cli and calling that function and it runs successfully.
NOTE: command "make" runs smoothly and it does detect errors if there are any.

Can someone explain me what is a proper way to make change to bitcoin-core? I am not planning to push any of those changes to master branch, I'm just interested in experimenting with code.

Thanks in advance :)
To add a new RPC, you need to write the function the implements it's action, add the function to the dispatch table, and update bitcoin-cli's type conversion table.

At the bottom of the RPC file you added your function to (in this case, src/rpc/blockchain.cpp, you will see a table that has all of the RPCs in that file as well as some extra information about them like category, name, and argument names. Add your new RPC to that table.

Next, if your command has any arguments which are not strings, open src/rpc/client.cpp and add those arguments to the vRPCConvertParams list there. In that list, you give it the RPC name, the index of the argument that needs to be converted, and the name of that argument.