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

refactor(bitswap) use new net package #65

Closed
btc opened this issue Sep 13, 2014 · 5 comments
Closed

refactor(bitswap) use new net package #65

btc opened this issue Sep 13, 2014 · 5 comments

Comments

@btc
Copy link
Contributor

btc commented Sep 13, 2014

No description provided.

@whyrusleeping
Copy link
Member

Question: How do i go about receiving a message from the net? (how does bitswap do this now?)

@btc
Copy link
Contributor Author

btc commented Sep 16, 2014

BitSwap and DHT register Handlers. BitSwap's handler implementation is here:

https://github.com/jbenet/go-ipfs/blob/net-dht-stash/bitswap/transmission/service_wrapper.go#L29

@jbenet just made some interface improvements so the way this gets wired up will be better.

The procedure is as follows:

  1. in core, on startup a Network is created. (https://github.com/jbenet/go-ipfs/blob/0b20da3126a86cf1ac72d753d0301a778046407b/core/core.go#L96)
  2. Then the bitswap service is created and registered on the network. (https://github.com/jbenet/go-ipfs/blob/0b20da3126a86cf1ac72d753d0301a778046407b/core/core.go#L97)
  3. Then bitswap's message handler registers itself on the service. (eg shows dht https://github.com/jbenet/go-ipfs/blob/0b20da3126a86cf1ac72d753d0301a778046407b/core/core.go#L105)

Note that the handler can be DHT or Bitswap sessions or some helper object. In the snippets above, the DHT session is used.

In bitswap, presently a helper is used. I'm going to change Bitswap to behave the way the DHT does!

@jbenet
Copy link
Member

jbenet commented Sep 16, 2014

Adding to the above, the dht still gets network because it may have to connect to (network.Dial) new peers

@btc
Copy link
Contributor Author

btc commented Sep 22, 2014

bitswap now uses the new net layer. increasing granularity. specific remaining tasks are tracked in

#97
#96
#95

@btc btc closed this as completed Sep 22, 2014
@btc btc removed the status/in-progress In progress label Sep 22, 2014
@jbenet
Copy link
Member

jbenet commented Sep 22, 2014

@perfmode thanks for linking things here! super helpful to reading :) 👍

@btc btc removed their assignment Mar 30, 2015
@aschmahmann aschmahmann mentioned this issue Sep 22, 2020
72 tasks
ribasushi pushed a commit that referenced this issue Jul 4, 2021
remove deprecated code and update README
ariescodescream pushed a commit to ariescodescream/go-ipfs that referenced this issue Oct 23, 2021
laurentsenta pushed a commit to laurentsenta/kubo that referenced this issue Feb 25, 2022
…/libp2p/go-libp2p-core-0.5.0

Bump github.com/libp2p/go-libp2p-core from 0.3.1 to 0.5.0
laurentsenta pushed a commit to laurentsenta/kubo that referenced this issue Feb 25, 2022
…dules/github.com/libp2p/go-libp2p-core-0.5.0

Bump github.com/libp2p/go-libp2p-core from 0.3.1 to 0.5.0
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

No branches or pull requests

3 participants