Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 1.35 KB

README.md

File metadata and controls

39 lines (31 loc) · 1.35 KB

Electrum Client

Build Status GoDoc Version Software License Go Report Card

Provides a pure Go electrum protocol client implementation.

Features include:

  • Simple to use
  • Subscriptions are managed via channels and context
  • Full TCP and TSL support
  • Safe for concurrent execution

Example

// Start a new client instance
client, _ := electrum.New(&electrum.Options{
  Address:   "node.xbt.eu:50002",
  KeepAlive: true,
})

// Execute synchronous operation
version, _ := client.ServerVersion()

// Start a subscription, will terminate automatically after 30 seconds
ctx, cancel := context.WithTimeout(context.Background(), 30 * time.Second)
defer cancel()
headers, _ := client.NotifyBlockHeaders(ctx)
for header := range headers {
  // Use header
}

// Finish client execution
client.Close()