bifrost-gateway
Gateway implementation used by protocol/bifrost-infra
Usage
Local build:
$ go build
$ ./bifrost-gateway
Docker
$ docker pull ipfs/bifrost-gateway:main-latest
$ docker run --rm -it --net=host ipfs/bifrost-gateway:main-latest
When using Docker, make sure to pass necessary config via ./docs/environment-variables.md
.
List of available revisions: https://hub.docker.com/r/ipfs/bifrost-gateway/tags
How to run with Saturn CDN backend
Saturn is an open-source, community-run Content Delivery Network (CDN).
bifrost-gateway
supports it via the Caboose backend,
which takes care of discovering and evaluating Saturn CDN peers.
See Saturn Backend in ./docs/environment-variables.md
How to run with local gateway
Saturn is implementation detail specific to ipfs.io infrastructure.
One can run bifrost-gateway
without it. All you need is endpoint that supports
verifiable response types.
To run without Saturn and use Gateway provided by a local IPFS node like Kubo:
$ PROXY_GATEWAY_URL="http://127.0.0.1:8080" ./bifrost-gateway
See Proxy Backend in ./docs/environment-variables.md
How to debug?
See GOLOG_LOG_LEVEL
.
Configuration
See ./bifrost-gateway --help
and ./docs/environment-variables.md
Documentation
Goals
This repository provides implementation of HTTP gateway capable of serving requests to:
This includes deserialized flat files, and special response types like verifiable Block/CAR.
High level design
graph LR
A(((fa:fa-person HTTP</br>clients)))
B[bifrost-gateway]
N[[fa:fa-hive bifrost-infra:<br>HTTP load-balancers<br> nginx, TLS termination]]
S(((saturn.pl<br>CDN)))
A -->| Accept: text/html, *| N
A -->| Accept: application/vnd.ipld.raw | N
A -->| Accept: application/vnd.ipld.car | N
A -->| Accept: application/vnd.ipld.dag-json | N
A -->| Accept: application/vnd.ipld.dag-cbor | N
A -->| Accept: application/json | N
A -->| Accept: application/cbor | N
A -->| Accept: application/x-tar | N
A -->| Accept: application/vnd.ipfs.ipns-record | N
A -->| DNSLink Host: en.wikipedia-on-ipfs.org | N
A -->| Subdomain Host: cid.ipfs.dweb.link | N
N --> B
B --->|fa:fa-cube HTTP GET Block x N | S
B ..->|fa:fa-cubes TBD HTTP GET CAR x N | S
- IPFS Gateway interface based on reference implementation from go-libipfs/gateway.
- IPFS Backend based on https://strn.network and HTTP client talking to it via caboose or something else.
- Functional gaps facilitated by temporary delegation to legacy Kubo RPC
(/api/v0
) infra already used by js-ipfs (or dedicated one).
Lead Maintainer
Contributing
Contributions are welcome! This repository is part of the IPFS project and therefore governed by our contributing guidelines.
License
SPDX-License-Identifier: Apache-2.0 OR MIT