Skip to content

Commit

Permalink
chore: generate readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
2color committed Jan 16, 2024
1 parent a558fc4 commit 67bbef3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
26 changes: 26 additions & 0 deletions packages/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

Exports a `createHeliaHTTP` function that returns an object that implements a lightweight version of the Helia API that functions only over HTTP.

By default, content and peer routing are requests are resolved using the [Delegated HTTP Routing API](https://specs.ipfs.tech/routing/http-routing-v1/) and blocks are fetched from [Trustless Gateways](https://specs.ipfs.tech/http-gateways/trustless-gateway/).

Pass it to other modules like @helia/unixfs to fetch files from the distributed web.

## Example
Expand All @@ -30,6 +32,30 @@ const fs = unixfs(helia)
fs.cat(CID.parse('bafyFoo'))
```

## Example - with custom gateways and delegated routing endpoints

```typescript
import { createHeliaHTTP } from '@helia/http'
import { trustlessGateway } from '@helia/block-brokers'
import { delegatedHTTPRouting } from '@helia/routers'
import { unixfs } from '@helia/unixfs'
import { CID } from 'multiformats/cid'

const helia = await createHeliaHTTP({
blockBrokers: [
trustlessGateway({
gateways: ['https://cloudflare-ipfs.com', 'https://ipfs.io'],
}),
],
routers: [
delegatedHTTPRouting('https://delegated-ipfs.dev')
]
})

const fs = unixfs(helia)
fs.cat(CID.parse('bafyFoo'))
```

# Install

```console
Expand Down
4 changes: 4 additions & 0 deletions packages/routers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

> Routers for Helia
# About

Abstraction layer over different content and peer routing mechanisms.

# Install

```console
Expand Down

0 comments on commit 67bbef3

Please sign in to comment.