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

Nostr relay #282

Merged
merged 17 commits into from
Dec 20, 2024
Merged

Nostr relay #282

merged 17 commits into from
Dec 20, 2024

Conversation

tompro
Copy link
Collaborator

@tompro tompro commented Dec 20, 2024

πŸ“ Description

Enables the notification service via Nostr. As this is breaking until we have a dev relay I keep it as a draft PR.

Relates to #119 #244


βœ… Checklist

Please ensure the following tasks are completed before requesting a review:

  • My code adheres to the coding guidelines of this project.
  • I have run cargo fmt.
  • I have added or updated tests (if applicable).
  • All CI/CD steps were successful.
  • I have updated the documentation (if applicable).
  • I have checked that there are no console errors or warnings.
  • I have verified that the application builds without errors.
  • I've described the changes made to the API. (modification, addition, deletion).

πŸš€ Changes Made

  • New Features:

    • Unify BTC keys generation
    • Unify Nostr keys generation
    • Enable notification service (Nostr relay becomes app requirement, needs update with our dev relay as default)
    • Notify about bill_is_signed event
  • Other Changes:

    • Small http request collection for easier api requests
    • New docker compose setup allowing to keep SurrealDb data persistent

πŸ’‘ How to Test

Please provide clear instructions on how reviewers can test your changes:

  1. Create two services with identities
  2. Hook them up with contacts
  3. Create a new bill for the other party

🀝 Related Issues

List any related issues, pull requests, or discussions:


πŸ”— Additional Context (optional)

Until we have a dev relay this will break clients that have no access to a relay


πŸ“‹ Review Guidelines

@tompro tompro self-assigned this Dec 20, 2024
@tompro tompro requested review from zupzup and mtbitcr December 20, 2024 13:36
}

let local_public_key = identity_store.get_key_pair().await?.get_libp2p_keys()?;
let keys = identity_store.get_or_create_key_pair().await?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what key is it? SecP or Rsa? Maybe better name for this varuable

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

secP in this case - in new code, I used key, private_key and public_key for our "main" keys (secp) and if it's rsa, I tried to call them rsa_keys, rsa_public_key etc. as a convention.

This would be consistent with that, but we'd have to change it once across the whole codebase to be really clean.

Copy link
Collaborator

@zupzup zupzup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! πŸ’ͺ

src/service/identity_service.rs Show resolved Hide resolved
src/service/identity_service.rs Show resolved Hide resolved
src/service/notification_service/handler.rs Outdated Show resolved Hide resolved
src/service/notification_service/mod.rs Show resolved Hide resolved
}

let local_public_key = identity_store.get_key_pair().await?.get_libp2p_keys()?;
let keys = identity_store.get_or_create_key_pair().await?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

secP in this case - in new code, I used key, private_key and public_key for our "main" keys (secp) and if it's rsa, I tried to call them rsa_keys, rsa_public_key etc. as a convention.

This would be consistent with that, but we'd have to change it once across the whole codebase to be really clean.

@tompro tompro marked this pull request as ready for review December 20, 2024 16:30
@tompro tompro merged commit 59cf40f into master Dec 20, 2024
5 checks passed
@tompro tompro deleted the nostr-relay branch December 20, 2024 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants