-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
WIP: add PeerID lookup #3882
WIP: add PeerID lookup #3882
Conversation
enhance key lookup logic and enable PeerID lookup in addition to the key name License: MIT Signed-off-by: Kerem Gocen <keremgocen@gmail.com>
core/commands/publish.go
Outdated
func keylookup(k string, n *core.IpfsNode) (crypto.PrivKey, error) { | ||
|
||
res, err := n.GetKey(k) | ||
if res != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would check here if error is different than ErrNoSuchKey
if that is a case It signals different error than should happen here.
core/commands/publish.go
Outdated
@@ -176,3 +181,36 @@ func publish(ctx context.Context, n *core.IpfsNode, k crypto.PrivKey, ref path.P | |||
Value: ref.String(), | |||
}, nil | |||
} | |||
|
|||
func keylookup(k string, n *core.IpfsNode) (crypto.PrivKey, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the Node first argument.
change core.IpfsNode as first arg check keylookup err to propagate validation errors from lower levels License: MIT Signed-off-by: Kerem Gocen <keremgocen@gmail.com>
f93e8c5
to
76e227d
Compare
No, force pushes are OK. |
test for `ipfs name publish` using PeerID as key name License: MIT Signed-off-by: Kerem Gocen <keremgocen@gmail.com>
05939e2
to
fca98ae
Compare
Do you have any recommendations for fixing the failing CI here? Also a review is required to proceed this one forward I see. |
@keremgocen don't worry about travis too much (it likes to fail on its own, we load their machines a bit too much). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, Thanks @keremgocen!
@Kubuxu 👍 here? |
as discussed in #3807
License: MIT
Signed-off-by: Kerem Gocen keremgocen@gmail.com