I would like to be able to debug through Geth's Go code - using Intellij Webstorm.
Ideally, I would like to run a, private, Geth node inside of Webstorm and set a breakpoint, but I would also settle for remotely connecting to a local node that I have started from the command line.
It looks to me as if the entry point for Geth is main.go, however, when I try to run this I get the following errors:
.go/src/github.com/ethereum/go-ethereum/cmd/geth/main.go # command-line-arguments cmd/geth/main.go:112: undefined: configFileFlag cmd/geth/main.go:143: undefined: initCommand cmd/geth/main.go:144: undefined: importCommand cmd/geth/main.go:145: undefined: exportCommand cmd/geth/main.go:146: undefined: removedbCommand cmd/geth/main.go:147: undefined: dumpCommand cmd/geth/main.go:149: undefined: monitorCommand cmd/geth/main.go:151: undefined: accountCommand cmd/geth/main.go:152: undefined: walletCommand cmd/geth/main.go:154: undefined: consoleCommand cmd/geth/main.go:154: too many errors
Is someone able to help me with exactly how I can start Geth from within Webstorm i.e. not from the compiled, geth, binary, please?
--- Update after trying to run from the package instead of a file ---
Unfortunately, when I set the package to "github.com/ethereum/go-ethereum/cmd/geth" I get the following errors:
/usr/local/go/bin/go build "-ldflags=-linkmode internal" -o /tmp/___main_go github.com/ethereum/go-ethereum/cmd/geth # github.com/ethereum/go-ethereum/cmd/geth github.com/ethereum/go-ethereum/vendor/github.com/karalabe/hid(.text): relocation target __pthread_unwind_next not defined github.com/ethereum/go-ethereum/vendor/github.com/karalabe/hid(.text): undefined: "__pthread_unwind_next"