Skip to content

Commit

Permalink
fix(redis): update the kv-store defaults in docker vs. app
Browse files Browse the repository at this point in the history
Changing to set the default `KvBufferStore` to redis in the docker-compose and `fs` in the app. We cannot guranatee redis is running if the app is run as standalone, but can ensure `redis` is up and running in the `docker-compose`. Also updates the redis volume to use the proper default `data/` path where `rdb` files get saved. We may want to consider setting the `appendonly` flag when starting `redis`.
  • Loading branch information
dtfiedler committed Nov 9, 2023
1 parent 4e1a2b0 commit 7d85dea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,19 @@ services:
- SANDBOX_PROTOCOL=${SANDBOX_PROTOCOL:-}
- START_WRITERS=${START_WRITERS:-}
- CONTRACT_ID=${CONTRACT_ID:-}
- CHAIN_CACHE_TYPE=${CHAIN_CACHE_TYPE:-}
- CHAIN_CACHE_TYPE=${CHAIN_CACHE_TYPE:-redis}
- REDIS_CACHE_URL=${REDIS_CACHE_URL:-redis://redis:6379}
depends_on:
- redis

redis:
image: redis:latest
# TODO: append only is reccomended to prevent losing data
# command: redis-server --appendonly yes
ports:
- "6379:6379"
volumes:
- ${REDIS_DATA_PATH:-./data/redis}:/app/data/redis
- ${REDIS_DATA_PATH:-./data/redis}:/data

observer:
image: ghcr.io/ar-io/ar-io-observer:${OBSERVER_IMAGE_TAG:-a5b9b3a0246ba2912c610ad28ffe849d8184d752}
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const CONTRACT_ID = env.varOrDefault(
'CONTRACT_ID',
'bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U',
);
export const CHAIN_CACHE_TYPE = env.varOrDefault('CHAIN_CACHE_TYPE', 'redis');
export const CHAIN_CACHE_TYPE = env.varOrDefault('CHAIN_CACHE_TYPE', 'fs');
export const REDIS_CACHE_URL = env.varOrDefault(
'REDIS_CACHE_URL',
'redis://localhost:6379',
Expand Down

0 comments on commit 7d85dea

Please sign in to comment.