Created
April 5, 2013 20:58
-
-
Save inhies/5322585 to your computer and use it in GitHub Desktop.
A simple test program for using my bitcoin package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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