-
Notifications
You must be signed in to change notification settings - Fork 0
/
.env
162 lines (150 loc) · 7.37 KB
/
.env
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
##### Local development config
# Values used by make
CONTAINER_NAME=kava-proxy-service
IMAGE_NAME=kava-labs/kava-proxy-service
LOCAL_IMAGE_TAG=local
PRODUCTION_IMAGE_TAG=latest
# Values used by docker
# what version of kava is installed in the development version of the proxy service image
PROXY_KAVA_CLI_VERSION=v0.21.0
# Values used by docker-compose
POSTGRES_CONTAINER_PORT=5432
POSTGRES_HOST_PORT=5432
REDIS_CONTAINER_PORT=6379
REDIS_HOST_PORT=6379
KAVA_CONTAINER_TAG=v0.24.0
KAVA_CONTAINER_EVM_RPC_PORT=8545
KAVA_CONTAINER_COSMOS_RPC_PORT=26657
KAVA_HOST_EVM_RPC_PORT=8545
KAVA_HOST_COSMOS_RPC_PORT=26657
KAVA_PRUNING_HOST_EVM_RPC_PORT=8555
KAVA_PRUNING_HOST_COSMOS_RPC_PORT=26667
PROXY_CONTAINER_PORT=7777
PROXY_CONTAINER_EVM_RPC_PRUNING_PORT=7778
PROXY_HOST_PORT=7777
PROXY_CONTAINER_DEBUG_PORT=2345
PROXY_HOST_DEBUG_PORT=2345
##### E2E Testing Config
TEST_UNCONFIGURED_PROXY_PORT=7779
TEST_UNCONFIGURED_PROXY_URL=http://localhost:7779
TEST_PROXY_SERVICE_EVM_RPC_URL=http://localhost:7777
TEST_PROXY_SERVICE_EVM_RPC_HOSTNAME=localhost:7777
TEST_PROXY_SERVICE_EVM_RPC_PRUNING_URL=http://localhost:7778
TEST_PROXY_BACKEND_EVM_RPC_HOST_URL=http://localhost:8545
TEST_DATABASE_ENDPOINT_URL=localhost:5432
TEST_PROXY_BACKEND_HOST_URL_MAP=localhost:7777>http://kava-validator:8545,localhost:7778>http://kava-pruning:8545
TEST_PROXY_HEIGHT_BASED_ROUTING_ENABLED=true
TEST_PROXY_PRUNING_BACKEND_HOST_URL_MAP=localhost:7777>http://kava-pruning:8545,localhost:7778>http://kava-pruning:8545
TEST_PROXY_SHARD_BACKEND_HOST_URL_MAP=localhost:7777>10|http://kava-shard-10:8545|20|http://kava-shard-20:8545
# What level of logging to use for service objects constructed during
# unit tests
TEST_SERVICE_LOG_LEVEL=ERROR
# endpoint the proxy service should use for querying
# evm blockchain information related to proxied requests
TEST_EVM_QUERY_SERVICE_URL=http://kava-validator:8545
# TEST_REDIS_ENDPOINT_URL is an url of redis
TEST_REDIS_ENDPOINT_URL=localhost:6379
# tests for metrics look for metrics created within a given window of time.
# TEST_EXTEND_METRIC_WINDOW_MS allows extending that window which is useful
# for when tests fail because the metrics hadn't finished being created in the window.
TEST_EXTEND_METRIC_WINDOW_MS=100
##### Kava Node Config
##### Kava Proxy Config
# What port the proxy service listens on
PROXY_SERVICE_PORT=7777
LOG_LEVEL=DEBUG
HTTP_READ_TIMEOUT_SECONDS=30
HTTP_WRITE_TIMEOUT_SECONDS=60
# Address of the origin server to proxy all requests to
PROXY_BACKEND_HOST_URL_MAP=localhost:7777>http://kava-validator:8545,localhost:7778>http://kava-pruning:8545
# height-based routing will look at the height of an incoming EVM request
# iff. the height is "latest", it routes to the corresponding PROXY_PRUNING_BACKEND_HOST_URL_MAP value
# otherwise, it falls back to the value in PROXY_BACKEND_HOST_URL_MAP
PROXY_HEIGHT_BASED_ROUTING_ENABLED=true
PROXY_PRUNING_BACKEND_HOST_URL_MAP=localhost:7777>http://kava-pruning:8545,localhost:7778>http://kava-pruning:8545
# enable shard routing for hosts defined in PROXY_SHARD_BACKEND_HOST_URL_MAP
PROXY_SHARDED_ROUTING_ENABLED=true
PROXY_SHARD_BACKEND_HOST_URL_MAP=localhost:7777>10|http://kava-shard-10:8545|20|http://kava-shard-20:8545
# PROXY_MAXIMUM_REQ_BATCH_SIZE is a proxy-enforced limit on the number of subrequest in a batch
PROXY_MAXIMUM_REQ_BATCH_SIZE=100
# Configuration for the service to connect to it's database
DATABASE_NAME=postgres
DATABASE_ENDPOINT_URL=postgres:5432
DATABASE_USERNAME=postgres
DATABASE_PASSWORD=password
DATABASE_SSL_ENABLED=false
DATABASE_READ_TIMEOUT_SECONDS=60
DATABASE_WRITE_TIMEOUT_SECONDS=30
DATABASE_MAX_IDLE_CONNECTIONS=5
DATABASE_CONNECTION_MAX_IDLE_SECONDS=5
DATABASE_MAX_OPEN_CONNECTIONS=20
# controls whether the service will attempt to run migrations when it starts
RUN_DATABASE_MIGRATIONS=true
DATABASE_QUERY_LOGGING_ENABLED=true
# How often the metric compaction routine will run
# defaults to 3600 / 1 hour if not set
METRIC_COMPACTION_ROUTINE_INTERVAL_SECONDS=5
# endpoint the proxy service should use for querying
# evm blockchain information related to proxied requests
EVM_QUERY_SERVICE_URL=http://kava-validator:8545
# Whether the proxy service should attempt to track and store metrics
# related to proxied requests
METRIC_COLLECTION_ENABLED=true
# How often the metric partitioning routine will run
# defaults to 86400 / 24 hours if not set
METRIC_PARTITIONING_ROUTINE_INTERVAL_SECONDS=60
# how long (after the proxy service starts) it will wait
# to run the first iteration of the metric partitioning routine
METRIC_PARTITIONING_ROUTINE_DELAY_FIRST_RUN_SECONDS=10
# How many days (starting from the time the routine runs)
# of partions should be created (idempotently)
# defaults to 7 days / 1 week if not set,
# max value of 28, min value of 1
METRIC_PARTITIONINING_PREFILL_PERIOD_DAYS=7
# Used by `ready` script to ensure metric partitions have been created.
MINIMUM_REQUIRED_PARTITIONS=30
# Whether metric pruning routines should run on the configured interval, defaults to true
METRIC_PRUNING_ENABLED=true
# How frequenlty metric pruning routines should run
# defaults to 1 day
METRIC_PRUNING_ROUTINE_INTERVAL_SECONDS=10
# how long (after the proxy service starts) it will wait
# to run the first iteration of the metric pruning routine
METRIC_PRUNING_ROUTINE_DELAY_FIRST_RUN_SECONDS=5
# The maximum number of days of request metrics
# that should be preserved measured
# from the time the pruning routine runs
# all metrics for earlier days will be truncated
METRIC_PRUNING_MAX_REQUEST_METRICS_HISTORY_DAYS=45
# CACHE_ENABLED specifies if cache should be enabled. By default cache is disabled.
CACHE_ENABLED=true
# REDIS_ENDPOINT_URL is an url of redis
REDIS_ENDPOINT_URL=redis:6379
REDIS_PASSWORD=
# CACHE_<group-name>_TTL_SECONDS is a TTL for cached evm requests
# CACHE_<group-name>_TTL_SECONDS should be specified in seconds
# <group-name> refers to group of evm methods, different groups may have different TTLs
# CACHE_<group-name>_TTL_SECONDS should be either greater than zero or equal to -1, -1 means cache indefinitely
CACHE_METHOD_HAS_BLOCK_NUMBER_PARAM_TTL_SECONDS=600
CACHE_METHOD_HAS_BLOCK_HASH_PARAM_TTL_SECONDS=600
CACHE_STATIC_METHOD_TTL_SECONDS=600
CACHE_METHOD_HAS_TX_HASH_PARAM_TTL_SECONDS=600
# CACHE_PREFIX is used as prefix for any key in the cache, key has such structure:
# <cache_prefix>:evm-request:<method_name>:sha256:<sha256(body)>
# Possible values are testnet, mainnet, etc...
# CACHE_PREFIX must not contain colon symbol
CACHE_PREFIX=local-chain
# WHITELISTED_HEADERS contains comma-separated list of headers which has to be cached along with EVM JSON-RPC response
WHITELISTED_HEADERS=Vary,Access-Control-Expose-Headers,Access-Control-Allow-Origin,Access-Control-Allow-Methods,Access-Control-Allow-Headers,Access-Control-Allow-Credentials,Access-Control-Max-Age
# DEFAULT_ACCESS_CONTROL_ALLOW_ORIGIN_VALUE contains default value for Access-Control-Allow-Origin header.
# NOTE: it will be used only in Cache Hit scenario.
DEFAULT_ACCESS_CONTROL_ALLOW_ORIGIN_VALUE="*"
# Map contains mapping between hostname (for ex. evm.kava.io) and corresponding value for Access-Control-Allow-Origin header.
# If hostname for specific request is missing we fallback to DEFAULT_ACCESS_CONTROL_ALLOW_ORIGIN_VALUE.
# NOTE: it will be used only in Cache Hit scenario.
HOSTNAME_TO_ACCESS_CONTROL_ALLOW_ORIGIN_VALUE_MAP=
##### Database Config
POSTGRES_PASSWORD=password
##### Redis Config
# for local development don't require a password to connect to the redis server
ALLOW_EMPTY_PASSWORD=yes