Skip to content

refactor(bitswap) use new net packageย #65

Closed

Description

@btc
No description provided.

Activity

  1. self-assigned this
    on Sep 13, 2014
  2. whyrusleeping commented on Sep 16, 2014

    @whyrusleeping
    Member

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

  3. btc commented on Sep 16, 2014

    @btc
    ContributorAuthor

    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!

  4. jbenet commented on Sep 16, 2014

    @jbenet
    Member

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

  5. btc commented on Sep 22, 2014

    @btc
    ContributorAuthor

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

    #97
    #96
    #95

  6. jbenet commented on Sep 22, 2014

    @jbenet
    Member

    @perfmode thanks for linking things here! super helpful to reading :) ๐Ÿ‘

  7. removed their assignment
    on Mar 30, 2015
  8. added a commit that references this issue on Jul 4, 2021
  9. added a commit that references this issue on Oct 23, 2021
  10. added 2 commits that reference this issue on Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions