Giter VIP home page Giter VIP logo

go-bitcoind's Introduction

bitcoind

A Golang client library wrapping the bitcoind JSON RPC API

Installation

$ go get https://github.com/lomocoin/go-bitcoind

Usage

package main

import (
	"github.com/lomocoin/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)

Documentation

Click on the button below to access the full documentation:

GoDoc

Unit tests

Build Status

More than 100 unit tests are made.

To run tests:

$ go get github.com/onsi/ginkgo/ginkgo
$ go get github.com/onsi/gomega
$ ginkgo

Running Suite: Bitcoind Suite	
=============================
Random Seed: 1401120770
Will run 112 of 112 specs

•••••••••••••••••••••••••••••••••••
Ran 112 of 112 Specs in 0.001 seconds
SUCCESS! -- 112 Passed | 0 Failed | 0 Pending | 0 Skipped PASS

Ginkgo ran in 10.856335553s
Test Suite Passed

Todo

  • GetBlockTemplate
  • submitblock

#####Note on SSL support

Note on ssl support : bitcoind library doesn't verify the server's certificate chain. That means that it accepts any certificate presented by the server and any host name in that certificate. In this mode, TLS is susceptible to man-in-the-middle attacks.

go-bitcoind's People

Contributors

toorop avatar dydysy avatar bigzhu avatar oeohomos avatar philsong avatar crypto-xiansong avatar

Watchers

James Cloos avatar woondroo avatar Xu Yang avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.