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

feat: add @helia/bitswap with sessions #409

Merged
merged 34 commits into from
Apr 4, 2024

Commits on Feb 6, 2024

  1. feat: add block session support to @helia/interface

    There are no implementations yet but the usage pattern will be something
    like:
    
    ```javascript
    // unixfs cat command
    export async function * cat (cid: CID, blockstore: Blocks, options: Partial<CatOptions> = {}): AsyncIterable<Uint8Array> {
      // create a session for the CID if support is available
      const blocks = await (blockstore.createSession != null ? blockstore.createSession(cid) : blockstore)
      const opts: CatOptions = mergeOptions(defaultOptions, options)
    
      // resolve and export using the session, if created, otherwise fall back to regular blockstore access
      const resolved = await resolve(cid, opts.path, blocks, opts)
      const result = await exporter(resolved.cid, blocks, opts)
    
      if (result.type !== 'file' && result.type !== 'raw') {
        throw new NotAFileError()
      }
    
      if (result.content == null) {
        throw new NoContentError()
      }
    
      yield * result.content(opts)
    }
    ```
    achingbrain committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    546bf66 View commit details
    Browse the repository at this point in the history
  2. chore: pr comments

    achingbrain committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    5836dcd View commit details
    Browse the repository at this point in the history
  3. chore: linting

    achingbrain committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    3d9cb49 View commit details
    Browse the repository at this point in the history
  4. chore: simplify options

    achingbrain committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    39b6f7a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d1228b9 View commit details
    Browse the repository at this point in the history
  6. chore: update utils

    achingbrain committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    32713ab View commit details
    Browse the repository at this point in the history
  7. feat: add @helia/bitswap with sessions

    Adds a `@helia/bitswap` module with code ported from `ipfs-bitswap`
    and greatly simplified.
    
    - Supports sessions
    - Only supports bitswap 1.2.0
    - Uses libp2p's metrics system instead of a custom version
    achingbrain committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    e485722 View commit details
    Browse the repository at this point in the history
  8. chore: fix up tests

    achingbrain committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    73ab5f9 View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2024

  1. Configuration menu
    Copy the full SHA
    0c28d66 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e9bbbe6 View commit details
    Browse the repository at this point in the history
  3. chore: fix tests

    achingbrain committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    1dca655 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c7e5de1 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2024

  1. Configuration menu
    Copy the full SHA
    d0610c9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9aeded1 View commit details
    Browse the repository at this point in the history
  3. chore: remove unused dep

    achingbrain committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    8e6051a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7696bd9 View commit details
    Browse the repository at this point in the history
  5. chore: update constants

    achingbrain committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    ca1c458 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b8e5195 View commit details
    Browse the repository at this point in the history
  7. chore: reuse constants

    achingbrain committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    8cd06ce View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2024

  1. chore: remove extra deps

    achingbrain committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    9e54ac1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7eef3f1 View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2024

  1. chore: apply suggestions from code review

    Co-authored-by: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com>
    achingbrain and SgtPooki authored Feb 22, 2024
    Configuration menu
    Copy the full SHA
    aabc0f4 View commit details
    Browse the repository at this point in the history

Commits on Mar 1, 2024

  1. chore: apply suggestions from code review

    Co-authored-by: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com>
    achingbrain and SgtPooki authored Mar 1, 2024
    Configuration menu
    Copy the full SHA
    d7d6334 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8c42ec5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    891be37 View commit details
    Browse the repository at this point in the history
  4. chore: fix import

    achingbrain committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    0766e12 View commit details
    Browse the repository at this point in the history
  5. chore: deps

    achingbrain committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    cba358f View commit details
    Browse the repository at this point in the history
  6. chore: remove delay

    achingbrain committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    bff5357 View commit details
    Browse the repository at this point in the history
  7. chore: deps

    achingbrain committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    532bf9f View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2024

  1. Configuration menu
    Copy the full SHA
    0b3377e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    89e5afe View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    99cf454 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1330504 View commit details
    Browse the repository at this point in the history
  5. chore: update docs

    achingbrain committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    d576fad View commit details
    Browse the repository at this point in the history