Skip to content

A Golang client library wrapping the bitcoind JSON RPC API

License

Notifications You must be signed in to change notification settings

tokyliu/go-bitcoind

 
 

Repository files navigation

bitcoind

A Golang client library wrapping the bitcoind JSON RPC API

Installation

$ go get github.com/tokyliu/go-bitcoind

Usage

package main

import (
	"github.com/tokyliu/go-bitcoind"
	"log"
)

const (
	SERVER_HOST        = "You server host"
	SERVER_PORT        = port (int)
	USER               = "user"
	PASSWD             = "passwd"
	USESSL             = false
	WALLET_PASSPHRASE  = "WalletPassphrase"
)

func main() {
	bc, err := bitcoind.New(SERVER_HOST, SERVER_PORT, USER, PASSWD, USESSL)
	if err != nil {
		log.Fatalln(err)
	}

	//walletpassphrase
	err = bc.WalletPassphrase(WALLET_PASSPHRASE, 3600)
	log.Println(err)

	// backupwallet
	err = bc.BackupWallet("/tmp/wallet.dat")
	log.Println(err)


	// dumpprivkey
	privKey, err := bc.DumpPrivKey("1KU5DX7jKECLxh1nYhmQ7CahY7GMNMVLP3")
	log.Println(err, privKey)

}

Mores examples in example.go (in examples folder)

About

A Golang client library wrapping the bitcoind JSON RPC API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%