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

feat: use PubSub API directly from libp2p #1215

Merged
merged 7 commits into from
Feb 18, 2018
Merged

Conversation

daviddias
Copy link
Member

@daviddias daviddias commented Feb 14, 2018

No description provided.

@daviddias
Copy link
Member Author

Done

@daviddias daviddias requested review from pgte and vmx February 17, 2018 22:12
@daviddias
Copy link
Member Author

Had to fix some linting issues that were merged in Master (somehow escaped the check, shame on me for not triple checking.)

@daviddias
Copy link
Member Author

image

CI is green \o/ Merging as this solves also some issues in Master that are preventing other PRs

@daviddias daviddias merged commit 9f39a6f into master Feb 18, 2018
@daviddias daviddias deleted the feat/libp2p-pubsub branch February 18, 2018 08:34
@ghost ghost removed the status/in-progress In progress label Feb 18, 2018
Copy link
Member

@vmx vmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the error checking that got removed is now in libp2p (I haven't checked). The rest looks OK, I've mostly minor things.

if (typeof ma === 'string') {
try {
ma = new Multiaddr(ma)
return Boolean(ma)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This idea comes from type checking discussion. It would be cool if isValid() functions would return false if invalid and return a valid object whatever got checked (in this case a Multiaddr).

That way you could also use isValid() to make sure you always get a valid Multiaddr object, no matter if it was already one or of if it was a string.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This got upgraded in #1227

if (err) {
return callback(err)
}
if (err) { return callback(err) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: I prefer not having unrelated formatting changes together with real code changes.


const dfProc = DaemonFactory.create({ type: 'proc' })
const IPFSFactory = require('ipfsd-ctl')
const fDaemon = IPFSFactory.create({ type: 'js' })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find fDaemon a strange, hard to read, uncommon name. What about just Deamon or jsDeamon.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a Factory. I could call it factoryDaemon if that makes more sense for you

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it matter that's a factory? If you really want to know, I think it's apparent from IPFSFactor.create() that it is a factory.
This don't find this super important, so if you don't find it worth the change, feel free to leave it as it currently is.

const dfProc = DaemonFactory.create({ type: 'proc' })
const IPFSFactory = require('ipfsd-ctl')
const fDaemon = IPFSFactory.create({ type: 'js' })
const fInProc = IPFSFactory.create({ type: 'proc' })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find fInProc a strange, hard to read, meaningless, uncommon name. What about just InProc or InProcDeamon.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as #1215 (comment). I can use the full word if that works better :)

@vmx
Copy link
Member

vmx commented Feb 19, 2018

Oh, I just saw that it got already merged :) Well, then see my comments as FYI and fill free to do a new PR if you think it's worth it.

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.

2 participants