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

HTTP Block-retrieval support for rainbow #242

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

HTTP Block-retrieval support for rainbow #242

wants to merge 4 commits into from

Conversation

hsanjuan
Copy link
Contributor

This adds http retrieval support based on latest boxo.

It needs explicit enabling with an "--http-retrieval-enable" flag.

Allowlist and number of workers can be configured with additional flags.

A provider-ignore flag has been added as well. Example:

  • http-retrieval-allowlist: [dag.w3s.link]
  • routing-ignore-providers: [QmQzqxhK82kAmKvARFZSkUVS6fo9sySaiogAnx5EnZ6ZmC] (w3s elastic ipfs peer)

This adds http retrieval support based on latest boxo.

It needs explicit enabling with an "--http-retrieval-enable" flag.

Allowlist and number of workers can be configured with additional flags.

A provider-ignore flag has been added as well. Example:

  - http-retrieval-allowlist: [dag.w3s.link]
  - routing-ignore-providers: [QmQzqxhK82kAmKvARFZSkUVS6fo9sySaiogAnx5EnZ6ZmC] (w3s elastic ipfs peer)
@@ -15,6 +15,8 @@ The following emojis are used to highlight certain changes:

### Added

- HTTP block retrieval support: rainbow can know use trustless http gateways to perform block retrievals, in parallel to bitswap. This takes advantage of peers with HTTP endpoints and provider records of "transport-ipfs-gateway-http" type. You can enable http retrievals with `--http-retrieval-enable`, and limit it to urls of specific hostnames with `--http-retrieval-allowlist <hostname>`. You can also ignore provider records from certain peer IDs with `--routing-ignore-providers <peerID>` (for example to ignore peer IDs from bitswap endpoints of providers that offer HTTP). Note this works in the same way as bitswap: known http-peers will receive optimistic block requests even for content that they are not announcing. See [Boxo's CHANGELOG](https://github.com/ipfs/boxo/blob/main/CHANGELOG.md) for more information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- HTTP block retrieval support: rainbow can know use trustless http gateways to perform block retrievals, in parallel to bitswap. This takes advantage of peers with HTTP endpoints and provider records of "transport-ipfs-gateway-http" type. You can enable http retrievals with `--http-retrieval-enable`, and limit it to urls of specific hostnames with `--http-retrieval-allowlist <hostname>`. You can also ignore provider records from certain peer IDs with `--routing-ignore-providers <peerID>` (for example to ignore peer IDs from bitswap endpoints of providers that offer HTTP). Note this works in the same way as bitswap: known http-peers will receive optimistic block requests even for content that they are not announcing. See [Boxo's CHANGELOG](https://github.com/ipfs/boxo/blob/main/CHANGELOG.md) for more information.
- HTTP block retrieval support: rainbow can now use trustless http gateways to perform block retrievals in parallel to bitswap. This takes advantage of peers with HTTP endpoints and provider records of "transport-ipfs-gateway-http" type. You can enable http retrievals with `--http-retrieval-enable`, and limit it to urls of specific hostnames with `--http-retrieval-allowlist <hostname>`. You can also ignore provider records from certain peer IDs with `--routing-ignore-providers <peerID>` (for example to ignore peer IDs from bitswap endpoints of providers that offer HTTP). Note this works in the same way as bitswap: known http-peers receive optimistic block requests even for content that they are not announcing. See [Boxo's CHANGELOG](https://github.com/ipfs/boxo/blob/main/CHANGELOG.md) for more information.

Comment on lines +845 to +846
resolverURL := strings.TrimSpace(split[1])
customDNSResolverMap[domain] = resolverURL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth parsing the URL

Suggested change
resolverURL := strings.TrimSpace(split[1])
customDNSResolverMap[domain] = resolverURL
resolverURL, err := url.Parse(strings.TrimSpace(split[1]))
if err != nil {
return nil, err
}
customDNSResolverMap[domain] = resolverURL.String()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants