From 1ea94bc1d0f9d07df2627aa38a3ac51960556229 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Tue, 16 Aug 2022 05:00:29 +0000 Subject: [PATCH] setup volatile redis --- TODO.md | 2 +- docker-compose.common.yml | 4 ++++ docker-compose.prod.yml | 5 +++-- docker-compose.yml | 6 +++--- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/TODO.md b/TODO.md index f99181c1..10f1bae0 100644 --- a/TODO.md +++ b/TODO.md @@ -75,6 +75,7 @@ - [x] drop redis-cell in favor of a simpler (and faster) implementation. - redis-cell was giving me weird errors and it isn't worth debugging it right now. - [x] create user script should allow setting the api key +- [x] disable redis persistence in dev - [x] attach a request id to every web request - [x] attach user id (not IP!) to each request - [x] fantom_1 | 2022-08-10T22:19:43.522465Z WARN web3_proxy::jsonrpc: forwarding error err=missing field `jsonrpc` at line 1 column 60 @@ -253,7 +254,6 @@ in another repo: event subscriber eth_1 | 2022-08-10T23:26:08.917603Z WARN web3_proxy::connections: chain is forked! 262 possible heads. 1/2/5/5 rpcs have 0x0538…bfff eth_1 | 2022-08-10T23:26:10.195014Z WARN web3_proxy::connections: chain is forked! 262 possible heads. 1/2/5/5 rpcs have 0x0538…bfff eth_1 | 2022-08-10T23:26:10.195658Z WARN web3_proxy::connections: chain is forked! 262 possible heads. 2/3/5/5 rpcs have 0x0538…bfff -- [x] disable redis persistence in dev - [ ] fix ip detection when running in dev - [ ] cache api keys that are not in the database? - [ ] double check weight sorting code diff --git a/docker-compose.common.yml b/docker-compose.common.yml index 610f9982..9799d260 100644 --- a/docker-compose.common.yml +++ b/docker-compose.common.yml @@ -7,3 +7,7 @@ services: environment: #RUST_LOG: "info,web3_proxy=debug" RUST_LOG: info + + volatile_redis: + image: redis + command: [ "redis-server", "--save", "", "--appendonly", "no" ] diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 735e143d..db2ab7f4 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -3,9 +3,10 @@ version: "3.4" services: - # TODO: configure persistence? its just caches, but cold caches can be slow redis: - build: ./redis-cell-server/ + extends: + file: docker-compose.common.yml + service: volatile_redis db: image: mysql diff --git a/docker-compose.yml b/docker-compose.yml index 1cf22e07..2395e628 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,11 +4,11 @@ version: "3.4" services: dev-redis: - image: redis - command: [ "redis-server", "--save", "", "--appendonly", "no" ] + extends: + file: docker-compose.common.yml + service: volatile_redis ports: - 127.0.0.1:16379:6379 - # TODO: expose these ports? dev-db: image: mysql