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 sessions to trustless gateways #459

Merged
merged 17 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

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

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. 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

Commits on Mar 1, 2024

  1. chore: apply suggestions from code review

    Co-authored-by: Russell Dempsey <[email protected]>
    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. feat: add sessions to trustless gateways

    Implements blockstore sessions for trustless gateways.
    
    - Queries the Helia routing for block providers
    - Creates a set of trustless gateways from routing results
    - Uses only these gateways to fetch session blocks
    achingbrain committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    8997d41 View commit details
    Browse the repository at this point in the history
  4. chore: close server

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

Commits on Mar 14, 2024

  1. Configuration menu
    Copy the full SHA
    ac06ff6 View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2024

  1. Configuration menu
    Copy the full SHA
    263bc1c View commit details
    Browse the repository at this point in the history