The explorer already serves each chain it indexes on one service. In front of
it sit four exchange-api proxies — one per brand per network, each pinned by env
to a single chain, each on its own hostname, each its own image tag — of a
2,253-byte forwarder whose output is byte-identical to what it forwards to.
exchange.lux.cloud/v1/graph/{chain}/amm/graphql now reaches them all. The old
path stays until the app stops asking for it, then the proxies and their
hostnames go.
The trailing slash on the prefix is load-bearing and I learned it the hard way:
this controller matches prefixes as strings, so `/v1/graph` also claims
`/v1/graphql`, and every Explore query 404s until it is `/v1/graph/`.
Co-authored-by: Hanzo Dev <[email protected]>
25 lines
937 B
YAML
25 lines
937 B
YAML
# The indexer, reachable from lux-ns.
|
|
#
|
|
# The explorer serves every chain it indexes on one service — /v1/graph/cchain,
|
|
# /v1/graph/zoo, /v1/graph/pars, /v1/graph/osage — but it lives in lux-mainnet,
|
|
# and an Ingress may only name a backend in its own namespace. This is that
|
|
# name: an alias in lux-ns for the service in lux-mainnet, so exchange.lux.cloud
|
|
# can route a path to it.
|
|
#
|
|
# It exists to retire the exchange-api proxies. There are four of them, one per
|
|
# brand per network, each pinned by env to a single chain's path, each on its own
|
|
# hostname, each a separate image tag — of a 2,253-byte file whose output is
|
|
# byte-identical to the service it forwards to. The chain belongs in the path,
|
|
# not in a deployment.
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: explorer-graph
|
|
namespace: lux-ns
|
|
spec:
|
|
type: ExternalName
|
|
externalName: explorer.lux-mainnet.svc.cluster.local
|
|
ports:
|
|
- name: http
|
|
port: 80
|