initial commit

This commit is contained in:
2025-08-14 19:49:29 -06:00
parent 48a60f3f58
commit 88d1e0bdb3
17 changed files with 1472 additions and 15 deletions

32
example/singleserver.go Normal file
View File

@@ -0,0 +1,32 @@
package main
import (
"context"
"log"
"time"
"code.stevenpolley.net/steven/go-electrum/electrum"
)
func main() {
client, err := electrum.NewClientTCP(context.Background(), "bch.imaginary.cash:50001")
if err != nil {
log.Fatal(err)
}
serverVer, protocolVer, err := client.ServerVersion(context.Background())
if err != nil {
log.Fatal(err)
}
log.Printf("Server version: %s [Protocol %s]", serverVer, protocolVer)
go func() {
for {
if err := client.Ping(context.Background()); err != nil {
log.Fatal(err)
}
time.Sleep(60 * time.Second)
}
}()
}