Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nostr-tools dependecy #54

Closed
arejula27 opened this issue Dec 23, 2022 · 5 comments
Closed

Add nostr-tools dependecy #54

arejula27 opened this issue Dec 23, 2022 · 5 comments
Labels
question Further information is requested

Comments

@arejula27
Copy link

There is a protect which implement the basic protocol function. https://github.com/fiatjaf/nostr-tools
I'm improving the TS interface. It would be a good option because you can focus on other things, instead implementing the newest nip.

@arejula27
Copy link
Author

I saw you want to manage the ws connections after a long inactivity time, with this library it is possible too, you can develop the logic and call connect/ close connection on each relay

@KoalaSat
Copy link
Owner

KoalaSat commented Dec 23, 2022

Hi @arejula27, Nostros already does a limited use of nostr-tools

import { decrypt } from 'nostr-tools/nip04'

Initially I wanted to use it as base library of the app, but I ended up facing 2 main problems:

  • nostr-tools implements a version of ECMAScript not compatible with Android. If I remember correctly, it requires 2021 and Android is limited to 2019.
  • React-Native has a single thread to manage everything related to JS (views included), so doing an intensive use of background tasks (for example relays communication) affected really badly to the performance resulting even in the app completely freezing for seconds.

This is why I decided to re-implement everything that can be parallelized in Java, it was the only way to have a good performance.

@KoalaSat KoalaSat added the question Further information is requested label Dec 24, 2022
@dskvr
Copy link

dskvr commented Dec 26, 2022

Have you tried @jb55's nostr-js?

@KoalaSat
Copy link
Owner

KoalaSat commented Dec 26, 2022

Yes I did but it was missing some functions I needed, I assumed nostr-tools was a most recent version and decide to go forward with the Java version. The main problem as I said is that the background jobs with JS affects a lot the UX

@arejula27
Copy link
Author

On this case i think you made the correct decision, good luck. I cant wait for using nostros :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants