Skip to content

Instantly share code, notes, and snippets.

@inhies
Created April 5, 2013 20:58
Show Gist options
  • Save inhies/5322585 to your computer and use it in GitHub Desktop.
Save inhies/5322585 to your computer and use it in GitHub Desktop.
A simple test program for using my bitcoin package
package main
import (
"fmt"
"github.com/inhies/go-bitcoin"
"github.com/kylelemons/godebug/pretty"
)
var Conn bitcoin.Client
// Setup our configuration details
func init() {
Conn.Username = "bitcoinrpc"
Conn.Password = "youbetterchangeme"
Conn.Addr = "127.0.0.1:8332"
Conn.UseSSL = false
}
func main() {
result, err := Conn.GetBlockCount()
if err != nil {
fmt.Println(err)
return
}
pretty.Print(result)
result2, _ := Conn.GetInfo()
pretty.Print(result2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment