Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Impl the http endpoints and cli cmds for PubSub #1068

Closed
daviddias opened this issue Nov 11, 2017 · 16 comments
Closed

Impl the http endpoints and cli cmds for PubSub #1068

daviddias opened this issue Nov 11, 2017 · 16 comments
Assignees
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue P1 High: Likely tackled by core team if no one steps up

Comments

@daviddias
Copy link
Member

daviddias commented Nov 11, 2017

#610 never really added support for PubSub to the http-api and the cli, just for core.

We do have tests and the impl is underway which should make things easier for someone to pick it up. To try it out you can enable these tests:

@daviddias daviddias added exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue P1 High: Likely tackled by core team if no one steps up labels Nov 11, 2017
@richardschneider
Copy link
Contributor

richardschneider commented Nov 11, 2017

@diasdavid There are incompatibilities between go and js in the published message that is sent by pubsub publish.

  • js has renamed the field topicIDs to topicCIDs, see the Message spec
  • js encodes the field from in base58 whereas go uses base64

See the code in libp2p-floodsub.

js message

{
	"from": "QmYJ5Cm2dBEdDmCYkSqGoCViFfu3BE3xN8gJydMdtoVsdP",
	"data": "aGVsbG8gd29ybGQh",
	"seqno": "ZmUwMzAxMjUxYmU5ZDVhMzI3YmNiYTRkYWJmOTcwMzk4Y2ZmYTA4Mg==",
	"topicCIDs": [
		"net-ipfs-api-test-ce7465cc-ec60-428b-a5d6-ce783e5a462d"
	]
}

go message

{
	"from": "EiDzOYdzT4BE42JXwxVM8Q19w6tx30Bp2N3T7tOH/a2nCw==",
	"data": "aGVsbG8gd29ybGQh",
	"seqno": "FPX/1KPfLIA=",
	"topicIDs": [
		"net-ipfs-api-test-15924ff2-1748-4630-b896-e282bbf59ee6"
	]
}

@richardschneider
Copy link
Contributor

Note that none of the above tests check a published message.

Also the test for pubsub ls is skipped.

@richardschneider
Copy link
Contributor

richardschneider commented Nov 14, 2017

Changes will have to be made

@daviddias
Copy link
Member Author

@richardschneider great catch!

No idea how did this happen. This will be a breaking change. Wanna ship it in time for js-ipfs 0.27? An interop test would also be welcome

@richardschneider
Copy link
Contributor

Working on changes now. when is js-ipfs 0.27 scheduled to ship.

@daviddias
Copy link
Member Author

@richardschneider once I finish ipfs-inactive/interface-js-ipfs-core#162 which should be this week (so releasing next week)

@richardschneider
Copy link
Contributor

No worries, will have changes in tonight/tomorrow.

Will the release include jsipfs files ls ...?

@daviddias
Copy link
Member Author

@richardschneider it will :)

@richardschneider
Copy link
Contributor

richardschneider commented Nov 14, 2017

@diasdavid I need PR 49 reviewed and released before I begin the other tasks.

@daviddias
Copy link
Member Author

@richardschneider you should be able to npm link to do more testing. To make sure that all bugs are detected, could you add some interop tests for pubsub as well? Thank you!

@richardschneider
Copy link
Contributor

Yes, adding/changing tests in interface-ipfs-code.

I don't use npm link, will read up on it. Typically, use npm install to the github branch for testing other packages that are net yet ready for prime time.

But to run these tests, I need to use js-ipfs; which somewhere in the DLL hell uses libp2p-fload-sub.

@daviddias
Copy link
Member Author

@richardschneider you should not need to change tests in interface-ipfs-core for interop, you should just to add some to this set https://github.com/ipfs/js-ipfs/tree/master/test/interop, they are run with https://github.com/ipfs/js-ipfs/blob/master/package.json#L36

@richardschneider
Copy link
Contributor

interface-ipfs-core is WRONG. I'm making test changes to interface-ipfs-core because its checking for the wrong published message field name.

see ipfs-inactive/interface-js-ipfs-core@e750afe

@daviddias
Copy link
Member Author

Understood! :)

@richardschneider
Copy link
Contributor

richardschneider commented Nov 16, 2017

@diasdavid I think pubsub is truely broken. I enabled https://github.com/ipfs/js-ipfs/blob/master/test/http-api/interface/pubsub.js and most tests fail; see test-log.txt

I'll start looking into it.

@richardschneider
Copy link
Contributor

After a few hours, pubsub is NOT broken. The tests need to enable the pubsub experiment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue P1 High: Likely tackled by core team if no one steps up
Projects
None yet
Development

No branches or pull requests

2 participants