nmcjson extends the btcjson package with Namecoin-specific JSON-RPC commands.
// Register nmcjson commands with btcjsonnmcjson.Init()
id:=1// Create the commandnameListCmd, err:=nmcjson.NewNameListCmd(id)
iferr!=nil {
panic("Something wrong")
}
// Send the command and get a replynameListReply, err:=btcjson.RpcSend(myName, myPass, myURL, nameListCmd)
iferr!=nil {
panic("Something wrong")
}
// Print the replyifnameListReply.Result!=nil {
ifinfo, ok:=nameListReply.Result.([]nmcjson.NameListResult); ok {
for_, v:=rangeinfo {
fmt.Printf("Name: %v\n", v.Name)
}
}
}Full go doc style documentation can be viewed online using the GoDoc site here.
$ go get github.com/kefkius/nmcjson- Unit tests
nmcjson is licensed under the liberal ISC License, the same license btcjson is licensed under.