Open yangyile1990 opened 8 months ago
A panic gives you a stack trace that tells you exactly where something panics and why. Without that information, we cannot help you.
I've encountered this error when I specified an incorrect host path (such as /wallet/:walletName
, where walletName
does not exist) when connecting to a bitcoind node. rpcclient simply proxies this error from the node. Check the connection host
Since you're using panic, the runtime should print the file and line number where the panic originated. The error message you showed doesn't explicitly indicate the source of error. You can as well use the log.Fatalf
function to print the stack trace along with the panic error message.
Hi,
Not all providers require authentication through a password or a cookie. Given the following configuration:
cfg := &rpcclient.ConnConfig{
Host: "go.getblock.io/0371879beb44418680721ddd4cd53f81",
User: "",
Pass: "",
DisableTLS: true,
HTTPPostMode: true,
}
getAuth()
will call config.retrieveCookie()
and because there's no config.CookiePath
there will be an error
st, err := os.Stat(config.CookiePath)
fmt.Println("err111", err)
err111 stat : no such file or directory
panic: stat : no such file or directory. why?