-
Notifications
You must be signed in to change notification settings - Fork 20
Conversation
3d0e987
to
1e12408
Compare
8945536
to
a701342
Compare
- block store provided by saturn - subdomain gateway support - dnslink gateway support - dnslink resolution - ipns resolution delegated to /api/v0/routing/get - /api/v0 redirected to randomly selected kubo node
a701342
to
c912625
Compare
@lidel @aschmahmann we have a reasonable working version here with the minimum features we need. I think we should get this reviewed and merged and then iterate on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @hacdias, this includes functional parity (paths, subdomains, dnslinks, same metrics as kubo), and should be a good starting point.
Merging to unblock other workstreams:
- improving saturn client (namely, smart retries that use different PoP, which it is lacking atm: error: Saturn data did not match given hash #16)
- improving RPC delegation Smart handling of legacy /api/v0 endpoints #13
- docker image feat: add docker image #11
- more metrics Add metrics specific to bifrost-gateway setup #12
- basic caching to avoid trashing blocks feat: blockstore cache #15
- etc
func (api *bifrostGateway) GetIPNSRecord(ctx context.Context, c cid.Cid) ([]byte, error) { | ||
return api.routing.GetValue(ctx, "/ipns/"+c.String()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hacdias mind opening a PR that immediately errors if CID codec is other than libp2p-key
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Naively choose one of the Kubo RPC clients. | ||
endpoint := ps.kuboRPC[rand.Intn(len(ps.kuboRPC))] | ||
|
||
u, err := url.Parse(fmt.Sprintf("%s/api/v0/routing/get?arg=%s", endpoint, key)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ exposing this is tracked in https://github.com/protocol/bifrost-infra/issues/2327
// Naively choose one of the Kubo RPC clients. | ||
endpoint := endpoints[rand.Intn(len(endpoints))] | ||
http.Redirect(w, r, endpoint+r.URL.Path+"?"+r.URL.RawQuery, http.StatusFound) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ this will be refined in #13
b2ec980
to
200ed66
Compare
This is an initial version of the Bifrost Gateway, which I would like to merge as soon as possible so we can work on improving it. It has the main features we require so far.
/api/v0/routing/get
with random selection of Kubo node./api/v0
redirected to randomly selected Kubo node.External