diff --git a/tests/negentropy/Dockerfile.orly b/tests/negentropy/Dockerfile.orly index 5bfd917..5c1ea4e 100644 --- a/tests/negentropy/Dockerfile.orly +++ b/tests/negentropy/Dockerfile.orly @@ -1,14 +1,15 @@ # 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 WORKDIR /build COPY . . -# Build orly binary -RUN CGO_ENABLED=0 go build -o orly ./cmd/orly +# Build orly relay binary (main.go in project root) and sync binary +RUN GOTOOLCHAIN=auto CGO_ENABLED=0 go build -o orly . && \ + GOTOOLCHAIN=auto CGO_ENABLED=0 go build -o orly-sync ./cmd/orly # Runtime image FROM alpine:3.19 @@ -17,6 +18,7 @@ RUN apk add --no-cache ca-certificates curl jq WORKDIR /app COPY --from=builder /build/orly /app/ +COPY --from=builder /build/orly-sync /app/ RUN mkdir -p /data diff --git a/tests/negentropy/Dockerfile.strfry b/tests/negentropy/Dockerfile.strfry index be4d9d3..150c9b8 100644 --- a/tests/negentropy/Dockerfile.strfry +++ b/tests/negentropy/Dockerfile.strfry @@ -13,6 +13,8 @@ RUN apt-get update && apt-get install -y \ libsecp256k1-dev \ libflatbuffers-dev \ libzstd-dev \ + libssl-dev \ + zlib1g-dev \ pkg-config \ libtool \ autoconf \ @@ -38,6 +40,7 @@ RUN apt-get update && apt-get install -y \ libsecp256k1-0 \ libflatbuffers1 \ libzstd1 \ + libssl3 \ curl \ jq \ websocat \ diff --git a/tests/negentropy/docker-compose.yml b/tests/negentropy/docker-compose.yml index 45ba32b..62564ad 100644 --- a/tests/negentropy/docker-compose.yml +++ b/tests/negentropy/docker-compose.yml @@ -8,19 +8,13 @@ services: strfry: - build: - context: . - dockerfile: Dockerfile.strfry + image: dockurr/strfry:latest ports: - "7777:7777" volumes: - - strfry-data:/data - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:7777"] - interval: 5s - timeout: 5s - retries: 5 - start_period: 30s + - strfry-data:/strfry-db + - ./strfry.conf:/etc/strfry.conf:ro + command: ["/app/strfry", "relay", "--config=/etc/strfry.conf"] networks: - negentropy-test @@ -34,18 +28,16 @@ services: - ORLY_PORT=3334 - ORLY_DATA_DIR=/data - ORLY_LOG_LEVEL=info - - ORLY_SYNC_TARGET_RELAYS=ws://strfry:7777 volumes: - orly-data:/data healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:3334"] + test: ["CMD", "curl", "-sf", "http://localhost:3334"] interval: 5s timeout: 5s - retries: 5 + retries: 10 start_period: 10s depends_on: - strfry: - condition: service_healthy + - strfry networks: - negentropy-test @@ -61,10 +53,8 @@ services: volumes: - sync-data:/data depends_on: - strfry: - condition: service_healthy - orly: - condition: service_healthy + - strfry + - orly networks: - negentropy-test diff --git a/tests/negentropy/strfry.conf b/tests/negentropy/strfry.conf index 861540f..cfde7ee 100644 --- a/tests/negentropy/strfry.conf +++ b/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 { - # 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" - - # Port to open for the nostr websocket protocol port = 7777 - # Enable negentropy protocol for sync - negentropy { + nofiles = 1000000 + 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 - maxSyncEvents = 1000000 + slidingWindow = true + } + + logging { + dumpInAll = false + dumpInEvents = false + dumpInReqs = false + dbScanPerf = false + invalidEvents = true } - # Number of threads for handling negentropy messages numThreads { + ingester = 3 + reqWorker = 3 + reqMonitor = 3 negentropy = 4 } - # Nostr protocol settings - nostr { - # Maximum message size (1MB) - maxFilterLimit = 10000 + negentropy { + # Enable negentropy protocol for sync testing + enabled = true + maxSyncEvents = 1000000 } } - -db { - # LMDB directory - path = "/data/strfry-db/" -} - -events { - # Maximum events to return - maxLimit = 10000 -}