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 a command to export output notes from the cli #304

Closed
tomyrd opened this issue Apr 29, 2024 · 5 comments · Fixed by #318
Closed

Add a command to export output notes from the cli #304

tomyrd opened this issue Apr 29, 2024 · 5 comments · Fixed by #318
Assignees
Labels
enhancement New feature or request

Comments

@tomyrd
Copy link
Collaborator

tomyrd commented Apr 29, 2024

Feature description

There should be a way for a user to export a note that is not currently in their input note list. Currently only input notes are able to be exported. We should also add a way to list output notes so that the user can see which notes they can export.

Why is this feature needed?

If a user creates a private output note that is meant for an untracked account they don't have a way to export it via de cli.

@tomyrd tomyrd added the enhancement New feature or request label Apr 29, 2024
@igamigo
Copy link
Collaborator

igamigo commented May 2, 2024

As part of this and as we discussed offline, we should also likely try to merge the note-related commands under a notes command, unless it becomes too cluttered

@mFragaBA
Copy link
Contributor

mFragaBA commented May 2, 2024

As part of this and as we discussed offline, we should also likely try to merge the note-related commands under a notes command, unless it becomes too cluttered

One way to do this is to never expose what's an input/output note to the CLI user. This way:

  • when exporting a note, we actually just fetch the corresponding output note records and convert it to an input note before serializing it
  • when importing a note we always import input note records (note that it might not have all the data necessary to convert it into an InputNote.

Obviously by doing that we'd lose the ability to export a note that is only in the input note records table, but in that situation:

  • either we fetched the note from the node because it's an input note
  • we received the serialized input note and imported it

Hence, it wouldn't make sense to import those input notes and then re-export them since we either have the serialized note already, or the other client can just sync with the node to receive the note if it was a public one.

Is that assessment correct or am I missing something @igamigo @bobbinth

@bobbinth
Copy link
Contributor

bobbinth commented May 2, 2024

As part of this and as we discussed offline, we should also likely try to merge the note-related commands under a notes command, unless it becomes too cluttered

One thing to keep in mind is that we may have the same not in both input and output tables - so, one open question is how to handle such duplicates.

Obviously by doing that we'd lose the ability to export a note that is only in the input note records table,

Under what conditions do we need to import output notes or export input notes? I was thinking that:

  • We import only input notes.
  • We export only output notes, and only the ones which have full note details.

@mFragaBA
Copy link
Contributor

mFragaBA commented May 3, 2024

Under what conditions do we need to import output notes or export input notes? I was thinking that:

* We import only input notes.

* We export only output notes, and only the ones which have full note details.

I was trying to say this. Much clearer summary. Other flows (importing output note / exporting input note) don't make much sense

@mFragaBA
Copy link
Contributor

closing as #318 got merged, it'll be included in the release of 0.3

@github-project-automation github-project-automation bot moved this from In Review to Done in User's testnet May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants