ETH full node is still a waste of resources, especially in the synchronization of all the blockchain, if you are going to do a local full-node debug, a bit unrealistic. This document
Compile, install Devel on the machine to run, the general method is, after compiling, put on the server, install Delve Debug tool: Https://github.com/derekparker/delve
After installation, go to the project root/ cmd/geth directory.
Run the go build -gcflag='-N -l' command, Golang 1.10 run the go build -gcflag='all -N -l command, after this step, you should find an executable file named after the directory geth .
Then run the command (the last argument to dlv --listen=:6070 --headless=true --api-version=2 exec geth -- -- distinguish the geth parameter, without this delimiter, it will be considered later arguments or DLV parameters) ..... This command is to open a debug server and listen to the 6070 port on this machine.
Go to Goland, here we use Goland for code trace debugging, add go remote option, add correct parameters, start debug, if console appears image.png
that is, the connection is successful, enjoy you debugging !