Browse Source

Fix Docker test setup for negentropy interop testing

- Use pre-built dockurr/strfry image instead of building from source
- Fix strfry.conf format to match strfry 1.0.4 syntax
- Fix Dockerfile.orly to build both relay and sync binaries
- Use GOTOOLCHAIN=auto to handle Go version requirements
- Remove healthcheck dependencies to prevent startup blocking

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
main
woikos 4 months ago
parent
commit
85a3b448eb
No known key found for this signature in database
  1. 8
      tests/negentropy/Dockerfile.orly
  2. 3
      tests/negentropy/Dockerfile.strfry
  3. 28
      tests/negentropy/docker-compose.yml
  4. 86
      tests/negentropy/strfry.conf

8
tests/negentropy/Dockerfile.orly

@ -1,14 +1,15 @@
# ORLY relay Dockerfile for negentropy interop testing # ORLY relay Dockerfile for negentropy interop testing
FROM golang:1.23-alpine AS builder FROM golang:1.24-alpine AS builder
RUN apk add --no-cache git make RUN apk add --no-cache git make
WORKDIR /build WORKDIR /build
COPY . . COPY . .
# Build orly binary # Build orly relay binary (main.go in project root) and sync binary
RUN CGO_ENABLED=0 go build -o orly ./cmd/orly RUN GOTOOLCHAIN=auto CGO_ENABLED=0 go build -o orly . && \
GOTOOLCHAIN=auto CGO_ENABLED=0 go build -o orly-sync ./cmd/orly
# Runtime image # Runtime image
FROM alpine:3.19 FROM alpine:3.19
@ -17,6 +18,7 @@ RUN apk add --no-cache ca-certificates curl jq
WORKDIR /app WORKDIR /app
COPY --from=builder /build/orly /app/ COPY --from=builder /build/orly /app/
COPY --from=builder /build/orly-sync /app/
RUN mkdir -p /data RUN mkdir -p /data

3
tests/negentropy/Dockerfile.strfry

@ -13,6 +13,8 @@ RUN apt-get update && apt-get install -y \
libsecp256k1-dev \ libsecp256k1-dev \
libflatbuffers-dev \ libflatbuffers-dev \
libzstd-dev \ libzstd-dev \
libssl-dev \
zlib1g-dev \
pkg-config \ pkg-config \
libtool \ libtool \
autoconf \ autoconf \
@ -38,6 +40,7 @@ RUN apt-get update && apt-get install -y \
libsecp256k1-0 \ libsecp256k1-0 \
libflatbuffers1 \ libflatbuffers1 \
libzstd1 \ libzstd1 \
libssl3 \
curl \ curl \
jq \ jq \
websocat \ websocat \

28
tests/negentropy/docker-compose.yml

@ -8,19 +8,13 @@
services: services:
strfry: strfry:
build: image: dockurr/strfry:latest
context: .
dockerfile: Dockerfile.strfry
ports: ports:
- "7777:7777" - "7777:7777"
volumes: volumes:
- strfry-data:/data - strfry-data:/strfry-db
healthcheck: - ./strfry.conf:/etc/strfry.conf:ro
test: ["CMD", "curl", "-f", "http://localhost:7777"] command: ["/app/strfry", "relay", "--config=/etc/strfry.conf"]
interval: 5s
timeout: 5s
retries: 5
start_period: 30s
networks: networks:
- negentropy-test - negentropy-test
@ -34,18 +28,16 @@ services:
- ORLY_PORT=3334 - ORLY_PORT=3334
- ORLY_DATA_DIR=/data - ORLY_DATA_DIR=/data
- ORLY_LOG_LEVEL=info - ORLY_LOG_LEVEL=info
- ORLY_SYNC_TARGET_RELAYS=ws://strfry:7777
volumes: volumes:
- orly-data:/data - orly-data:/data
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3334"] test: ["CMD", "curl", "-sf", "http://localhost:3334"]
interval: 5s interval: 5s
timeout: 5s timeout: 5s
retries: 5 retries: 10
start_period: 10s start_period: 10s
depends_on: depends_on:
strfry: - strfry
condition: service_healthy
networks: networks:
- negentropy-test - negentropy-test
@ -61,10 +53,8 @@ services:
volumes: volumes:
- sync-data:/data - sync-data:/data
depends_on: depends_on:
strfry: - strfry
condition: service_healthy - orly
orly:
condition: service_healthy
networks: networks:
- negentropy-test - negentropy-test

86
tests/negentropy/strfry.conf

@ -1,36 +1,78 @@
## strfry configuration for negentropy interop testing ##
## strfry config for negentropy interop testing
##
# Directory that contains the strfry LMDB database
db = "/strfry-db/"
dbParams {
maxreaders = 256
mapsize = 10995116277760
noReadAhead = false
}
events {
maxEventSize = 65536
rejectEventsNewerThanSeconds = 900
rejectEventsOlderThanSeconds = 94608000
rejectEphemeralEventsOlderThanSeconds = 60
ephemeralEventsLifetimeSeconds = 300
maxNumTags = 2000
maxTagValSize = 1024
}
relay { relay {
# Interface to listen on. Use 0.0.0.0 to listen on all interfaces # Listen on all interfaces for Docker
bind = "0.0.0.0" bind = "0.0.0.0"
# Port to open for the nostr websocket protocol
port = 7777 port = 7777
# Enable negentropy protocol for sync nofiles = 1000000
negentropy { realIpHeader = ""
info {
name = "strfry test"
description = "strfry instance for negentropy interop testing"
pubkey = ""
contact = ""
icon = ""
nips = ""
}
maxWebsocketPayloadSize = 131072
maxReqFilterSize = 200
autoPingSeconds = 55
enableTcpKeepalive = false
queryTimesliceBudgetMicroseconds = 10000
maxFilterLimit = 10000
maxSubsPerConnection = 20
writePolicy {
plugin = ""
}
compression {
enabled = true enabled = true
maxSyncEvents = 1000000 slidingWindow = true
}
logging {
dumpInAll = false
dumpInEvents = false
dumpInReqs = false
dbScanPerf = false
invalidEvents = true
} }
# Number of threads for handling negentropy messages
numThreads { numThreads {
ingester = 3
reqWorker = 3
reqMonitor = 3
negentropy = 4 negentropy = 4
} }
# Nostr protocol settings negentropy {
nostr { # Enable negentropy protocol for sync testing
# Maximum message size (1MB) enabled = true
maxFilterLimit = 10000 maxSyncEvents = 1000000
} }
} }
db {
# LMDB directory
path = "/data/strfry-db/"
}
events {
# Maximum events to return
maxLimit = 10000
}

Loading…
Cancel
Save