mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-09-17 19:13:56 +02:00
update readme and example.
This commit is contained in:
@@ -86,7 +86,7 @@ pub, _ := nostr.GetPublicKey(sk)
|
|||||||
|
|
||||||
ev := nostr.Event{
|
ev := nostr.Event{
|
||||||
PubKey: pub,
|
PubKey: pub,
|
||||||
CreatedAt: time.Now(),
|
CreatedAt: nostr.Now(),
|
||||||
Kind: 1,
|
Kind: 1,
|
||||||
Tags: nil,
|
Tags: nil,
|
||||||
Content: "Hello World!",
|
Content: "Hello World!",
|
||||||
|
@@ -52,7 +52,7 @@ func main() {
|
|||||||
|
|
||||||
// create a subscription and submit to relay
|
// create a subscription and submit to relay
|
||||||
// results will be returned on the sub.Events channel
|
// results will be returned on the sub.Events channel
|
||||||
sub := relay.Subscribe(ctx, filters)
|
sub, _ := relay.Subscribe(ctx, filters)
|
||||||
|
|
||||||
// we will append the returned events to this slice
|
// we will append the returned events to this slice
|
||||||
evs := make([]nostr.Event, 0)
|
evs := make([]nostr.Event, 0)
|
||||||
@@ -101,7 +101,7 @@ func main() {
|
|||||||
panic(e)
|
panic(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
ev.CreatedAt = time.Now()
|
ev.CreatedAt = nostr.Now()
|
||||||
ev.Kind = 1
|
ev.Kind = 1
|
||||||
var content string
|
var content string
|
||||||
fmt.Fprintln(os.Stderr, "enter content of note, ending with an empty newline (ctrl+d):")
|
fmt.Fprintln(os.Stderr, "enter content of note, ending with an empty newline (ctrl+d):")
|
||||||
@@ -123,6 +123,7 @@ func main() {
|
|||||||
fmt.Println(e)
|
fmt.Println(e)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fmt.Println("posting to: ", url, relay.Publish(ctx, ev))
|
fmt.Println("posting to: ", url)
|
||||||
|
relay.Publish(ctx, ev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user