Skip to content

Commit

Permalink
fix!: trustless gateway brokers no longer take a gateways arg (#530)
Browse files Browse the repository at this point in the history
The trustless gateway block broker should be used with a http gateway router which will supply a default set of gateways in a way usable by other consumers of the Helia routing.

This was mistakenly released in `@helia/block-brokers@2.1.2` which has been reverted, this PR will cause `@helia/block-brokers@3.0.0` to be released.

Before:

```js
import { createHelia } from 'helia'
import { trustlessGateway } from '@helia/block-brokers'
import { delegatedHTTPRouting } from '@helia/routers'

await createHelia({
  blockBrokers: [
    trustlessGateway({
      gateways: [
        'http://example.com'
      ]
    })
  ],
  routers: [
    delegatedHTTPRouting('https://delegated-ipfs.dev')
  ],
  //... other settings
})
```

After:

```js
import { createHelia } from 'helia'
import { trustlessGateway } from '@helia/block-brokers'
import { delegatedHTTPRouting, httpGatewayRouting } from '@helia/routers'

await createHelia({
  blockBrokers: [
    trustlessGateway()
  ],
  routers: [
    delegatedHTTPRouting('https://delegated-ipfs.dev'),
    httpGatewayRouting({
      gateways: [
        'http://example.com'
      ]
    })
  ],
  //... other settings
})
```

BREAKING CHANGE: the gateways init option has been removed from trustless gateway block brokers
  • Loading branch information
achingbrain committed May 2, 2024
1 parent 55b9650 commit a8fdfc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-brokers/.aegir.js
Expand Up @@ -4,7 +4,7 @@ import polka from 'polka'
/** @type {import('aegir').PartialOptions} */
const options = {
test: {
async before (options) {
async before () {
const goodGateway = polka({
port: 0,
host: '127.0.0.1'
Expand Down

0 comments on commit a8fdfc2

Please sign in to comment.