Skip to content
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

network #4

Merged
merged 3 commits into from
May 5, 2016
Merged

network #4

merged 3 commits into from
May 5, 2016

Conversation

daviddias
Copy link
Member

@daviddias daviddias commented Apr 27, 2016

This is a WIP, missing:

  • Update Swarm with peer-mux-* events
  • Update peerBook on js-ipfs to make it smarter when it comes to updating the info about a peer (with the option to flush it to disk) and indexing. So that I can fetch the peerInfo for sendMessage call
  • Update Swarm to patch the peerId to the conn (and the streams that are multiplexed on the conn), so that we can do the _receiveMessage

// connected. Once we have Peer Routing, we will be able
// to find the Peer
if (this.libp2p.swarm.muxedConns[peerId.toB58String()]) {
// TODO: ask - want _onPeerConnected to be called here too?
Copy link
Member Author

Choose a reason for hiding this comment

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

@dignifiedquire should I call _onPeerConnected here too? Or is the cb enough to signal we successfully dialed (I'm afraid that we fire to routines for connecting to the same peer)

Copy link
Member

Choose a reason for hiding this comment

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

I need to check

Copy link
Member

Choose a reason for hiding this comment

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

No need to call _onPeerConnected here, as that will already have been called from the first connection in this case.

@dignifiedquire
Copy link
Member

@diasdavid can you rebase please?

@daviddias
Copy link
Member Author

@dignifiedquire rebased, but do not merge yet :)

@daviddias daviddias force-pushed the network branch 3 times, most recently from d08ced8 to bc00898 Compare May 4, 2016 22:53
@daviddias
Copy link
Member Author

@dignifiedquire the network is implemented :)

it('block is retrived from peer', (done) => {
// Not sure if I understand what is going on here
// test fails because now the network is not properly mocked
// what are these net.stores and mockNet.bitswaps?
Copy link
Member Author

Choose a reason for hiding this comment

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

@dignifiedquire could you clarify what is going on in this test? libp2p needs to be properly mocked, but I couldn't get what was exactly was going on/intended.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I need to change the mock network tool to now mock libp2p instead of the network instance

@dignifiedquire dignifiedquire merged commit b1a5eff into master May 5, 2016
@dignifiedquire dignifiedquire deleted the network branch May 5, 2016 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants