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

Sozo new command hash finder #2850

Open
glihm opened this issue Dec 30, 2024 · 4 comments
Open

Sozo new command hash finder #2850

glihm opened this issue Dec 30, 2024 · 4 comments
Assignees
Labels

Comments

@glihm
Copy link
Collaborator

glihm commented Dec 30, 2024

Is your feature request related to a problem? Please describe.
Currently when there's an error into the world contract, the world sometimes doesn't have access to the namespace and name of the resource.

Describe the solution you'd like
Having a new sozo command (or sozo hash subcommand`) to actually find some namespace/name from a given hash.
We could also take an optional list of namespaces to re-compute all the tags based on those namespaces.

@glihm glihm added the sozo label Dec 30, 2024
@glihm glihm changed the title Sozo hash finder Sozo new command hash finder Jan 6, 2025
@remybar
Copy link
Contributor

remybar commented Jan 7, 2025

Hi @glihm !

I can work on it 👍

Could you give some examples of command calls to have a better overview of how this command should work ?

@glihm
Copy link
Collaborator Author

glihm commented Jan 8, 2025

Hey @remybar, for sure.

The idea is the following:

  1. sozo hash command already exist to hash thing for dojo selector (and others). We may rework to have subcommands (sozo hash compute, sozo hash find).
  2. The idea of the find is that we could provide a list of namespaces, like so, sozo will try all combinations to try finding a match with the given hash:
sozo hash find <TARGET_HASH> --namespaces ns1,ns2,ns3

With this input, sozo will use the manifest to gather all the models/events/contracts (resources) and try to compute the hash giving the list of namespaces. If there is a match with the target hash -> return the plain string matching.

At some point, the namespaces could also be taken from the manifest/dojo configuration. But maybe it's still interesting to have a way to provide a list of namespaces/resources names, wdyt?

@remybar
Copy link
Contributor

remybar commented Jan 8, 2025

Ok, thanks for the details 🙏

Yep, we could use namespaces from the manifest/dojo config by default but use a short list of namespaces if provided through --namespaces :)

@glihm
Copy link
Collaborator Author

glihm commented Jan 8, 2025

Ok, thanks for the details 🙏

Yep, we could use namespaces from the manifest/dojo config by default but use a short list of namespaces if provided through --namespaces :)

Let's go with that, and then we should also have a --resources flag, for the same behavior. By default we use resource names from the manifest, else we use the given resources names?

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

No branches or pull requests

2 participants