cmd: rename mpc-cli → mpc (pairs with mpcd daemon)

Matches the sshd/ssh, httpd/http unix pattern. Single Docker image
now ships both binaries: ENTRYPOINT is mpcd (the daemon); override
with 'mpc <subcommand>' for CLI ops (peers, identity, recover, etc).

Also aligns with lux/kms (single binary with subcommands) — operators
get the same shape across all Base-family daemons.
This commit is contained in:
2026-04-13 16:22:11 -07:00
parent c649ce7600
commit a9505db9d6
9 changed files with 17 additions and 20 deletions
+10 -13
View File
@@ -1,22 +1,19 @@
# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM golang:1.26-alpine AS builder
RUN apk add --no-cache git ca-certificates
ARG GITHUB_TOKEN
RUN git config --global url."https://${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
ENV GOPRIVATE=github.com/luxfi/*,github.com/hanzoai/*
# Lux MPC — single image ships both daemon (mpcd) + CLI (mpc).
# Default entrypoint: mpcd. Override with `mpc …` for CLI ops.
FROM golang:1.26-alpine AS builder
RUN apk add --no-cache gcc musl-dev
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ENV GOEXPERIMENT=runtimesecret
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o mpcd ./cmd/mpcd
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o mpcd ./cmd/mpcd
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o mpc ./cmd/mpc
FROM alpine:3.21
RUN apk add --no-cache ca-certificates
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app
COPY --from=builder /app/mpcd /usr/local/bin/mpcd
EXPOSE 8081 9651 9800
COPY --from=builder /app/mpc /usr/local/bin/mpc
EXPOSE 8081 9090
ENTRYPOINT ["mpcd"]
+5 -5
View File
@@ -1,4 +1,4 @@
.PHONY: all build clean mpcd mpc-cli test test-verbose test-coverage e2e-test e2e-clean cleanup-test-env test-all clean-all up down logs
.PHONY: all build clean mpcd mpc test test-verbose test-coverage e2e-test e2e-clean cleanup-test-env test-all clean-all up down logs
# Go 1.26 experimental features:
# runtimesecret - zeroes stack/register state after secret.Do() for forward secrecy
@@ -7,13 +7,13 @@ GOEXPERIMENT ?= runtimesecret,simd
all: build
build: mpcd mpc-cli
build: mpcd mpc
mpcd:
GOWORK=off GOEXPERIMENT=$(GOEXPERIMENT) go build -o mpcd ./cmd/mpcd
mpc-cli:
GOWORK=off GOEXPERIMENT=$(GOEXPERIMENT) go build -o mpc-cli ./cmd/mpc-cli
mpc:
GOWORK=off GOEXPERIMENT=$(GOEXPERIMENT) go build -o mpc ./cmd/mpc
# Run all tests (json1 enables SQLite JSON functions for ORM JSONB queries)
test:
@@ -57,7 +57,7 @@ logs:
# Clean
clean:
rm -f mpcd mpc-cli
rm -f mpcd mpc
rm -f coverage.out coverage.html
clean-all: clean e2e-clean
+2 -2
View File
@@ -16,7 +16,7 @@ const (
func main() {
cmd := &cli.Command{
Name: "mpc-cli",
Name: "mpc",
Usage: "MPC node management tools",
Commands: []*cli.Command{
{
@@ -154,7 +154,7 @@ func main() {
Name: "version",
Usage: "Display detailed version information",
Action: func(ctx context.Context, c *cli.Command) error {
fmt.Printf("mpc-cli version %s\n", VERSION)
fmt.Printf("mpc version %s\n", VERSION)
return nil
},
},