Skip to content
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
21 changes: 17 additions & 4 deletions docker-compose.drawbridge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@ services:
- ./data/drawbridge:/data/drawbridge
- ./data/cln-mainnet:/data/lightning:ro
- tor-hostname:/data/tor:ro
healthcheck:
test: ["CMD", "node", "-e", "const http=require('http');const req=http.get('http://127.0.0.1:4222/api/v1/ready',res=>{let body='';res.on('data',chunk=>body+=chunk);res.on('end',()=>process.exit(res.statusCode===200&&(body.trim()==='true'||body.includes('\"ready\":true'))?0:1));});req.on('error',()=>process.exit(1));"]
interval: 15s
timeout: 5s
retries: 6
start_period: 25s
depends_on:
gatekeeper:
condition: service_started
condition: service_healthy
redis:
condition: service_started
condition: service_healthy

drawbridge-client:
build:
Expand All @@ -51,8 +57,15 @@ services:
user: "${ARCHON_UID}:${ARCHON_GID}"
ports:
- "${ARCHON_DRAWBRIDGE_CLIENT_PORT:-4223}:4223"
healthcheck:
test: ["CMD", "node", "-e", "const http=require('http');const req=http.get('http://127.0.0.1:4223/',res=>process.exit(res.statusCode===200?0:1));req.on('error',()=>process.exit(1));"]
interval: 15s
timeout: 5s
retries: 6
start_period: 20s
depends_on:
- drawbridge
drawbridge:
condition: service_healthy

tor:
image: goldy/tor-hidden-service:latest
Expand All @@ -77,7 +90,7 @@ services:
wait
depends_on:
drawbridge:
condition: service_started
condition: service_healthy

volumes:
tor-hostname:
108 changes: 90 additions & 18 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ services:
- ./data/mongodb:/data/db
ports:
- 127.0.0.1:27017:27017
healthcheck:
test: ["CMD", "mongosh", "--quiet", "--eval", "db.adminCommand({ ping: 1 })"]
interval: 10s
timeout: 5s
retries: 6
start_period: 15s

redis:
image: redis:8.0.4-alpine
Expand All @@ -21,6 +27,12 @@ services:
- ./data/redis:/data
ports:
- 127.0.0.1:6379:6379
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 6
start_period: 10s

ipfs:
image: ipfs/kubo:v0.40.1
Expand Down Expand Up @@ -59,10 +71,19 @@ services:
user: "${ARCHON_UID}:${ARCHON_GID}"
ports:
- ${ARCHON_GATEKEEPER_PORT}:4224
healthcheck:
test: ["CMD", "node", "-e", "const http=require('http');const req=http.get('http://127.0.0.1:4224/api/v1/ready',res=>{let body='';res.on('data',chunk=>body+=chunk);res.on('end',()=>process.exit(res.statusCode===200&&(body.trim()==='true'||body.includes('\"ready\":true'))?0:1));});req.on('error',()=>process.exit(1));"]
interval: 10s
timeout: 5s
retries: 6
start_period: 20s
depends_on:
- mongodb
- redis
- ipfs
mongodb:
condition: service_healthy
redis:
condition: service_healthy
ipfs:
condition: service_healthy

keymaster:
build:
Expand Down Expand Up @@ -90,10 +111,19 @@ services:
user: "${ARCHON_UID}:${ARCHON_GID}"
ports:
- ${ARCHON_KEYMASTER_PORT}:4226
healthcheck:
test: ["CMD", "node", "-e", "const http=require('http');const req=http.get('http://127.0.0.1:4226/api/v1/ready',res=>{let body='';res.on('data',chunk=>body+=chunk);res.on('end',()=>process.exit(res.statusCode===200&&body.includes('\"ready\":true')?0:1));});req.on('error',()=>process.exit(1));"]
interval: 10s
timeout: 5s
retries: 6
start_period: 20s
depends_on:
- gatekeeper
- redis
- mongodb
gatekeeper:
condition: service_healthy
redis:
condition: service_healthy
mongodb:
condition: service_healthy

hyperswarm-mediator:
build:
Expand All @@ -115,10 +145,19 @@ services:
user: "${ARCHON_UID}:${ARCHON_GID}"
ports:
- "127.0.0.1:4232:4232"
healthcheck:
test: ["CMD", "node", "-e", "const http=require('http');const req=http.get('http://127.0.0.1:4232/ready',res=>{let body='';res.on('data',chunk=>body+=chunk);res.on('end',()=>process.exit(res.statusCode===200&&body.includes('\"ready\":true')?0:1));});req.on('error',()=>process.exit(1));"]
interval: 15s
timeout: 5s
retries: 6
start_period: 25s
depends_on:
- gatekeeper
- keymaster
- ipfs
gatekeeper:
condition: service_healthy
keymaster:
condition: service_healthy
ipfs:
condition: service_healthy

cli:
build:
Expand All @@ -136,9 +175,12 @@ services:
- ./share:/app/share
user: "${ARCHON_UID}:${ARCHON_GID}"
depends_on:
- gatekeeper
- keymaster
- ipfs
gatekeeper:
condition: service_healthy
keymaster:
condition: service_healthy
ipfs:
condition: service_healthy

explorer:
build:
Expand All @@ -154,8 +196,15 @@ services:
- VITE_OPERATION_NETWORKS=hyperswarm,local,BTC:signet,BTC:testnet4
ports:
- "4000:4000"
healthcheck:
test: ["CMD", "node", "-e", "const http=require('http');const req=http.get('http://127.0.0.1:4000/version',res=>process.exit(res.statusCode===200?0:1));req.on('error',()=>process.exit(1));"]
interval: 15s
timeout: 5s
retries: 6
start_period: 20s
depends_on:
- gatekeeper
gatekeeper:
condition: service_healthy

gatekeeper-client:
build:
Expand All @@ -170,8 +219,15 @@ services:
user: "${ARCHON_UID}:${ARCHON_GID}"
ports:
- "${ARCHON_GATEKEEPER_CLIENT_PORT:-4225}:4225"
healthcheck:
test: ["CMD", "node", "-e", "const http=require('http');const req=http.get('http://127.0.0.1:4225/',res=>process.exit(res.statusCode===200?0:1));req.on('error',()=>process.exit(1));"]
interval: 15s
timeout: 5s
retries: 6
start_period: 20s
depends_on:
- gatekeeper
gatekeeper:
condition: service_healthy

keymaster-client:
build:
Expand All @@ -186,8 +242,15 @@ services:
user: "${ARCHON_UID}:${ARCHON_GID}"
ports:
- "${ARCHON_KEYMASTER_CLIENT_PORT:-4227}:4227"
healthcheck:
test: ["CMD", "node", "-e", "const http=require('http');const req=http.get('http://127.0.0.1:4227/',res=>process.exit(res.statusCode===200?0:1));req.on('error',()=>process.exit(1));"]
interval: 15s
timeout: 5s
retries: 6
start_period: 20s
depends_on:
- keymaster
keymaster:
condition: service_healthy

react-wallet:
build:
Expand All @@ -204,8 +267,15 @@ services:
user: "${ARCHON_UID}:${ARCHON_GID}"
ports:
- "${ARCHON_REACT_WALLET_PORT:-4228}:${ARCHON_REACT_WALLET_PORT:-4228}"
healthcheck:
test: ["CMD", "node", "-e", "const http=require('http');const req=http.get('http://127.0.0.1:4228/',res=>process.exit(res.statusCode===200?0:1));req.on('error',()=>process.exit(1));"]
interval: 15s
timeout: 5s
retries: 6
start_period: 20s
depends_on:
- gatekeeper
gatekeeper:
condition: service_healthy

# Observability Stack
prometheus:
Expand All @@ -221,8 +291,10 @@ services:
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention.time=15d"
depends_on:
- gatekeeper
- keymaster
gatekeeper:
condition: service_healthy
keymaster:
condition: service_healthy

grafana:
image: grafana/grafana:10.4.0
Expand Down
14 changes: 14 additions & 0 deletions services/mediators/hyperswarm/src/hyperswarm-mediator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,20 @@ function updateGauges(): void {
function startMetricsServer(): void {
const app = express();

app.get('/ready', async (_req, res) => {
try {
const [gatekeeperReady, keymasterReady, ipfsReady] = await Promise.all([
gatekeeper.isReady(),
keymaster.isReady(),
ipfs.isReady(),
]);

res.json({ ready: gatekeeperReady && keymasterReady && ipfsReady && Boolean(nodeInfo) });
} catch {
res.json({ ready: false });
}
});

app.get('/version', (_req, res) => {
res.json({ version: serviceVersion, commit: serviceCommit });
});
Expand Down
Loading