Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit 95a81d8

Browse files
authored
Merge branch 'main' into feat/dag-fetcher
2 parents a1c8bdb + 0b87b32 commit 95a81d8

File tree

1 file changed

+75
-40
lines changed

1 file changed

+75
-40
lines changed

README.md

Lines changed: 75 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,106 @@
11
bifrost-gateway
22
=======================
33

4-
> Gateway implementation used by [protocol/bifrost-infra](https://github.com/protocol/bifrost-infra)
4+
> A lightweight IPFS Gateway daemon backed by a remote data store.
55
6+
- [About](#about)
7+
- [Usage](#usage)
8+
- [Local build](#local-build)
9+
- [Configuration](#configuration)
10+
- [Docker](#docker)
11+
- [FAQ](#faq)
12+
- [How to run with local gateway](#how-to-run-with-local-gateway)
13+
- [How to run with Saturn CDN backend](#how-to-run-with-saturn-cdn-backend)
14+
- [How to debug](#how-to-debug)
15+
- [How does this work at ipfs.io and dweb.link](#how-does-this-work-at-ipfsio-and-dweblink)
16+
- [Contributing](#contributing)
17+
- [License](#license)
18+
19+
## Maintainers
20+
21+
IPFS Stewards
22+
23+
## About
24+
25+
`bifrost-gateway` provides a single binary daemon implementation of [HTTP+Web Gateway Specs](https://specs.ipfs.tech/http-gateways/).
26+
27+
It is capable of serving requests to:
28+
- [path gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#path-gateway) at `127.0.0.1`
29+
- [subdomain gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#subdomain-gateway) requests with `Host: localhost`
30+
- [DNSLink gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#dnslink-gateway) based on `Host` header
31+
32+
Supported response types include both deserialized flat files, and [verifiable Block/CAR](https://docs.ipfs.tech/reference/http/gateway/#trustless-verifiable-retrieval).
33+
34+
For more information about IPFS Gateways, see:
35+
36+
- Specifications at [specs.ipfs.tech/http-gateways](https://specs.ipfs.tech/http-gateways/)
37+
- Conformance tests at [ipfs/gateway-conformance](https://github.com/ipfs/gateway-conformance)
38+
- Go implementation at [boxo/gateway](https://github.com/ipfs/boxo/tree/main/gateway)
639

740
## Usage
841

9-
Local build:
42+
### Local build
1043

1144
```console
1245
$ go build
13-
$ ./bifrost-gateway
46+
$ ./bifrost-gateway --help
1447
```
1548

49+
### Configuration
50+
51+
See `./bifrost-gateway --help` and [`./docs/environment-variables.md`](./docs/environment-variables.md)
52+
53+
1654
### Docker
1755

18-
```console
19-
$ docker pull ipfs/bifrost-gateway:main-latest
20-
$ docker run --rm -it --net=host ipfs/bifrost-gateway:main-latest
21-
```
56+
Official Docker images are provided at [hub.docker.com/r/ipfs/bifrost-gateway](https://hub.docker.com/r/ipfs/bifrost-gateway/tags).
2257

23-
When using Docker, make sure to pass necessary config via [`./docs/environment-variables.md`](./docs/environment-variables.md).
58+
- Releases
59+
- `latest` and `release` always point at the latest release
60+
- `vN.N.N` point at a specific [release tag](https://github.com/ipfs/bifrost-gateway/releases)
61+
- Developer builds
62+
- `main-latest` always points at the `HEAD` of the `main` branch
63+
- `main-YYYY-DD-MM-GITSHA` points at a specific commit from the `main` branch
2464

25-
List of available revisions: https://hub.docker.com/r/ipfs/bifrost-gateway/tags
2665

27-
### How to run with Saturn CDN backend
66+
When using Docker, make sure to pass necessary config via `-e`:
67+
```console
68+
$ docker pull ipfs/bifrost-gateway:release
69+
$ docker run --rm -it --net=host -e PROXY_GATEWAY_URL=http://127.0.0.1:8080 ipfs/bifrost-gateway:release
70+
```
2871

29-
[Saturn](https://strn.network) is an open-source, community-run Content Delivery Network (CDN).
30-
`bifrost-gateway` supports it via the [Caboose](https://github.com/filecoin-saturn/caboose) backend,
31-
which takes care of discovering and evaluating Saturn CDN peers.
72+
See [`./docs/environment-variables.md`](./docs/environment-variables.md).
3273

33-
See [_Saturn Backend_ in `./docs/environment-variables.md`](./docs/environment-variables.md#saturn-backend)
74+
## FAQ
3475

3576
### How to run with local gateway
3677

37-
Saturn is implementation detail specific to ipfs.io infrastructure.
38-
One can run `bifrost-gateway` without it. All you need is endpoint that supports
39-
[verifiable response types](https://docs.ipfs.tech/reference/http/gateway/#trustless-verifiable-retrieval).
78+
All you need is a [trustless gateway](https://specs.ipfs.tech/http-gateways/trustless-gateway/) endpoint that supports [verifiable response types](https://docs.ipfs.tech/reference/http/gateway/#trustless-verifiable-retrieval).
4079

41-
To run without Saturn and use Gateway provided by a local IPFS node like [Kubo](https://github.com/ipfs/kubo):
80+
To run against a compatible, local trustless gateway provided by [Kubo](https://github.com/ipfs/kubo) or [IPFS Desktop](https://docs.ipfs.tech/install/ipfs-desktop/):
4281

4382
```console
4483
$ PROXY_GATEWAY_URL="http://127.0.0.1:8080" ./bifrost-gateway
4584
```
4685

4786
See [_Proxy Backend_ in `./docs/environment-variables.md`](./docs/environment-variables.md#proxy-backend)
4887

88+
### How to run with Saturn CDN backend
4989

50-
### How to debug?
51-
52-
See [`GOLOG_LOG_LEVEL`](./docs/environment-variables.md#golog_log_level).
53-
54-
## Configuration
55-
56-
See `./bifrost-gateway --help` and [`./docs/environment-variables.md`](./docs/environment-variables.md)
90+
[Saturn](https://strn.network) is a CDN that provides a pool of [trustless gateways](https://specs.ipfs.tech/http-gateways/trustless-gateway/).
5791

58-
## Documentation
92+
`bifrost-gateway` supports it via the [Caboose](https://github.com/filecoin-saturn/caboose) backend,
93+
which takes care of discovering and evaluating Block/CAR gateways (in Saturn called L1 nodes/peers) for increased availability.
5994

60-
- HTTP Gateway implementation: [go-libipf/gateway](https://github.com/ipfs/go-libipfs/tree/main/gateway#readme)
61-
- IPFS backend provided by: [Project Rhea (decentralized IPFS gateway)](https://pl-strflt.notion.site/Project-Rhea-decentralized-IPFS-gateway-3d5906e7a0d84bea800d5920005dfea6)
95+
See [_Saturn Backend_ in `./docs/environment-variables.md`](./docs/environment-variables.md#saturn-backend)
6296

63-
## Goals
97+
### How to debug
6498

65-
This repository provides implementation of HTTP gateway capable of serving requests to:
66-
- [path gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#path-gateway) at `ipfs.io`
67-
- [subdomain gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#subdomain-gateway) at `dweb.link`
68-
- [selected DNSLink websites](https://github.com/protocol/bifrost-infra/blob/b6f85a54fddf1c21a966f8d5e5a3e31f54ad5431/ansible/inventories/bifrost/group_vars/collab_cluster.yml#L140-L271) on their own domain names.
99+
See [`GOLOG_LOG_LEVEL`](./docs/environment-variables.md#golog_log_level).
69100

70-
This includes deserialized flat files, and special response types like verifiable Block/CAR.
101+
### How does this work at ipfs.io and dweb.link
71102

72-
## High level design
103+
This is WIP, but the high level architecture is:
73104

74105
```mermaid
75106
graph LR
@@ -97,15 +128,19 @@ graph LR
97128
B ..->|fa:fa-cubes TBD HTTP GET CAR x N | S
98129
```
99130

131+
`bifrost-gateway` nodes are responsible for processing requests to:
100132

101-
- IPFS Gateway interface based on reference implementation from [go-libipfs/gateway](https://github.com/ipfs/go-libipfs/tree/main/gateway#readme).
102-
- IPFS Backend based on https://strn.network and HTTP client talking to it via [caboose](https://github.com/filecoin-saturn/caboose) or something else.
103-
- Functional gaps facilitated by temporary delegation to legacy Kubo RPC `(/api/v0`) infra already used by js-ipfs (or dedicated one).
133+
- [path gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#path-gateway) at `ipfs.io`
134+
- [subdomain gateway](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#subdomain-gateway) at `dweb.link`
135+
- [selected DNSLink websites](https://github.com/protocol/bifrost-infra/blob/b6f85a54fddf1c21a966f8d5e5a3e31f54ad5431/ansible/inventories/bifrost/group_vars/collab_cluster.yml#L140-L271) on their own domain names.
104136

137+
Caveats:
105138

106-
## Lead Maintainer
139+
- IPFS Gateway interface based on reference implementation from [boxo/gateway](https://github.com/ipfs/boxo/tree/main/gateway#readme).
140+
- IPFS Backend based on https://strn.network and HTTP client talking to it via [caboose](https://github.com/filecoin-saturn/caboose) with `STRN_LOGGER_SECRET`.
141+
- Learn more at [Project Rhea (decentralized IPFS gateway)](https://pl-strflt.notion.site/Project-Rhea-decentralized-IPFS-gateway-3d5906e7a0d84bea800d5920005dfea6)
142+
- Functional gaps facilitated by temporary delegation to legacy Kubo RPC (`/api/v0`) at `https://node[0-3].delegate.ipfs.io` infra (already used by js-ipfs).
107143

108-
- IPFS Stewards
109144

110145
## Contributing
111146

0 commit comments

Comments
 (0)