mirror of
https://github.com/luxfi/indexer.git
synced 2026-09-24 00:25:37 +00:00
luxfi/indexer is now a single-purpose repo: the standalone indexerd
chain-indexer daemon. The unified Go binary (indexer + graph + embedded
SPA) lives in luxfi/explorer; the standalone graph daemon lives in
luxfi/graph. One way to do everything.
Changes:
- cmd/indexerd/ new entrypoint (replaces broken cmd/indexer/)
- daemon/ public package: Config, RunIndexers, MountIndexerAPI,
MountHealth, ListenAndServe — importable by
luxfi/explorer for the unified binary
- Dockerfile builds only /usr/local/bin/indexerd (port 8091)
- Makefile single target
Removed:
- cmd/explorer/, cmd/explorerd/ — moved to luxfi/explorer
- cmd/indexer/ — broken (imports nonexistent
{a,b,k,p,q,t,x,z}chain packages)
- cmd/multichain/, multichain/ — outdated multi-chain manager
- cmd/evmchains/ — outdated EVM chain registry tool
- cmd/graphd/ — moved to luxfi/graph
- Dockerfile.{indexer,orig,simple} — pre-canonical leftovers
Indexer config (daemon.Config) is intentionally minimal: data_dir,
http_addr, chains[]. Brand, networks, graph, token, and subgraph
customization is the unified-explorer concern (per-chain in chains.yaml,
read by luxfi/explorer). Extra YAML fields are silently ignored here.
41 lines
873 B
Makefile
41 lines
873 B
Makefile
.PHONY: build test test-coverage clean docker lint fmt vet dev deps
|
|
|
|
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
|
|
LDFLAGS := -ldflags "-X main.version=$(VERSION)"
|
|
|
|
build:
|
|
go build $(LDFLAGS) -o bin/indexerd ./cmd/indexerd
|
|
|
|
test:
|
|
go test -v ./...
|
|
|
|
test-coverage:
|
|
go test -coverprofile=coverage.out ./...
|
|
go tool cover -html=coverage.out -o coverage.html
|
|
|
|
docker:
|
|
docker build -t ghcr.io/luxfi/indexer:$(VERSION) .
|
|
docker tag ghcr.io/luxfi/indexer:$(VERSION) ghcr.io/luxfi/indexer:latest
|
|
|
|
lint:
|
|
golangci-lint run ./...
|
|
|
|
fmt:
|
|
go fmt ./...
|
|
|
|
vet:
|
|
go vet ./...
|
|
|
|
dev:
|
|
go run ./cmd/indexerd --rpc=http://localhost:9630/ext/bc/C/rpc --chain-name="C-Chain" --coin=LUX --chain-id=96369
|
|
|
|
dev-config:
|
|
go run ./cmd/indexerd --config=chains.example.yaml
|
|
|
|
clean:
|
|
rm -rf bin/ coverage.out coverage.html
|
|
|
|
deps:
|
|
go mod download
|
|
go mod tidy
|