go-electrum

module
v0.0.0-...-3563a2c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2018 License: MIT

README

go-electrum GoDoc

This repository is a fork of d4l3k/go-electrum that is unmaintained now.

A pure Go Electrum bitcoin library. This makes it easy to write bitcoin based services using Go without having to run a full bitcoin node.

go-electrum

This is very much WIP and has a number of unimplemented methods. This will eventually be rewritten into a more Go-esque library and handle wallet generation.

Packages provided

  • electrum - Library for using JSON-RPC to talk directly to Electrum servers.
  • wallet - A bitcoin wallet built on btcwallet with Electrum as the backend. Notice: not available at the current vertsion.
  • irc - A helper module for finding electrum servers using the #electrum IRC channel on Freenode. Notice: not supported.

Usage

See example/ for more.

electrum GoDoc
$ go get -u github.com/qshuai/go-electrum/electrum
package main

import (
  "log"

  "github.com/qshuai/go-electrum/electrum"
)

func main() {
    // turn on debug mode
    electrum.DebugMode = true

	node := electrum.NewNode()
    // the specified ip is testnet server
	if err := node.ConnectTCP("39.104.125.149:9629"); err != nil {
		log.Fatal(err)
	}
    
    // please use bitcoin address accordant to the server environment
	balance, err := node.BlockchainAddressGetBalance("n4FyJMDYXJmPEm7cffFLrwLXvGWn8cW9q2")
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Address balance: %+v", balance)
}

License

go-electrum is licensed under the MIT license.

Made by Tristan Rice.

Directories

Path Synopsis
Package wallet provides a simple interface to btcwallet and electrum.
Package wallet provides a simple interface to btcwallet and electrum.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL