Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ e2e/coverage.html
e2e/logs/
# Generated config file (template is tracked)
e2e/config.test.yaml

peers.json
node0/
node1/
node2/
config.yaml
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,13 @@ clean:

# Full clean (including E2E artifacts)
clean-all: clean e2e-clean

gen-configs:
chmod +x ./deployments/base/node-configs/setup-nodes.sh
./deployments/base/node-configs/setup-nodes.sh

run-dev:
docker compose -f ./deployments/dev/docker-compose.yaml up -d

stop-dev:
docker compose -f ./deployments/dev/docker-compose.yaml down
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,60 @@ The application uses a YAML configuration file (`config.yaml`) with the followin

For full installation and run instructions, see [INSTALLATION.md](./INSTALLATION.md).

## Quick Start

Get up and running with MPCIUM in minutes using our automated setup:

### 1. Generate Node Configurations

```bash
# Generate all node configurations, identities, and Docker setup
make gen-configs
```

This command will:

- Generate 3 MPC nodes with 2-of-3 threshold
- Create all necessary identity files and configurations
- Set up Docker Compose files for easy deployment

### 2. Start Development Environment

```bash
# Start all services (NATS, Consul, and MPC nodes)
make start-dev
```

This will launch:

- NATS messaging server
- Consul for service discovery
- 3 MPC nodes (node0, node1, node2)
- Automatic peer registration

### 3. Stop Development Environment

```bash
# Stop all services
make stop-dev
```

### 4. View Logs

```bash
# View logs from all services
docker-compose -f ./deployments/dev/docker-compose.yaml logs -f

# View logs from a specific node
docker-compose -f ./deployments/dev/docker-compose.yaml logs -f mpcium-node0
```

### 5. Test the Setup

Once all nodes are running, you can test the MPC cluster using the client examples in the `examples/` directory.

**That's it!** Your MPCIUM cluster is now ready for secure wallet generation and signing operations.

## Preview usage

### Start nodes
Expand Down
49 changes: 49 additions & 0 deletions deployments/base/mpcium-cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Stage 1: Build stage
FROM golang:1.24.4-alpine AS builder

# Install build dependencies
RUN apk add --no-cache git ca-certificates tzdata

# Set working directory
WORKDIR /app

# Copy go mod files
COPY go.mod go.sum ./

# Download dependencies
RUN go mod download

# Copy source code
COPY . .

# Build the binary
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-ldflags='-w -s -extldflags "-static"' \
-o mpcium-cli ./cmd/mpcium-cli

# Stage 2: Runtime stage
FROM alpine:3.19

# Install runtime dependencies
RUN apk add --no-cache ca-certificates tzdata

# Create non-root user
RUN addgroup -g 1001 -S mpcium && \
adduser -u 1001 -S mpcium -G mpcium

# Set working directory
WORKDIR /app

# Copy binary from builder stage
COPY --from=builder /app/mpcium-cli .

# Create necessary directories
RUN mkdir -p identity && \
chown -R mpcium:mpcium /app

# Switch to non-root user
USER mpcium

# Default command
ENTRYPOINT ["./mpcium-cli"]
CMD ["--help"]
61 changes: 61 additions & 0 deletions deployments/base/mpcium/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Stage 1: Build stage
FROM golang:1.24.4-alpine AS builder

# Install build dependencies
RUN apk add --no-cache git ca-certificates tzdata

# Set working directory
WORKDIR /app

# Copy go mod files
COPY go.mod go.sum ./

# Download dependencies
RUN go mod download

# Copy source code
COPY . .

# Build the binary
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-ldflags='-w -s -extldflags "-static"' \
-o mpcium ./cmd/mpcium

# Stage 2: Runtime stage
FROM alpine:3.19

# Install runtime dependencies
RUN apk add --no-cache ca-certificates tzdata

# Create non-root user
RUN addgroup -g 1001 -S mpcium && \
adduser -u 1001 -S mpcium -G mpcium

# Set working directory
WORKDIR /app

# Copy binary from builder stage
COPY --from=builder /app/mpcium .

# Create wrapper script for environment variable support
RUN echo '#!/bin/sh' > /app/entrypoint.sh && \
echo 'NODE_NAME=${NODE_NAME:-node0}' >> /app/entrypoint.sh && \
echo 'exec ./mpcium start --name "$NODE_NAME" "$@"' >> /app/entrypoint.sh && \
chmod +x /app/entrypoint.sh

# Create necessary directories with proper permissions for volume mounting
RUN mkdir -p db backups identity certs && \
chmod 777 db backups && \
chown -R mpcium:mpcium /app

# Switch to non-root user
USER mpcium

# Set default node name
ENV NODE_NAME=node0

# Expose default port
EXPOSE 8080

# Use wrapper script as entrypoint
ENTRYPOINT ["/app/entrypoint.sh"]
Loading
Loading