Skip to content
This repository was archived by the owner on Feb 8, 2026. It is now read-only.
Merged
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
44 changes: 44 additions & 0 deletions Dockerfile.Fee.server
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Use the official Go image as the base image
FROM golang:1.24 as builder
Comment on lines +1 to +2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Invalid base tag – Go 1.24 image not yet published

Switch to an existing tag (golang:1.22, etc.) or your private registry mirror.

🤖 Prompt for AI Agents
In Dockerfile.Fee.server at lines 1 to 2, the base image tag 'golang:1.24' is
invalid because it is not yet published. Change the base image tag to a valid
existing version such as 'golang:1.22' or use a tag from your private registry
mirror to ensure the image can be pulled successfully.


# Set the working directory
WORKDIR /app

# Copy go.mod and go.sum to install dependencies
COPY go.mod go.sum ./
RUN go mod download

# Copy the source code
COPY . .

RUN wget https://github.com/vultisig/go-wrappers/archive/refs/heads/master.tar.gz
RUN tar -xzf master.tar.gz && \
cd go-wrappers-master && \
mkdir -p /usr/local/lib/dkls && \
cp --recursive includes /usr/local/lib/dkls

ENV LD_LIBRARY_PATH=/usr/local/lib/dkls/includes/linux/:${LD_LIBRARY_PATH:-}

# Build the application
RUN go build -o server ./cmd/fees/server

# Use a minimal base image for the final stage
FROM ubuntu:24.04

RUN apt-get update && \
apt-get install -y wget && \
rm -rf /var/lib/apt/lists/*

# Set the working directory
WORKDIR /app

# Copy the built binary from the builder stage
COPY --from=builder /app/server .
COPY --from=builder /usr/local/lib/dkls /usr/local/lib/dkls
COPY fee.server.example.json config.json
COPY ./etc/vultisig/fee.yml /etc/vultisig/fee.yml

ENV LD_LIBRARY_PATH=/usr/local/lib/dkls/includes/linux/:${LD_LIBRARY_PATH:-}

# Run the application
CMD ["./server"]
41 changes: 41 additions & 0 deletions Dockerfile.Fee.server.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Use the official Go image as the base image
FROM golang:1.24
Comment on lines +1 to +2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Pin to an existing Go release – 1.24 does not yet exist

The official images only go up to 1.22.x at the moment. Referencing a non-existent tag will break the build once the cache is bust.
Update to the latest stable (e.g. golang:1.22-alpine) or pin a specific patch version.

🤖 Prompt for AI Agents
In Dockerfile.Fee.server.dev at lines 1 to 2, the base image is set to
golang:1.24, which does not exist yet and will cause build failures. Update the
FROM line to use an existing stable Go version tag such as golang:1.22-alpine or
a specific patch version like golang:1.22.9-alpine to ensure the image is
available and the build succeeds.


# Install air for hot reloading
RUN go install github.com/air-verse/air@latest

# Set the working directory
WORKDIR /app

# Copy go.mod and go.sum to install dependencies
COPY go.mod go.sum ./
RUN go mod download

# Download and install DKLS wrappers
RUN wget https://github.com/vultisig/go-wrappers/archive/refs/heads/master.tar.gz
RUN tar -xzf master.tar.gz && \
cd go-wrappers-master && \
mkdir -p /usr/local/lib/dkls && \
cp --recursive includes /usr/local/lib/dkls

ENV LD_LIBRARY_PATH=/usr/local/lib/dkls/includes/linux/:${LD_LIBRARY_PATH:-}

# Create tmp directory for air
RUN mkdir -p /app/tmp

# Create air configuration
RUN echo 'root = "."' > .air.toml && \
echo '' >> .air.toml && \
echo '[build]' >> .air.toml && \
echo ' bin = "./tmp/main"' >> .air.toml && \
echo ' cmd = "go build -o ./tmp/main ./cmd/fees/server"' >> .air.toml && \
echo ' delay = 1000' >> .air.toml && \
echo ' exclude_dir = ["assets", "tmp", "vendor", "testdata"]' >> .air.toml && \
echo ' exclude_regex = ["_test.go"]' >> .air.toml

# Copy configuration files
COPY fee.server.example.json config.json
COPY ./etc/vultisig/fee.yml /etc/vultisig/fee.yml

# Run air for hot reloading
CMD ["air"]
44 changes: 44 additions & 0 deletions Dockerfile.Fee.worker
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Use the official Go image as the base image
FROM golang:1.24 as builder

# Set the working directory
WORKDIR /app

# Copy go.mod and go.sum to install dependencies
COPY go.mod go.sum ./
RUN go mod download

# Copy the source code
COPY . .

RUN wget https://github.com/vultisig/go-wrappers/archive/refs/heads/master.tar.gz
RUN tar -xzf master.tar.gz && \
cd go-wrappers-master && \
mkdir -p /usr/local/lib/dkls && \
cp --recursive includes /usr/local/lib/dkls

ENV LD_LIBRARY_PATH=/usr/local/lib/dkls/includes/linux/:${LD_LIBRARY_PATH:-}

# Build the application
RUN go build -o worker ./cmd/fees/worker

# Use a minimal base image for the final stage
FROM ubuntu:24.04

RUN apt-get update && \
apt-get install -y wget && \
rm -rf /var/lib/apt/lists/*
Comment thread
garry-sharp marked this conversation as resolved.

# Set the working directory
WORKDIR /app

# Copy the built binary from the builder stage
COPY --from=builder /app/worker .
COPY --from=builder /usr/local/lib/dkls /usr/local/lib/dkls
COPY fee.worker.example.json config.json
COPY ./etc/vultisig/fee.yml /etc/vultisig/fee.yml

ENV LD_LIBRARY_PATH=/usr/local/lib/dkls/includes/linux/:${LD_LIBRARY_PATH:-}

# Run the application
CMD ["./worker"]
41 changes: 41 additions & 0 deletions Dockerfile.Fee.worker.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Use the official Go image as the base image
FROM golang:1.24

# Install air for hot reloading
RUN go install github.com/air-verse/air@latest

# Set the working directory
WORKDIR /app

# Copy go.mod and go.sum to install dependencies
COPY go.mod go.sum ./
RUN go mod download

# Download and install DKLS wrappers
RUN wget https://github.com/vultisig/go-wrappers/archive/refs/heads/master.tar.gz
RUN tar -xzf master.tar.gz && \
cd go-wrappers-master && \
mkdir -p /usr/local/lib/dkls && \
cp --recursive includes /usr/local/lib/dkls

ENV LD_LIBRARY_PATH=/usr/local/lib/dkls/includes/linux/:${LD_LIBRARY_PATH:-}

# Create tmp directory for air
RUN mkdir -p /app/tmp

# Create air configuration
RUN echo 'root = "."' > .air.toml && \
echo '' >> .air.toml && \
echo '[build]' >> .air.toml && \
echo ' bin = "./tmp/main"' >> .air.toml && \
echo ' cmd = "go build -o ./tmp/main ./cmd/fees/worker"' >> .air.toml && \
echo ' delay = 1000' >> .air.toml && \
echo ' exclude_dir = ["assets", "tmp", "vendor", "testdata"]' >> .air.toml && \
echo ' exclude_regex = ["_test.go"]' >> .air.toml

# Copy configuration files
COPY fee.worker.example.json config.json
COPY ./etc/vultisig/fee.yml /etc/vultisig/fee.yml

# Run air for hot reloading
CMD ["air"]
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
# adjust to point to your local go-wrappers repo
DYLD_LIBRARY=../go-wrappers/includes/darwin/:$LD_LIBRARY_PATH
DYLD_LIBRARY_PATH=../go-wrappers/includes/darwin/:$LD_LIBRARY_PATH


.PHONY: up up-dev down down-dev build build-dev dump-schema

up:
@docker compose up -d --remove-orphans;

up-dev:
Comment thread
garry-sharp marked this conversation as resolved.
@docker compose -f docker-compose.yaml -f docker-compose.dev.yaml up -d --remove-orphans;

down:
@docker compose down

down-dev:
@docker compose -f docker-compose.yaml -f docker-compose.dev.yaml down;

build:
@docker compose build;

build-dev:
@docker compose -f docker-compose.yaml -f docker-compose.dev.yaml build;


# Dump database schema
# Usage: make dump-schema CONFIG=config-plugin.yaml
Expand Down
3 changes: 3 additions & 0 deletions cmd/fees/worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ func main() {
)

postgressDB, err := postgres.NewPostgresBackend(cfg.Database.DSN, nil)
if err != nil {
panic(fmt.Errorf("failed to create postgres backend: %w", err))
}

txIndexerStore, err := storage.NewPostgresTxIndexStore(ctx, cfg.Database.DSN)
if err != nil {
Expand Down
37 changes: 37 additions & 0 deletions docker-compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
services:
fee-worker:
build:
context: .
dockerfile: Dockerfile.Fee.worker.dev
volumes:
- ./cmd:/app/cmd
- ./plugin:/app/plugin
- ./internal:/app/internal
- ./api:/app/api
- ./storage:/app/storage
- ./common:/app/common
- ./pkg:/app/pkg
- ./service:/app/service
- ./fee.worker.example.json:/app/config.json

fee-server:
build:
context: .
dockerfile: Dockerfile.Fee.server.dev
volumes:
- ./cmd:/app/cmd
- ./plugin:/app/plugin
- ./internal:/app/internal
- ./api:/app/api
- ./storage:/app/storage
- ./common:/app/common
- ./pkg:/app/pkg
- ./service:/app/service
- ./fee.server.example.json:/app/config.json

volumes:
db_data:
minio_data:
networks:
shared_network:
external: true
79 changes: 70 additions & 9 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
services:
payroll-db:
plugin-db: # One DB instance for all plugins, which point to different databases
image: postgres:15
environment:
POSTGRES_USER: myuser
Expand Down Expand Up @@ -29,6 +29,22 @@ services:
interval: 1s
timeout: 5s
retries: 3
volumes:
- redis_payroll:/data

redis-fees:
image: redis:latest
ports:
- "6377:6379"
networks:
- shared_network
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 1s
timeout: 5s
retries: 3
volumes:
- redis_fees:/data

asynqmon:
platform: linux/amd64
Expand Down Expand Up @@ -65,19 +81,19 @@ services:
REDIS_HOST: redis-payroll
REDIS_PORT: 6379
BLOCK_STORAGE_HOST: http://minio-plugin:9000
DATABASE_DSN: postgres://myuser:mypassword@payroll-db:5432/vultisig-payroll?sslmode=disable
DATABASE_DSN: postgres://myuser:mypassword@plugin-db:5432/vultisig-payroll?sslmode=disable
ports:
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- "8081:8080"
- "8081:8080"
depends_on:
payroll-db:
plugin-db:
condition: service_healthy
redis-payroll:
condition: service_healthy
minio-plugin:
condition: service_started
networks:
- shared_network
worker:
payroll-worker:
build:
context: .
dockerfile: Dockerfile.Payroll.worker
Expand All @@ -87,20 +103,65 @@ services:
REDIS_HOST: redis-payroll
REDIS_PORT: 6379
BLOCK_STORAGE_HOST: http://minio-plugin:9000
DATABASE_DSN: postgres://myuser:mypassword@payroll-db:5432/vultisig-payroll?sslmode=disable
DATABASE_DSN: postgres://myuser:mypassword@plugin-db:5432/vultisig-payroll?sslmode=disable
depends_on:
payroll-db:
plugin-db:
condition: service_healthy
redis-payroll:
condition: service_healthy
minio-plugin:
condition: service_started
networks:
- shared_network

fee-server:
build:
context: .
dockerfile: Dockerfile.Fee.server
platforms:
- linux/amd64
environment:
REDIS_HOST: redis-fees
REDIS_PORT: 6379
BLOCK_STORAGE_HOST: http://minio-plugin:9000
DATABASE_DSN: postgres://myuser:mypassword@plugin-db:5432/vultisig-fee?sslmode=disable
ports:
- "8082:8080"
depends_on:
plugin-db:
condition: service_healthy
redis-fees:
condition: service_healthy
minio-plugin:
condition: service_started
networks:
- shared_network
fee-worker:
build:
context: .
dockerfile: Dockerfile.Fee.worker
platforms:
- linux/amd64
environment:
REDIS_HOST: redis-fees
REDIS_PORT: 6379
BLOCK_STORAGE_HOST: http://minio-plugin:9000
DATABASE_DSN: postgres://myuser:mypassword@plugin-db:5432/vultisig-fee?sslmode=disable
depends_on:
plugin-db:
condition: service_healthy
redis-fees:
condition: service_healthy
minio-plugin:
condition: service_started
networks:
- shared_network

volumes:
db_data:
redis_data:
minio_data:
minio_data:
redis_payroll:
redis_fees:
networks:
shared_network:
external: true
3 changes: 3 additions & 0 deletions etc/vultisig/fee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type: fee
version: 0.0.1
rpc_url: https://eth.llamarpc.com
Loading