Skip to content
This repository was archived by the owner on Apr 29, 2020. It is now read-only.

level up libp2p functionality #9

Merged
merged 1 commit into from
May 29, 2016
Merged

level up libp2p functionality #9

merged 1 commit into from
May 29, 2016

Conversation

daviddias
Copy link
Collaborator

No description provided.

@daviddias
Copy link
Collaborator Author

This PR moves a lot of the libp2p maintenance that was being done inside js-ipfs to libp2p. It also brings features such as dialing by Multiaddr and PeerInfo to libp2p interface + the ability to hangup on a peer that we have a muxedConn open.

Another new thing is a test that shows how a libp2p.Node crash doesn't translate in a uncaught exception in our node

@daviddias
Copy link
Collaborator Author

@dignifiedquire can you give CR? I'm still going to update libp2p-ipfs-browser and then js-ipfs-bitswap and js-ipfs to follow this new interface.

@dignifiedquire
Copy link
Contributor

will review in detail either later tonight or tomorrow

this.peerBook.removeByB58String(peerInfo.id.toB58String())
})

this.isOnline = false
Copy link
Contributor

Choose a reason for hiding this comment

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

I would hide this to make sure it's not accidentally changed from the outside. Easiest to do with a getter and a locally scoped variable.

@daviddias daviddias force-pushed the level-up branch 4 times, most recently from 7970f3b to 94d8435 Compare May 29, 2016 09:46
spawnedNode.on('close', (code) => {
// console.log(`child process exited with code ${code}`)
})
})

Choose a reason for hiding this comment

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

What is being tested here? An expectation or an assert would help to convey the purpose. If it's WIP, perhaps add // WIP?

Copy link
Collaborator Author

@daviddias daviddias May 29, 2016

Choose a reason for hiding this comment

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

This test spawns libp2pNode in a different process, which gets killed in the next test. I used this event listeners for debugging and left them here. I can remove them :)

@haadcode
Copy link

Couple of stylistic comments on the test. I can't be 100% sure about the logic of the code as I'm unfamiliar with the internals of libp2p, but looks good to me.

@daviddias
Copy link
Collaborator Author

rad, thank you @haadcode and @dignifiedquire :)

@daviddias daviddias merged commit a13858f into master May 29, 2016
@daviddias daviddias deleted the level-up branch May 29, 2016 10:15
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