chainhook
chainhook copied to clipboard
wait for redis to be ready on startup
chainhook currently exits with code 1 if a Redis connection cannot be established on bootup
Oct 25 15:15:29.117 INFO Starting service...
Oct 25 15:15:29.119 ERRO Failed loading predicate from storage: unable to connect to redis: Connection refused (os error 61)
Oct 25 15:15:29.123 INFO Listening on port 20456 for chainhook predicate registrations
Oct 25 15:15:29.130 INFO Listening on port 20455 for Stacks chain events
Oct 25 15:15:29.130 INFO Observing Bitcoin chain events via Stacks node
Oct 25 15:15:29.131 INFO Seeding block pool with 0 blocks
Oct 25 15:15:29.132 CRIT Stacks scan runloop stopped.
Oct 25 15:15:29.132 INFO Handling Termination command
Oct 25 15:15:29.132 CRIT Bitcoin scan runloop stopped.
Oct 25 15:15:29.134 CRIT unable to connect to db: Connection refused (os error 61)
it should instead retry its connection every second or something until Redis is ready to make this process more reliable
Also, we should add a prom metric to indicate if we're successfully connected to redis