Skip to content

Commit

Permalink
PAY-2563: add solana relay health check (#8120)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecsavvy authored Apr 17, 2024
1 parent 9bd1984 commit 3cf9052
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
15 changes: 14 additions & 1 deletion dev-tools/compose/docker-compose.pedalboard.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ services:
- discovery
healthcheck:
test:
['CMD-SHELL', 'curl -f http://localhost:6001/relay/health || exit 1']
[
'CMD-SHELL',
'curl -f http://localhost:6001/relay/health || exit 1'
]
interval: 3s
timeout: 30s
retries: 3
Expand All @@ -74,6 +77,16 @@ services:
deploy:
mode: replicated
replicas: '${DISCOVERY_PROVIDER_REPLICAS}'
healthcheck:
test:
[
'CMD-SHELL',
'curl -f http://localhost:6002/solana/health_check || exit 1'
]
interval: 3s
timeout: 30s
retries: 3
start_period: 5s

sla-auditor:
container_name: sla-auditor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ import {
} from './middleware/signerRecovery'
import { cache } from './routes/cache'
import { feePayer } from './routes/feePayer'
import { health } from './routes/health/health'

const main = async () => {
const { serverHost, serverPort } = config
const app = express()
app.use(json())
app.use(cors())
app.use(incomingRequestLogger)
app.get('/solana/health_check', health)
app.use(userSignerRecoveryMiddleware)
app.use(discoveryNodeSignerRecoveryMiddleware)
app.post('/solana/relay', relay)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Request, Response, NextFunction } from 'express'
import type { RelayRequestBody } from '@audius/sdk'

export const health = async (req: Request, res: Response) => {
res.status(200).json({
isHealthy: true
})
}

0 comments on commit 3cf9052

Please sign in to comment.