Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Test imported js-ipfs ipns key pubsub'ing to, and resolving on go-ipfs #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DougAnderson444
Copy link

Context

After having issues publishing to ipns using an imported key in js-ipfs, then (with pubsub enabled) attempting to resolve that ipns key on go-ipfs, @vasco-santos proposed submitting a PR with failing tests. This is the PR to show where it's failing.

Prior Art

This test is based off https://github.com/ipfs/interop/blob/master/test/ipns-pubsub.js#L89-L115

Referenced People and Conversations:

https://discuss.ipfs.io/t/cant-access-published-ipns-record-config-problem/5476/17
https://discuss.ipfs.io/t/ipns-not-resolvable-from-other-node/8624/3
ipfs/kubo#6360

I've been trying to figure this out with @aschmahmann who has been doing great work on the go-side of things, and his upcoming changes may fix this issue. For now, here's the failing test on it.

Failing tests

The test fail:

  1. When we try to ipfsHttpApi.name.resolve({ key: importedKey }). go-ipfs API doesn't resolve it
  2. The pubsub /record/ and /ipns/ records don't get created on the resolving go-node when an imported js key is used? That's weird.
  3. Lastly of course, after the ipfsBrowser.name.publish() completes, the records are not pubsub'd over nor does anything resolve (likely due to the first two failing steps).

When the imported key is replaced with 'self' key, everything works fine, as expected.

Other note

I added "test:node-ipns" just so I could run this test by itself, left it there for anyone who needs the same functionality while reviewing this test.

@welcome
Copy link

welcome bot commented Jul 16, 2020

Thank you for submitting this PR!
A maintainer will be here shortly to review it.
We are super grateful, but we are also overloaded! Help us by making sure that:

  • The context for this PR is clear, with relevant discussion, decisions
    and stakeholders linked/mentioned.

  • Your contribution itself is clear (code comments, self-review for the
    rest) and in its best form. Follow the code contribution
    guidelines

    if they apply.

Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
Next steps:

  • A maintainer will triage and assign priority to this PR, commenting on
    any missing things and potentially assigning a reviewer for high
    priority items.

  • The PR gets reviews, discussed and approvals as needed.

  • The PR is merged by maintainers when it has been approved and comments addressed.

We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution.
We are very grateful for your contribution!

@aschmahmann
Copy link
Contributor

@DougAnderson444 do you mind testing against this branch of go-ipfs to see what happens ipfs/kubo#7549? If you don't have time or are having trouble lmk and I'll get to it when I get a chance.

@DougAnderson444
Copy link
Author

DougAnderson444 commented Jul 20, 2020

I didn't get very far -- tried to npm install using package.json with "go-ipfs": "git+https://github.com/ipfs/go-ipfs#feat/ipns-stop-pk-resolve" in it, but npm sure didn't like that. Unless I use that branch in some other way?

@jacobheun
Copy link
Contributor

@aschmahmann I ran this against your branch and things are passing. I did have to make some local fixes to the tests. key is not defined in one of them.

The tests should get cleaned up before this gets merged. Some of the later tests are dependent on the earlier ones which makes this suite fragile to future updates. It also makes the tests harder to follow.

fyi the easiest way to run against a go branch is to build it locally and use the env variable for the path IPFS_GO_EXEC=$(which ipfs) npx aegir test -t node -f test/node-ipns.js

Also, I found a bug in the js http client. Streaming can't be overridden (it's always true) which is giving us some false positives. I'll submit a fix for that.

@aschmahmann
Copy link
Contributor

aschmahmann commented Aug 3, 2020

I ran this against your branch and things are passing

@jacobheun great, so I'll merge that branch then. lmk when the updated interop is released and we'll track it in go-ipfs CI.

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

Successfully merging this pull request may close these issues.

3 participants