Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
btcd
✓ github.com/btcsuite/btcd
Connects to a local btcd instance and retrieves node info.
package main
import (
"fmt"
"github.com/btcsuite/btcd/rpcclient"
)
func main() {
client, err := rpcclient.New(&rpcclient.ConnConfig{
HTTPPostMode: true,
DisableTLS: true,
Host: "localhost:8334",
}, nil)
if err != nil {
fmt.Println(err)
return
}
defer client.Shutdown()
info, err := client.GetInfo()
if err != nil {
fmt.Println(err)
return
}
fmt.Printf("Version: %d\n", info.Version)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.25.0latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.