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 w3 name get <keyId> command #1835

Open
nvrabii opened this issue Sep 5, 2022 · 3 comments · May be fixed by #2107
Open

Add w3 name get <keyId> command #1835

nvrabii opened this issue Sep 5, 2022 · 3 comments · May be fixed by #2107
Labels
kind/enhancement A net-new feature or improvement to an existing feature pi/w3name

Comments

@nvrabii
Copy link

nvrabii commented Sep 5, 2022

TLDR

I propose adding the w3 name get <keyId> command, to retrieve and reuse the signing key associated with an IPNS name. Currently, the revision can be updated only from the environment where the IPNS name was initially created.

I took the initiative and already implemented the solution here. If the feature proposal is approved, I'm open to taking further guidance on how to contribute to the project.

Why add this command?

I was building my website, intending to deploy it on IPFS (Web3.Storage). From an article, I learned how to deploy changes in 3 commands, but I thought I could do better.

When I was trying to update the CID associated with the taken IPNS name via a GitHub action, I could not do that without providing the corresponding signing key. I searched on Internet how to retrieve the key, but I could not find another solution as to modify the w3's code, in order to console.log the signing key. Once I retrieved the key, I added it to the repo's secrets, so that my workflow adds the new build to IPFS with a followed update of the IPNS revision.

I don't think that my use case is unique in its kind. Many developers who would like to automate their deployments will have to "move" the signing key from the local to the deployment context.

Why not add this command?

Maybe there is another way to retrieve the signing key, and this feature is not as useful as I thought.

Proposed solution

Add the w3 name get <keyId> command to the w3 CLI.

Code changes

  1. Add the command to w3/bin.js
  2. Add the handler to w3/name.js
  3. Update w3/README.md

How to test

From what I've seen in the repo, w3 name ... commands are not tested. The code for Name.getKey(keyId) reuses the key presence check from Name.publish().

Risks

There are no reasons to "hide" the signing key in the config because it can be easily retrieved by adding a console.log either in the publish or create functions (as a workaround to the existing limitations in the CLI).

Backward compatibility will be respected because the changes only extend the interface.

@nvrabii nvrabii added kind/enhancement A net-new feature or improvement to an existing feature need/triage Needs initial labeling and prioritization labels Sep 5, 2022
@mbommerez
Copy link

Thanks @nvrabii . We are looking into adding this. We will come back to you.

@adamalton adamalton linked a pull request Nov 15, 2022 that will close this issue
@adamalton
Copy link
Contributor

Thanks, this looks great. I've merged your code into a PR (#2107), and changed the command to w3 name get-key to make it clearer what it does.

@nvrabii
Copy link
Author

nvrabii commented Nov 15, 2022

@adamalton It makes it clearer indeed. Thank you

@joshJarr joshJarr self-assigned this Nov 16, 2022
@adamalton adamalton assigned adamalton and unassigned joshJarr Nov 29, 2022
@adamalton adamalton removed their assignment Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature pi/w3name
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants