Skip to content

Commit

Permalink
update erpc config (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 authored Feb 3, 2025
1 parent 9aa11e6 commit ffe1d13
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion roles/generate_kubernetes_config/templates/erpc.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,40 @@ erpc:

database:
evmJsonRpcCache:
driver: memory
connectors:
- id: memory-cache
driver: memory # Refer to "memory" driver docs below
memory:
maxItems: 100000
policies:
# Cache all methods with finalized data including empty responses
- network: "*"
method: "*"
finality: finalized
empty: allow
connector: memory-cache
ttl: 0
# Cache unfinalized data only for 5 seconds (getLogs of a recent block) except empty responses
- network: "*"
method: "*"
finality: unfinalized
empty: ignore
connector: memory-cache
ttl: 5s
# Cache unknown finalization data (eth_trace*) only for 10 seconds
- network: "*"
method: "*"
finality: unknown
empty: ignore
connector: memory-cache
ttl: 10s
# Cache realtime data only for 2 seconds (eth_blockNumber, eth_gasPrice, etc) to reduce costs yet fresh enough data
- network: "*"
method: "*"
finality: realtime
empty: ignore
connector: memory-cache
ttl: 2s

server:
httpHostV4: "0.0.0.0"
Expand All @@ -50,6 +83,15 @@ erpc:

projects:
- id: main
cors:
allowedOrigins:
- "https://*.ethpandaops.io"
allowedMethods:
- "GET"
- "POST"
- "OPTIONS"
allowedHeaders:
- "Content-Type"
upstreamDefaults:
allowMethods:
- "eth_blockNumber"
Expand Down

0 comments on commit ffe1d13

Please sign in to comment.