hoytech / strfry

a nostr relay
GNU General Public License v3.0
489 stars 96 forks source link

stream ws://SERVER_IP:PORT --dir up makes strfry not to receive events #25

Open pillkia opened 1 year ago

pillkia commented 1 year ago

Running strfry in docker container, with "relay" it works well, with "stream" it doesn't receive events.

console with stream:

date       time         ( uptime  ) [ thread name/id ]   v|
2023-03-04 03:19:09.991 (   0.016s) [main thread     ]INFO| arguments: /app/strfry stream ws://SERVER_IP:PORT --dir up
2023-03-04 03:19:09.991 (   0.016s) [main thread     ]INFO| Current dir: /app
2023-03-04 03:19:09.991 (   0.016s) [main thread     ]INFO| stderr verbosity: 0
2023-03-04 03:19:09.991 (   0.016s) [main thread     ]INFO| -----------------------------------
2023-03-04 03:19:09.991 (   0.016s) [main thread     ]INFO| CONFIG: Loading config from file: /etc/strfry.conf
2023-03-04 03:19:09.996 (   0.020s) [main thread     ]INFO| CONFIG: successfully installed
2023-03-04 03:19:09.997 (   0.021s) [main thread     ]INFO| Attempting to connect to ws://SERVER_IP:PORT
2023-03-04 03:19:09.998 (   0.022s) [main thread     ]INFO| Connected to SERVER_IP

Client (noscl) says: error opening websocket to ws://STRFRY_SERVER_IP:PORT read tcp balabala read: connection reset by peer.

hoytech commented 1 year ago

I'm not sure TBH. It looks like noscl is unable to connect to the relay? Any more information on how to reproduce this might help.

In case it's helpful, here are some guides for running strfry with Docker, from Jascha on TG:

https://hub.docker.com/r/cryptocartel/strfry https://write.bz/jascha/run-your-own-private-strfry-nostr-relay

pillkia commented 1 year ago

Thanks, but I guess it is not an issue relevant to docker.

Same Docker image. With start command "strfry relay" it works like a charm.

To reproduce, change the docker file as below:

COPY --from=build /build/strfry strfry
ENTRYPOINT ["/app/strfry"]
CMD ["stream","ws://UPSTREAM_SERVER_IP:PORT","--dir","up"]

then build

run the image.

podman run -it --rm -p 5555:6666 --user=100:100 -v $(pwd)/strfry-db:/app/strfry-db:Z -v $(pwd)/strfry.conf:/etc/strfry.conf:ro,Z --name strfry-upstream strfry:latest

it is not able to send Nostr events to 5555 port. (port 6666 is listen port defined in strfry config file)

I'm not sure TBH. It looks like noscl is unable to connect to the relay? Any more information on how to reproduce this might help.

In case it's helpful, here are some guides for running strfry with Docker, from Jascha on TG:

https://hub.docker.com/r/cryptocartel/strfry https://write.bz/jascha/run-your-own-private-strfry-nostr-relay