Giter VIP home page Giter VIP logo

noscl's Introduction

noscl

Go Report Card License: ODbL Latest Release

Command line client for Nostr.

Notice

Although it works, this project is somewhat abandoned. For a more complete CLI experience you can try https://github.com/mattn/algia and for a more streamlined CLI plumbing tool try https://github.com/fiatjaf/nak.

Installation

Compile with go install github.com/fiatjaf/noscl@latest or download a binary.

Usage

noscl

Usage:
  noscl home
  noscl setprivate <key>
  noscl public
  noscl publish [--reference=<id>...] [--profile=<id>...] <content>
  noscl message [--reference=<id>...] <id> <content>
  noscl metadata --name=<name> [--about=<about>] [--picture=<picture>]
  noscl profile <key>
  noscl follow <key> [--name=<name>]
  noscl unfollow <key>
  noscl following
  noscl event <id>
  noscl share-contacts
  noscl key-gen
  noscl relay
  noscl relay add <url>
  noscl relay remove <url>
  noscl relay recommend <url>

The basic flow is something like

  1. Add some relays with noscl relay add <relay url> (see https://nostr.watch/relays/find for some publicly available relays)
  2. Follow some people with noscl follow <pubkey>
  3. Browse some profiles from people (you don't have to be following) with noscl profile <pubkey>
  4. See the feed of people you follow with noscl home
  5. Set your own private key with noscl setprivate <hex private key>
  6. Get your public key with noscl public so you can share it with others
  7. Publish some notes with noscl publish <my note content>

Generate a key

$ noscl key-gen
seed: crowd coconut donate calm position chuckle update friend ball gospel sudden answer bitter dinosaur wise express jaguar file praise pact defy system struggle offer
private key: 5a860fa953c9162611f2e2813ee0526370664534412f31611a4a89149c6bbc9d

$ noscl setprivate 5a860fa953c9162611f2e2813ee0526370664534412f31611a4a89149c6bbc9d

Sign an event manually

noscl sign '{...event as JSON}'
screencast.mp4

noscl's People

Contributors

af913337456 avatar arkin0x avatar bndw avatar fiatjaf avatar honza avatar jb55 avatar lilcorey avatar louneskmt avatar r3drun3 avatar raphjaph avatar realityone avatar rn-g avatar rockerboo avatar vinliao avatar x1ddos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

noscl's Issues

No included way to generate a private key

Right now noscl lets you set a private key using "setprivate", but offers no option to generate a private key for you. Is this something you'd be interested in having noscl support? I can submit a PR for that.

Btc related packages

Hello team,

why there are bitcoin related packages? What are they used for?

I ran this nancy vulnerabilioty check (1) and one of them is affected:

go/noscl ( master ) $  go list -json -deps ./... | nancy sleuth

pkg:golang/github.com/btcsuite/[email protected]
**2 known vulnerabilities affecting installed version** 
[CVE-2022-44797] CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer                                                                                                                    
[CVE-2022-39389] CWE-20: Improper Input Validation                                                                                                                                                                     

(1) https://github.com/sonatype-nexus-community/nancy

Add key conversion tools

For securely converting between hex and bech32, as well as betweeb nsec/npub and hex priv to hex pub.

Ex.
noscl convert --npub d23b81da2b83cdb821cd3b8dbcac393943ba9cd

Output
npub1b6asdtbf68astd6f7863fnt76a4f7as78as

Several tweaks in .md and a bug?

Installation:
go get github.com/fiatjaf/noscl doesn't work anymore,
go install github.com/fiatjaf/noscl@latest works though
Key generation: (with an app installed through go install)
noscl key-gen produces only the usage dump
Work:
noscl home always gives
<> 2022/01/12 12:04:05 read error: websocket: close 1006 (abnormal closure): unexpected EOF

Linux Mint 19.2 Tina
go version go1.17.6 linux/amd64

Panic on publish

[email protected]

Testing a Basic Relay locally
I get

/noscl publish https://salvatorelanza.org/2022/01/19/nostr/
panic: concurrent write to websocket connection

goroutine 29 [running]:
github.com/gorilla/websocket.(*messageWriter).flushFrame(0xc000012480, 0x1, {0x0, 0x7fbf7caf4a68, 0x0})
	/home/sal/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:610 +0x52b
github.com/gorilla/websocket.(*messageWriter).Close(0x0)
	/home/sal/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:724 +0x45
github.com/gorilla/websocket.(*Conn).beginMessage(0xc0000f2160, 0xc0000129c0, 0x1)
	/home/sal/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:473 +0x42
github.com/gorilla/websocket.(*Conn).NextWriter(0xc0000f2160, 0x1)
	/home/sal/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:513 +0x45
github.com/gorilla/websocket.(*Conn).WriteJSON(0xc00033a040, {0x66d1c0, 0xc00000e138})
	/home/sal/go/pkg/mod/github.com/gorilla/[email protected]/json.go:24 +0x45
github.com/fiatjaf/go-nostr.Subscription.Sub({{0xc0004c8070, 0xe}, 0xc000012990, {0xc00032e080, 0x1, 0x1}, 0xc00008e060, 0x0, 0xc00008e0c0})
	/home/sal/go/pkg/mod/github.com/fiatjaf/[email protected]/subscription.go:49 +0xcd
github.com/fiatjaf/go-nostr.(*RelayPool).Sub(0xc000013980, {0xc00032e080, 0x1, 0x1})
	/home/sal/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:197 +0x365
github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent.func1({0xc00014cee0, 0x1f}, 0x0)
	/home/sal/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:236 +0x2ab
created by github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent
	/home/sal/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:228 +0x3f6

bech32 support

I created a key-pair using Damus, and want to use it with noscl. Damus shares my keys using npub and nsec (bech32). Would be great if noscl supported these formats. I haven't found a quick way to convert them to hex.

Update []Follow to map[Follow.Key]Follow

Following []Follow `json:"following,flow"`

Any pubkey should be followed once max. Also, updating the Follow list to a map will help performance when unfollowing O(n) -> O(1)

noscl/profile.go

Lines 54 to 60 in 570241b

var newFollowingList []Follow
for _, follow := range config.Following {
if follow.Key == key {
continue
}
newFollowingList = append(newFollowingList, follow)
}

echo "Hello World" | noscl publish

Isn't that how it should work if you adopt the Unix philosophy? Or am I making a mistake?

stdin should be assumed as default if no string is passed.

Stupid example:

Let's say I want to post my uptime.
$ uptime | noscl publish

Panic using 'event' command line flag

I'm experiencing a segfault with noscl using the event option. Example:

~/go/bin/noscl event 5812eab28abadc3216e560f116cc41f98f1bf4124293432cd6d39936e67a63f9
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x1273561]

goroutine 1 [running]:
github.com/fiatjaf/go-nostr/relaypool.(*RelayPool).Sub(0x0, 0x7ff7bfeffa0a, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/scsibug/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool/relaypool.go:163 +0x1c1
main.view(0xc0000136b0)
	/Users/scsibug/go/pkg/mod/github.com/fiatjaf/[email protected]/event.go:13 +0x125
main.main()
	/Users/scsibug/go/pkg/mod/github.com/fiatjaf/[email protected]/main.go:87 +0x708

Bug in Private Key Encoding/Decoding handling

It seems the following (pool.SecretKey) expects an encoded key string. Currently, we are decoding the key string before setting it here.
https://github.com/fiatjaf/noscl/blob/master/nostr.go#L40-L42

image

It gets fixed with the following patch, i.e. if we set Config.PrivateKey to the raw (encoded) string.
ajx42@f10c434

A related problem is the following, which the above patch also fixes:
showPublicKey is passing the already decoded key to getPubKey: https://github.com/fiatjaf/noscl/blob/master/key.go#L55
There is this older PR that fixes this issue at another place #50

Currently we get this:
image

I can go ahead and fix it if it's okay. Feel free to assign me. I am trying to learn about this codebase, so happy to help.

Panic on metadata update

Got a panic on the latest release while updating metadata. Event publishing succeeded.

noscl metadata --name=bestofhn --description="The Best of Hacker News"  --image="https://news.ycombinator.com/y18.gif"
Sent event 2dd9b62dbca442b5dd2fb8243ab7273117f6ba43d4cdcb213007e8e372453c48 to 'wss://relayer.fiatjaf.com'.
Sent event 2dd9b62dbca442b5dd2fb8243ab7273117f6ba43d4cdcb213007e8e372453c48 to 'wss://nostr-pub.wellorder.net'.
panic: concurrent write to websocket connection

goroutine 13 [running]:
github.com/gorilla/websocket.(*messageWriter).flushFrame(0xc0003ec060, 0x101, 0x0, 0x0, 0x0, 0x2240108, 0x30)
	/Users/scsibug/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:610 +0x62e
github.com/gorilla/websocket.(*messageWriter).Close(0xc0003ec060, 0x0, 0xc00033d948)
	/Users/scsibug/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:724 +0x65
github.com/gorilla/websocket.(*Conn).beginMessage(0xc00019a9a0, 0xc000140e40, 0x1, 0xc00033d998, 0x1081b7c)
	/Users/scsibug/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:473 +0x262
github.com/gorilla/websocket.(*Conn).NextWriter(0xc00019a9a0, 0x1, 0x18, 0x12b9900, 0xc00033da88, 0x1208e18)
	/Users/scsibug/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:513 +0x53
github.com/gorilla/websocket.(*Conn).WriteJSON(0xc00019a9a0, 0x12ae2c0, 0xc000148f48, 0xc000148f48, 0xc0003a5cb8)
	/Users/scsibug/go/pkg/mod/github.com/gorilla/[email protected]/json.go:24 +0x49
github.com/fiatjaf/go-nostr/relaypool.Subscription.Sub(0xc0003a5cd0, 0xe, 0xc000140e10, 0x0, 0x0, 0x0, 0xc000144540, 0x0, 0xc0001445a0, 0xc00033de78, ...)
	/Users/scsibug/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool/subscription.go:51 +0x1e9
github.com/fiatjaf/go-nostr/relaypool.(*RelayPool).Sub(0xc00009b9b0, 0xc00033de78, 0x1, 0x1, 0x0)
	/Users/scsibug/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool/relaypool.go:181 +0x405
github.com/fiatjaf/go-nostr/relaypool.(*RelayPool).PublishEvent.func1(0xc000544930, 0xc000408660, 0xc00009b9b0, 0xc000208d20, 0x19, 0xc0000e2160)
	/Users/scsibug/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool/relaypool.go:216 +0x1a7
created by github.com/fiatjaf/go-nostr/relaypool.(*RelayPool).PublishEvent
	/Users/scsibug/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool/relaypool.go:208 +0x131

`noscl public` fails with "Error decoding key from hex"

steps to reproduce:

$ noscl key-gen                                                                    
seed: royal vintage noise battle film insane define entire airport shield olympic purse doll advance chief gas equal dad route pride just eyebrow few before
private key: 2338b5466b6aefb19f64a6d907e771da7894df1a07a39207aa1353754df8244f
$ noscl setprivate 2338b5466b6aefb19f64a6d907e771da7894df1a07a39207aa1353754df8244f
$ noscl public                                                                     
<> 2023/08/26 17:32:09 Error decoding key from hex: encoding/hex: invalid byte: U+0023 '#'

config.json:

{
  "relays": {},
  "following": {},
  "privatekey": "#8\ufffdFkjﱟd\ufffd\ufffd\u0007\ufffdq\ufffdx\ufffd\ufffd\u001a\u0007\ufffd\ufffd\u0007\ufffd\u0013SuM\ufffd$O"
}

environment:

  • go version go1.21.0 darwin/arm64 (MacOS M1)
  • intallation method: git clone + go install

If I manually set the privatekey in the config.json then I get this:

$ noscl public
25991580b28caf03e519215d25fb3dc0c49f623a8a6f0b518bdf785e0876ecd9
npub1ykv3tq9j3jhs8egey9wjt7eacrzf7c363fhsk5vtmau9uzrkanvsqwnx7u

Event command sends empty filter

Running the "event" command like so:

noscl event 2dd9b62dbca442b5dd2fb8243ab7273117f6ba43d4cdcb213007e8e372453c48

Ends up generating a websocket message like:

["REQ","bb641ed6ae82a8"]

My understanding is that a req command must contain at least one filter.

"fatal error: concurrent map writes" panic

On [email protected]. Similar to #21, it happened using noscl publish. It managed to publish the note, though.

fatal error: concurrent map writes

goroutine 32 [running]:
github.com/fiatjaf/go-nostr.(*RelayPool).Sub(0xc000017050, {0xc00027c960, 0x1, 0x1})
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:199 +0x36f
github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent.func1({0xc0003d3420, 0x1c}, 0x0?)
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:240 +0x28f
created by github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:232 +0x3fa

goroutine 1 [runnable]:
main.printPublishStatus(0xc0001ce680, 0xc0001ce680?)
	/home/user/go/pkg/mod/github.com/1ma/[email protected]/printer.go:81 +0x56
main.publish(0x6e6a40?)
	/home/user/go/pkg/mod/github.com/1ma/[email protected]/publish.go:61 +0x649
main.main()
	/home/user/go/pkg/mod/github.com/1ma/[email protected]/main.go:86 +0x465

goroutine 40 [IO wait]:
internal/poll.runtime_pollWait(0x7f4acddedf98, 0x72)
	/usr/local/go/src/runtime/netpoll.go:306 +0x89
internal/poll.(*pollDesc).wait(0xc0001ce000?, 0xc0001e4000?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc0001ce000, {0xc0001e4000, 0x1300, 0x1300})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x299
net.(*netFD).Read(0xc0001ce000, {0xc0001e4000?, 0x7?, 0x19b?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc0000a0d48, {0xc0001e4000?, 0xc00004d720?, 0xc00004d708?})
	/usr/local/go/src/net/net.go:183 +0x45
crypto/tls.(*atLeastReader).Read(0xc000012b58, {0xc0001e4000?, 0xc000012b58?, 0x0?})
	/usr/local/go/src/crypto/tls/conn.go:788 +0x3d
bytes.(*Buffer).ReadFrom(0xc0000cb790, {0x8cc840, 0xc000012b58})
	/usr/local/go/src/bytes/buffer.go:202 +0x98
crypto/tls.(*Conn).readFromUntil(0xc0000cb500, {0x8ccc40?, 0xc0000a0d48}, 0x1a0?)
	/usr/local/go/src/crypto/tls/conn.go:810 +0xe5
crypto/tls.(*Conn).readRecordOrCCS(0xc0000cb500, 0x0)
	/usr/local/go/src/crypto/tls/conn.go:617 +0x116
crypto/tls.(*Conn).readRecord(...)
	/usr/local/go/src/crypto/tls/conn.go:583
crypto/tls.(*Conn).Read(0xc0000cb500, {0xc000128000, 0x1000, 0x0?})
	/usr/local/go/src/crypto/tls/conn.go:1316 +0x16f
bufio.(*Reader).fill(0xc0000a33e0)
	/usr/local/go/src/bufio/bufio.go:106 +0xff
bufio.(*Reader).Peek(0xc0000a33e0, 0x2)
	/usr/local/go/src/bufio/bufio.go:144 +0x5d
github.com/gorilla/websocket.(*Conn).read(0xc000306160, 0x0?)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:370 +0x2c
github.com/gorilla/websocket.(*Conn).advanceFrame(0xc000306160)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:798 +0x7b
github.com/gorilla/websocket.(*Conn).NextReader(0xc000306160)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:980 +0xcc
github.com/gorilla/websocket.(*Conn).ReadMessage(0x0?)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:1064 +0x19
github.com/fiatjaf/go-nostr.(*RelayPool).Add.func1()
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:99 +0x6b
created by github.com/fiatjaf/go-nostr.(*RelayPool).Add
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:97 +0x445

goroutine 29 [runnable]:
encoding/json.sliceEncoder.encode({0x4b4ba0?}, 0xc0001ce880, {0x6b10c0?, 0xc000012ee8?, 0x6b10c0?}, {0x0?, 0x23?})
	/usr/local/go/src/encoding/json/encode.go:887 +0x32f
encoding/json.(*encodeState).reflectValue(0xc00020f8e8?, {0x6b10c0?, 0xc000012ee8?, 0xc0001d2048?}, {0x80?, 0xde?})
	/usr/local/go/src/encoding/json/encode.go:358 +0x78
encoding/json.(*encodeState).marshal(0x6ed020?, {0x6b10c0?, 0xc000012ee8?}, {0xb8?, 0xc5?})
	/usr/local/go/src/encoding/json/encode.go:330 +0xfa
encoding/json.(*Encoder).Encode(0xc00020fa10, {0x6b10c0, 0xc000012ee8})
	/usr/local/go/src/encoding/json/stream.go:209 +0xf3
github.com/gorilla/websocket.(*Conn).WriteJSON(0xc0001cb0d8?, {0x6b10c0, 0xc000012ee8})
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/json.go:28 +0xc5
github.com/fiatjaf/go-nostr.(*Connection).WriteJSON(0xc0000ced40?, {0x6b10c0?, 0xc000012ee8?})
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/connection.go:22 +0xb0
github.com/fiatjaf/go-nostr.Subscription.Sub({{0xc0001da270, 0xe}, 0xc000017b60, {0xc0003500c0, 0x1, 0x1}, 0xc000285020, 0x0, 0xc000285080, 0x0})
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/subscription.go:48 +0x8b
github.com/fiatjaf/go-nostr.(*RelayPool).Sub(0xc000017050, {0xc0003500c0, 0x1, 0x1})
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:201 +0x3b8
github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent.func1({0xc000294168, 0x16}, 0x5?)
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:240 +0x28f
created by github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:232 +0x3fa

goroutine 28 [runnable]:
github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent.func2()
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:232
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1598 +0x1
created by github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:232 +0x3fa

goroutine 46 [IO wait]:
internal/poll.runtime_pollWait(0x7f4acddeddb8, 0x72)
	/usr/local/go/src/runtime/netpoll.go:306 +0x89
internal/poll.(*pollDesc).wait(0xc0001ce400?, 0xc00021e000?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc0001ce400, {0xc00021e000, 0x1800, 0x1800})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x299
net.(*netFD).Read(0xc0001ce400, {0xc00021e000?, 0x7f4ac46a2e18?, 0xc00004f770?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc000014008, {0xc00021e000?, 0x421f45?, 0xab28e0?})
	/usr/local/go/src/net/net.go:183 +0x45
crypto/tls.(*atLeastReader).Read(0xc000012060, {0xc00021e000?, 0xc000012060?, 0x0?})
	/usr/local/go/src/crypto/tls/conn.go:788 +0x3d
bytes.(*Buffer).ReadFrom(0xc000300610, {0x8cc840, 0xc000012060})
	/usr/local/go/src/bytes/buffer.go:202 +0x98
crypto/tls.(*Conn).readFromUntil(0xc000300380, {0x8ccc40?, 0xc000014008}, 0xc0001ce400?)
	/usr/local/go/src/crypto/tls/conn.go:810 +0xe5
crypto/tls.(*Conn).readRecordOrCCS(0xc000300380, 0x0)
	/usr/local/go/src/crypto/tls/conn.go:617 +0x116
crypto/tls.(*Conn).readRecord(...)
	/usr/local/go/src/crypto/tls/conn.go:583
crypto/tls.(*Conn).Read(0xc000300380, {0xc00035e000, 0x1000, 0x0?})
	/usr/local/go/src/crypto/tls/conn.go:1316 +0x16f
bufio.(*Reader).fill(0xc00027daa0)
	/usr/local/go/src/bufio/bufio.go:106 +0xff
bufio.(*Reader).Peek(0xc00027daa0, 0x2)
	/usr/local/go/src/bufio/bufio.go:144 +0x5d
github.com/gorilla/websocket.(*Conn).read(0xc0002406e0, 0x0?)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:370 +0x2c
github.com/gorilla/websocket.(*Conn).advanceFrame(0xc0002406e0)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:798 +0x7b
github.com/gorilla/websocket.(*Conn).NextReader(0xc0002406e0)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:980 +0xcc
github.com/gorilla/websocket.(*Conn).ReadMessage(0x0?)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:1064 +0x19
github.com/fiatjaf/go-nostr.(*RelayPool).Add.func1()
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:99 +0x6b
created by github.com/fiatjaf/go-nostr.(*RelayPool).Add
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:97 +0x445

goroutine 5 [IO wait]:
internal/poll.runtime_pollWait(0x7f4acddedea8, 0x72)
	/usr/local/go/src/runtime/netpoll.go:306 +0x89
internal/poll.(*pollDesc).wait(0xc0001ce500?, 0xc0001e6600?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc0001ce500, {0xc0001e6600, 0x1300, 0x1300})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x299
net.(*netFD).Read(0xc0001ce500, {0xc0001e6600?, 0x0?, 0x45c2b8?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc000014018, {0xc0001e6600?, 0x0?, 0xc00004b700?})
	/usr/local/go/src/net/net.go:183 +0x45
crypto/tls.(*atLeastReader).Read(0xc0002ae000, {0xc0001e6600?, 0xc0002ae000?, 0x0?})
	/usr/local/go/src/crypto/tls/conn.go:788 +0x3d
bytes.(*Buffer).ReadFrom(0xc000300990, {0x8cc840, 0xc0002ae000})
	/usr/local/go/src/bytes/buffer.go:202 +0x98
crypto/tls.(*Conn).readFromUntil(0xc000300700, {0x8ccc40?, 0xc000014018}, 0x0?)
	/usr/local/go/src/crypto/tls/conn.go:810 +0xe5
crypto/tls.(*Conn).readRecordOrCCS(0xc000300700, 0x0)
	/usr/local/go/src/crypto/tls/conn.go:617 +0x116
crypto/tls.(*Conn).readRecord(...)
	/usr/local/go/src/crypto/tls/conn.go:583
crypto/tls.(*Conn).Read(0xc000300700, {0xc000156000, 0x1000, 0x0?})
	/usr/local/go/src/crypto/tls/conn.go:1316 +0x16f
bufio.(*Reader).fill(0xc000283ec0)
	/usr/local/go/src/bufio/bufio.go:106 +0xff
bufio.(*Reader).Peek(0xc000283ec0, 0x2)
	/usr/local/go/src/bufio/bufio.go:144 +0x5d
github.com/gorilla/websocket.(*Conn).read(0xc0003062c0, 0x0?)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:370 +0x2c
github.com/gorilla/websocket.(*Conn).advanceFrame(0xc0003062c0)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:798 +0x7b
github.com/gorilla/websocket.(*Conn).NextReader(0xc0003062c0)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:980 +0xcc
github.com/gorilla/websocket.(*Conn).ReadMessage(0x0?)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:1064 +0x19
github.com/fiatjaf/go-nostr.(*RelayPool).Add.func1()
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:99 +0x6b
created by github.com/fiatjaf/go-nostr.(*RelayPool).Add
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:97 +0x445

goroutine 11 [runnable]:
internal/poll.runtime_pollWait(0x7f4acddedbd8, 0x72)
	/usr/local/go/src/runtime/netpoll.go:306 +0x89
internal/poll.(*pollDesc).wait(0xc000132300?, 0xc00021f800?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc000132300, {0xc00021f800, 0x1800, 0x1800})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x299
net.(*netFD).Read(0xc000132300, {0xc00021f800?, 0x0?, 0x0?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc0001d2048, {0xc00021f800?, 0x0?, 0x0?})
	/usr/local/go/src/net/net.go:183 +0x45
crypto/tls.(*atLeastReader).Read(0xc00031ef30, {0xc00021f800?, 0xc00031ef30?, 0x0?})
	/usr/local/go/src/crypto/tls/conn.go:788 +0x3d
bytes.(*Buffer).ReadFrom(0xc0000cb090, {0x8cc840, 0xc00031ef30})
	/usr/local/go/src/bytes/buffer.go:202 +0x98
crypto/tls.(*Conn).readFromUntil(0xc0000cae00, {0x8ccc40?, 0xc0001d2048}, 0x0?)
	/usr/local/go/src/crypto/tls/conn.go:810 +0xe5
crypto/tls.(*Conn).readRecordOrCCS(0xc0000cae00, 0x0)
	/usr/local/go/src/crypto/tls/conn.go:617 +0x116
crypto/tls.(*Conn).readRecord(...)
	/usr/local/go/src/crypto/tls/conn.go:583
crypto/tls.(*Conn).Read(0xc0000cae00, {0xc0000f8000, 0x1000, 0x0?})
	/usr/local/go/src/crypto/tls/conn.go:1316 +0x16f
bufio.(*Reader).fill(0xc0000a3da0)
	/usr/local/go/src/bufio/bufio.go:106 +0xff
bufio.(*Reader).Peek(0xc0000a3da0, 0x2)
	/usr/local/go/src/bufio/bufio.go:144 +0x5d
github.com/gorilla/websocket.(*Conn).read(0xc000306840, 0x0?)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:370 +0x2c
github.com/gorilla/websocket.(*Conn).advanceFrame(0xc000306840)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:798 +0x7b
github.com/gorilla/websocket.(*Conn).NextReader(0xc000306840)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:980 +0xcc
github.com/gorilla/websocket.(*Conn).ReadMessage(0x0?)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:1064 +0x19
github.com/fiatjaf/go-nostr.(*RelayPool).Add.func1()
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:99 +0x6b
created by github.com/fiatjaf/go-nostr.(*RelayPool).Add
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:97 +0x445

goroutine 15 [IO wait]:
internal/poll.runtime_pollWait(0x7f4acddedae8, 0x72)
	/usr/local/go/src/runtime/netpoll.go:306 +0x89
internal/poll.(*pollDesc).wait(0xc0001ce480?, 0xc000221000?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc0001ce480, {0xc000221000, 0x1800, 0x1800})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x299
net.(*netFD).Read(0xc0001ce480, {0xc000221000?, 0x0?, 0xc00029d770?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc000014118, {0xc000221000?, 0x0?, 0xc00029d730?})
	/usr/local/go/src/net/net.go:183 +0x45
crypto/tls.(*atLeastReader).Read(0xc0002ae048, {0xc000221000?, 0xc0002ae048?, 0x0?})
	/usr/local/go/src/crypto/tls/conn.go:788 +0x3d
bytes.(*Buffer).ReadFrom(0xc000301410, {0x8cc840, 0xc0002ae048})
	/usr/local/go/src/bytes/buffer.go:202 +0x98
crypto/tls.(*Conn).readFromUntil(0xc000301180, {0x8ccc40?, 0xc000014118}, 0xc0001ce480?)
	/usr/local/go/src/crypto/tls/conn.go:810 +0xe5
crypto/tls.(*Conn).readRecordOrCCS(0xc000301180, 0x0)
	/usr/local/go/src/crypto/tls/conn.go:617 +0x116
crypto/tls.(*Conn).readRecord(...)
	/usr/local/go/src/crypto/tls/conn.go:583
crypto/tls.(*Conn).Read(0xc000301180, {0xc000204000, 0x1000, 0xc000014118?})
	/usr/local/go/src/crypto/tls/conn.go:1316 +0x16f
bufio.(*Reader).fill(0xc0000fde60)
	/usr/local/go/src/bufio/bufio.go:106 +0xff
bufio.(*Reader).Peek(0xc0000fde60, 0x2)
	/usr/local/go/src/bufio/bufio.go:144 +0x5d
github.com/gorilla/websocket.(*Conn).read(0xc000306c60, 0x415234?)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:370 +0x2c
github.com/gorilla/websocket.(*Conn).advanceFrame(0xc000306c60)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:798 +0x7b
github.com/gorilla/websocket.(*Conn).NextReader(0xc000306c60)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:980 +0xcc
github.com/gorilla/websocket.(*Conn).ReadMessage(0xc00029def8?)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:1064 +0x19
github.com/fiatjaf/go-nostr.(*RelayPool).Add.func1()
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:99 +0x6b
created by github.com/fiatjaf/go-nostr.(*RelayPool).Add
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:97 +0x445

goroutine 27 [runnable]:
strconv.appendEscapedRune({0xc000384700, 0x10a, 0x301}, 0x6e, 0x22?, 0x0?, 0x0)
	/usr/local/go/src/strconv/quote.go:68 +0x71b
strconv.appendQuotedWith({0xc00035c140?, 0x8f?, 0x6e8600?}, {0xc000226280, 0x270}, 0x22, 0x0?, 0x0?)
	/usr/local/go/src/strconv/quote.go:52 +0x31a
strconv.AppendQuote(...)
	/usr/local/go/src/strconv/quote.go:135
github.com/valyala/fastjson.escapeString({0xc00035c140, 0x8f, 0xa0}, {0xc000226280, 0x270})
	/home/user/go/pkg/mod/github.com/valyala/[email protected]/parser.go:279 +0x14a
github.com/valyala/fastjson.(*Arena).NewString(0xc00012a600, {0xc000226280?, 0x0?})
	/home/user/go/pkg/mod/github.com/valyala/[email protected]/arena.go:62 +0x150
github.com/fiatjaf/go-nostr.Event.MarshalJSON({{0xc0000c50c0, 0x40}, {0xc0000c4780, 0x40}, {0xc0fe011416f42db6, 0x73722fe4, 0xa82680}, 0x1, {0x0, 0x0, ...}, ...})
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/event_aux.go:123 +0x245
encoding/json.marshalerEncoder(0xc0004c6280, {0x6dc9e0?, 0xc0001ce680?, 0xc00012a808?}, {0x92?, 0xc9?})
	/usr/local/go/src/encoding/json/encode.go:477 +0xbe
encoding/json.(*encodeState).reflectValue(0x6bc8c0?, {0x6dc9e0?, 0xc0001ce680?, 0xc00012a860?}, {0x32?, 0x5c?})
	/usr/local/go/src/encoding/json/encode.go:358 +0x78
encoding/json.interfaceEncoder(0xc0004c6280, {0x6bc8c0?, 0xc0000b60f0?, 0x6b4b20?}, {0xc0?, 0xe6?})
	/usr/local/go/src/encoding/json/encode.go:714 +0xc8
encoding/json.arrayEncoder.encode({0x4?}, 0xc0004c6280, {0x6b10c0?, 0xc00031ef78?, 0xc0001012a0?}, {0x4?, 0x0?})
	/usr/local/go/src/encoding/json/encode.go:914 +0xd5
encoding/json.sliceEncoder.encode({0x416890?}, 0xc0004c6280, {0x6b10c0?, 0xc00031ef78?, 0xc00012aab0?}, {0x0?, 0xa2?})
	/usr/local/go/src/encoding/json/encode.go:887 +0x32f
encoding/json.typeEncoder.func1(0x6b10c0?, {0x6b10c0?, 0xc00031ef78?, 0xc0004c6280?}, {0x80?, 0x0?})
	/usr/local/go/src/encoding/json/encode.go:395 +0x85
encoding/json.(*encodeState).reflectValue(0xc0004c6280?, {0x6b10c0?, 0xc00031ef78?, 0x40ed47?}, {0x78?, 0x0?})
	/usr/local/go/src/encoding/json/encode.go:358 +0x78
encoding/json.(*encodeState).marshal(0x1e?, {0x6b10c0?, 0xc00031ef78?}, {0x68?, 0xca?})
	/usr/local/go/src/encoding/json/encode.go:330 +0xfa
encoding/json.(*Encoder).Encode(0xc00012aca8, {0x6b10c0, 0xc00031ef78})
	/usr/local/go/src/encoding/json/stream.go:209 +0xf3
github.com/gorilla/websocket.(*Conn).WriteJSON(0x7f4acd4fd718?, {0x6b10c0, 0xc00031ef78})
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/json.go:28 +0xc5
github.com/fiatjaf/go-nostr.(*Connection).WriteJSON(0xc0000b60e0?, {0x6b10c0?, 0xc00031ef78?})
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/connection.go:22 +0xb0
github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent.func1({0xc00027e0a0, 0x1c}, 0x4?)
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:233 +0xce
created by github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:232 +0x3fa

goroutine 52 [runnable]:
internal/poll.runtime_pollWait(0x7f4acddedcc8, 0x72)
	/usr/local/go/src/runtime/netpoll.go:306 +0x89
internal/poll.(*pollDesc).wait(0xc0004c6180?, 0xc000244000?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc0004c6180, {0xc000244000, 0x1300, 0x1300})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x299
net.(*netFD).Read(0xc0004c6180, {0xc000244000?, 0x6b4b20?, 0xc00007ec50?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc000014190, {0xc000244000?, 0xc000101bc0?, 0x4?})
	/usr/local/go/src/net/net.go:183 +0x45
crypto/tls.(*atLeastReader).Read(0xc00031ef60, {0xc000244000?, 0xc00031ef60?, 0x0?})
	/usr/local/go/src/crypto/tls/conn.go:788 +0x3d
bytes.(*Buffer).ReadFrom(0xc000301b10, {0x8cc840, 0xc00031ef60})
	/usr/local/go/src/bytes/buffer.go:202 +0x98
crypto/tls.(*Conn).readFromUntil(0xc000301880, {0x8ccc40?, 0xc000014190}, 0x0?)
	/usr/local/go/src/crypto/tls/conn.go:810 +0xe5
crypto/tls.(*Conn).readRecordOrCCS(0xc000301880, 0x0)
	/usr/local/go/src/crypto/tls/conn.go:617 +0x116
crypto/tls.(*Conn).readRecord(...)
	/usr/local/go/src/crypto/tls/conn.go:583
crypto/tls.(*Conn).Read(0xc000301880, {0xc00034e000, 0x1000, 0x4?})
	/usr/local/go/src/crypto/tls/conn.go:1316 +0x16f
bufio.(*Reader).fill(0xc000207e60)
	/usr/local/go/src/bufio/bufio.go:106 +0xff
bufio.(*Reader).Peek(0xc000207e60, 0x2)
	/usr/local/go/src/bufio/bufio.go:144 +0x5d
github.com/gorilla/websocket.(*Conn).read(0xc000307080, 0x6b4b20?)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:370 +0x2c
github.com/gorilla/websocket.(*Conn).advanceFrame(0xc000307080)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:798 +0x7b
github.com/gorilla/websocket.(*Conn).NextReader(0xc000307080)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:980 +0xcc
github.com/gorilla/websocket.(*Conn).ReadMessage(0x0?)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:1064 +0x19
github.com/fiatjaf/go-nostr.(*RelayPool).Add.func1()
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:99 +0x6b
created by github.com/fiatjaf/go-nostr.(*RelayPool).Add
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:97 +0x445

goroutine 25 [runnable]:
internal/poll.runtime_pollWait(0x7f4acdded908, 0x72)
	/usr/local/go/src/runtime/netpoll.go:306 +0x89
internal/poll.(*pollDesc).wait(0xc000132580?, 0xc0002b4000?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc000132580, {0xc0002b4000, 0x1500, 0x1500})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x299
net.(*netFD).Read(0xc000132580, {0xc0002b4000?, 0x30847c40384080a?, 0x2f6bb68000f7683?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc0000a0050, {0xc0002b4000?, 0xcd9f6d033fd675?, 0x211a87702767371?})
	/usr/local/go/src/net/net.go:183 +0x45
crypto/tls.(*atLeastReader).Read(0xc000012e40, {0xc0002b4000?, 0xc000012e40?, 0x0?})
	/usr/local/go/src/crypto/tls/conn.go:788 +0x3d
bytes.(*Buffer).ReadFrom(0xc00028c290, {0x8cc840, 0xc000012e40})
	/usr/local/go/src/bytes/buffer.go:202 +0x98
crypto/tls.(*Conn).readFromUntil(0xc00028c000, {0x8ccc40?, 0xc0000a0050}, 0x186e95500e2115e?)
	/usr/local/go/src/crypto/tls/conn.go:810 +0xe5
crypto/tls.(*Conn).readRecordOrCCS(0xc00028c000, 0x0)
	/usr/local/go/src/crypto/tls/conn.go:617 +0x116
crypto/tls.(*Conn).readRecord(...)
	/usr/local/go/src/crypto/tls/conn.go:583
crypto/tls.(*Conn).Read(0xc00028c000, {0xc0002e8000, 0x1000, 0xf1271903316ff4?})
	/usr/local/go/src/crypto/tls/conn.go:1316 +0x16f
bufio.(*Reader).fill(0xc0002e4180)
	/usr/local/go/src/bufio/bufio.go:106 +0xff
bufio.(*Reader).Peek(0xc0002e4180, 0x2)
	/usr/local/go/src/bufio/bufio.go:144 +0x5d
github.com/gorilla/websocket.(*Conn).read(0xc000240160, 0x38eb2c3023c6f3b?)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:370 +0x2c
github.com/gorilla/websocket.(*Conn).advanceFrame(0xc000240160)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:798 +0x7b
github.com/gorilla/websocket.(*Conn).NextReader(0xc000240160)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:980 +0xcc
github.com/gorilla/websocket.(*Conn).ReadMessage(0x0?)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:1064 +0x19
github.com/fiatjaf/go-nostr.(*RelayPool).Add.func1()
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:99 +0x6b
created by github.com/fiatjaf/go-nostr.(*RelayPool).Add
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:97 +0x445

goroutine 26 [chan receive]:
main.initNostr.func1()
	/home/user/go/pkg/mod/github.com/1ma/[email protected]/nostr.go:29 +0xc5
created by main.initNostr
	/home/user/go/pkg/mod/github.com/1ma/[email protected]/nostr.go:28 +0x289

goroutine 30 [runnable]:
sync.runtime_Semacquire(0xc000014210?)
	/usr/local/go/src/runtime/sema.go:62 +0x27
sync.(*WaitGroup).Wait(0x6b10c0?)
	/usr/local/go/src/sync/waitgroup.go:116 +0x4b
encoding/json.typeEncoder.func1(0x6b10c0?, {0x6b10c0?, 0xc0002ae3a8?, 0xc0001ce800?}, {0x80?, 0x0?})
	/usr/local/go/src/encoding/json/encode.go:394 +0x55
encoding/json.(*encodeState).reflectValue(0xc0001ce800?, {0x6b10c0?, 0xc0002ae3a8?, 0x40ed47?}, {0x78?, 0x0?})
	/usr/local/go/src/encoding/json/encode.go:358 +0x78
encoding/json.(*encodeState).marshal(0x6ed020?, {0x6b10c0?, 0xc0002ae3a8?}, {0xb8?, 0xc5?})
	/usr/local/go/src/encoding/json/encode.go:330 +0xfa
encoding/json.(*Encoder).Encode(0xc00029cca8, {0x6b10c0, 0xc0002ae3a8})
	/usr/local/go/src/encoding/json/stream.go:209 +0xf3
github.com/gorilla/websocket.(*Conn).WriteJSON(0x7f4ac46a09d8?, {0x6b10c0, 0xc0002ae3a8})
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/json.go:28 +0xc5
github.com/fiatjaf/go-nostr.(*Connection).WriteJSON(0xc0001e28c0?, {0x6b10c0?, 0xc0002ae3a8?})
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/connection.go:22 +0xb0
github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent.func1({0xc0002943a8, 0x18}, 0x1?)
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:233 +0xce
created by github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:232 +0x3fa

goroutine 31 [chan send]:
github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent.func1({0xc0000abae0, 0xd}, 0x0?)
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:238 +0x208
created by github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:232 +0x3fa

goroutine 33 [runnable]:
syscall.Syscall(0xc000492480?, 0xc00020b938?, 0x4b3812?, 0x7ffff80000000000?)
	/usr/local/go/src/syscall/syscall_linux.go:69 +0x27
syscall.write(0xc0001ce000?, {0xc000492480?, 0xc000492400?, 0x416890?})
	/usr/local/go/src/syscall/zsyscall_linux_amd64.go:939 +0x45
syscall.Write(...)
	/usr/local/go/src/syscall/syscall_unix.go:206
internal/poll.ignoringEINTRIO(...)
	/usr/local/go/src/internal/poll/fd_unix.go:794
internal/poll.(*FD).Write(0xc0001ce000, {0xc000492480, 0x429, 0x480})
	/usr/local/go/src/internal/poll/fd_unix.go:383 +0x385
net.(*netFD).Write(0xc0001ce000, {0xc000492480?, 0x40e430?, 0x6d95e0?})
	/usr/local/go/src/net/fd_posix.go:96 +0x29
net.(*conn).Write(0xc0000a0d48, {0xc000492480?, 0xc000040c00?, 0xc000330018?})
	/usr/local/go/src/net/net.go:195 +0x45
crypto/tls.(*Conn).write(0xc0000cb500, {0xc000492480?, 0x5?, 0x5?})
	/usr/local/go/src/crypto/tls/conn.go:923 +0x10d
crypto/tls.(*Conn).writeRecordLocked(0xc0000cb500, 0x17, {0xc0001e5306, 0x413, 0x1008})
	/usr/local/go/src/crypto/tls/conn.go:991 +0x354
crypto/tls.(*Conn).Write(0x1000000000078?, {0xc0001e5306, 0x413, 0x1008})
	/usr/local/go/src/crypto/tls/conn.go:1186 +0x411
github.com/gorilla/websocket.(*Conn).write(0xc000306160, 0x1, {0xab1850?, 0x3?, 0x0?}, {0xc0001e5306, 0x413, 0x1008}, {0x0, 0x0, ...})
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:391 +0x1a4
github.com/gorilla/websocket.(*messageWriter).flushFrame(0xc00019ee40, 0x1, {0x0?, 0x0?, 0x0?})
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:614 +0x3e5
github.com/gorilla/websocket.(*messageWriter).Close(0xc00020bca8?)
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:724 +0x45
github.com/gorilla/websocket.(*Conn).WriteJSON(0x7f4ac46a09d8?, {0x6b10c0, 0xc0002ae378})
	/home/user/go/pkg/mod/github.com/gorilla/[email protected]/json.go:29 +0xdf
github.com/fiatjaf/go-nostr.(*Connection).WriteJSON(0xc0001e28a0?, {0x6b10c0?, 0xc0002ae378?})
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/connection.go:22 +0xb0
github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent.func1({0xc00001aeb0, 0xf}, 0x0?)
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:233 +0xce
created by github.com/fiatjaf/go-nostr.(*RelayPool).PublishEvent
	/home/user/go/pkg/mod/github.com/fiatjaf/[email protected]/relaypool.go:232 +0x3fa

event delete

this isn't working for me...
noscl event delete <id>
getting Error publishing: The pool's global SecretKey is invalid:

Receive DMs

I can use noscl to send messages to my Damus account, but I cannot receive the messages from Damus.
Can we add the new function to receive DMs?

noscl publish hangs after publishing on master

Commit 3334f27 introduced some change that makes the command hang after successfully publishing a note. I can see these notes on https://nostr.guru and other clients, but noscl doesn't finish execution. The previous commits up to the latest tagged release (0.6.0) seem to work fine.

I'm on Ubuntu 22.04 and installed noscl with go install github.com/fiatjaf/noscl@3334f27a953c04657fc5b7a303757910928b5b25 using Go 1.20.2, if that helps.

Sample output of the hanged command after a few minutes:

$ noscl publish 3334
Sent event b3e986b76eab79c35bf3836c1a3d1d824e4bb5903e4cb08570dcea1ca0b8d704 to 'wss://nostr.bitcoiner.social'.
Sent event b3e986b76eab79c35bf3836c1a3d1d824e4bb5903e4cb08570dcea1ca0b8d704 to 'wss://nos.lol'.
Sent event b3e986b76eab79c35bf3836c1a3d1d824e4bb5903e4cb08570dcea1ca0b8d704 to 'wss://relay.orangepill.dev'.
Sent event b3e986b76eab79c35bf3836c1a3d1d824e4bb5903e4cb08570dcea1ca0b8d704 to 'wss://nostr-pub.wellorder.net'.
Sent event b3e986b76eab79c35bf3836c1a3d1d824e4bb5903e4cb08570dcea1ca0b8d704 to 'wss://relay.damus.io'.
Sent event b3e986b76eab79c35bf3836c1a3d1d824e4bb5903e4cb08570dcea1ca0b8d704 to 'wss://relay.snort.social'.
Sent event b3e986b76eab79c35bf3836c1a3d1d824e4bb5903e4cb08570dcea1ca0b8d704 to 'wss://relay.nostr.band'.
Sent event b3e986b76eab79c35bf3836c1a3d1d824e4bb5903e4cb08570dcea1ca0b8d704 to 'wss://nostr.mom'.
Seen b3e986b76eab79c35bf3836c1a3d1d824e4bb5903e4cb08570dcea1ca0b8d704 on 'wss://nostr.bitcoiner.social'.
Seen b3e986b76eab79c35bf3836c1a3d1d824e4bb5903e4cb08570dcea1ca0b8d704 on 'wss://nostr.mom'.
Seen b3e986b76eab79c35bf3836c1a3d1d824e4bb5903e4cb08570dcea1ca0b8d704 on 'wss://relay.damus.io'.
Seen b3e986b76eab79c35bf3836c1a3d1d824e4bb5903e4cb08570dcea1ca0b8d704 on 'wss://nos.lol'.
Seen b3e986b76eab79c35bf3836c1a3d1d824e4bb5903e4cb08570dcea1ca0b8d704 on 'wss://relay.nostr.band'.
Seen b3e986b76eab79c35bf3836c1a3d1d824e4bb5903e4cb08570dcea1ca0b8d704 on 'wss://nostr-pub.wellorder.net'.
Seen b3e986b76eab79c35bf3836c1a3d1d824e4bb5903e4cb08570dcea1ca0b8d704 on 'wss://relay.snort.social'.
Seen b3e986b76eab79c35bf3836c1a3d1d824e4bb5903e4cb08570dcea1ca0b8d704 on 'wss://relay.orangepill.dev'.


<> 2023/03/19 12:03:03 read error:  websocket: close 1006 (abnormal closure): unexpected EOF
<> 2023/03/19 12:03:43 read error:  websocket: close 1006 (abnormal closure): unexpected EOF

How to select config file?

Hallo, I need to move my config file to another location.

I tried

noscl -datadir /some/dir

But it doesn't seem to work. The command shows the usage info only.
How can I set the location of the config file?

Thank you very much

Where to store config file?

I'm building a Rust CLI client (https://github.com/vinliao/clust). I took some inspiration and ideas from noscl (thank you very much). I'm still confused where to place the config file, which contains private-key and a list of relays.

I haven't tried noscl. Where does it store config file? Is the config file json, or an rc file (like .vimrc)? Is storing private-key in a plaintext, placed in $HOME safe enough?

how can i exit the program after the relays send an EOSE?

I was attempting to add a get-contacts to synchronize my noscl contact list with the contact events I've sent from other clients.. I'd like the program to detect an EOSE from all relays and then save the config and exit, but I'm having a hard time figuring out how I might do that. Anyway, feel free to ignore this, but, if it's easy maybe we can document it or etc.. Thanks!

master...jeremyd:noscl:master

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.