forked from kkrt-labs/kakarot-rpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
246 lines (233 loc) · 7.54 KB
/
docker-compose.yaml
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
services:
anvil:
platform: linux/amd64
image: ghcr.io/foundry-rs/foundry:latest
command:
[anvil --host 0.0.0.0 --port 8545 --load-state /app/.anvil/state.json]
# Initial state has the StarknetMessaging and L1KakarotMessaging contracts deployed
volumes:
- .anvil:/app/.anvil
ports:
- 8545:8545
networks:
- internal
restart: on-failure
starknet:
image: ghcr.io/dojoengine/dojo:v1.0.0-alpha.14
command:
- katana
- --disable-fee
- --validate-max-steps
- "16777216"
- --invoke-max-steps
- "16777216"
- --eth-gas-price
- "0"
- --strk-gas-price
- "0"
- --chain-id
- KKRT
- --messaging
- /app/.katana/messaging_config.json
# Config uses StarknetMessaging contract Anvil is instanciated with
volumes:
- .katana:/app/.katana
ports:
- 5050:5050
networks:
- internal
restart: on-failure
kakarot-deployer:
image: ghcr.io/kkrt-labs/kakarot/deployer:v0.8.5
# Always pull the latest image, until we use release tags
pull_policy: always
environment:
# Pre-funded Katana accounts
- ACCOUNT_ADDRESS=0xb3ff441a68610b30fd5e2abbf3a1548eb6ba6f3559f2862bf2dc757e5828ca
- PRIVATE_KEY=0x2bbf4f9fd0bbb2e60b0316c1fe0b76cf7a4d0198bd493ced9b8df2a3a24d68a
# EVM Private key of the Anvil default Account (address 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266)
- EVM_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
- KATANA_RPC_URL=http://starknet:5050
- STARKNET_NETWORK=katana
volumes:
# Since STARKNET_NETWORK is set to katana, the deployments json files will be saved with katana network folder
- deployments:/app/kakarot/deployments
depends_on:
starknet:
condition: service_started
restart: on-failure
networks:
- internal
deployments-parser:
image: apteno/alpine-jq:2023-07-24
# Parse deployments and save the result to .env file
entrypoint:
- /bin/sh
- -c
# First line overrides an existing .env, if any.
# This is to make sure that it is clean even though docker volume was not cleaned.
- |
echo "KAKAROT_ADDRESS=$$(jq -r '.kakarot.address' /deployments/katana/deployments.json)" > /deployments/.env;
echo "DEPLOYER_ACCOUNT_ADDRESS=$$(jq -r '.deployer_account.address' /deployments/katana/deployments.json)" >> /deployments/.env;
echo "UNINITIALIZED_ACCOUNT_CLASS_HASH=$$(jq -r '.uninitialized_account' /deployments/katana/declarations.json)" >> /deployments/.env
echo "ACCOUNT_CONTRACT_CLASS_HASH=$$(jq -r '.account_contract' /deployments/katana/declarations.json)" >> /deployments/.env
volumes:
- deployments:/deployments
depends_on:
kakarot-deployer:
condition: service_completed_successfully
postgres:
image: postgres:13
environment:
POSTGRES_USER: blockscout
POSTGRES_PASSWORD: postgres
POSTGRES_DB: blockscout
networks:
- internal
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:6
command: redis-server --save 60 1 --loglevel warning
networks:
- internal
volumes:
- redis_data:/data
blockscout:
image: blockscout/blockscout:latest
environment:
DATABASE_URL: postgres://blockscout:postgres@postgres:5432/blockscout
DATABASE_SSL: "false"
DATABASE_POOL_SIZE: 10
DATABASE_TIMEOUT: 5000
ECTO_USE_SSL: "false"
BLOCKSCOUT_HOST: 0.0.0.0
PORT: 4000
APP_NAME: Blockscout
ETHEREUM_JSONRPC_VARIANT: geth
ETHEREUM_JSONRPC_HTTP_URL: http://kakarot-rpc:3030
ETHEREUM_JSONRPC_TRACE_URL: http://kakarot-rpc:3030
ports:
- 4000:4000
networks:
- internal
command:
[
/bin/sh,
-c,
bin/blockscout eval "Elixir.Explorer.ReleaseTasks.create_and_migrate()
&& bin/blockscout start,
]
depends_on:
- postgres
- redis
kakarot-rpc:
image: ghcr.io/kkrt-labs/kakarot-rpc/node:v0.6.20
ports:
- 3030:3030
environment:
- KAKAROT_RPC_URL=0.0.0.0:3030
- STARKNET_NETWORK=http://starknet:5050
- RUST_LOG=kakarot_rpc=info
- MONGO_CONNECTION_STRING=mongodb://mongo:mongo@mongo:27017
- MONGO_DATABASE_NAME=kakarot-local
- MAX_FELTS_IN_CALLDATA=30000
- MAX_LOGS=10000
- WHITE_LISTED_EIP_155_TRANSACTION_HASHES=0xeddf9e61fb9d8f5111840daef55e5fde0041f5702856532cdbb5a02998033d26,0xb6274b80bc7cda162df89894c7748a5cb7ba2eaa6004183c41a1837c3b072f1e,0x07471adfe8f4ec553c1199f495be97fc8be8e0626ae307281c22534460184ed1,0xb95343413e459a0f97461812111254163ae53467855c0d73e0f1e7c5b8442fa3
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel:4317
- RELAYER_PRIVATE_KEY=0x2bbf4f9fd0bbb2e60b0316c1fe0b76cf7a4d0198bd493ced9b8df2a3a24d68a
- RELAYERS_ADDRESSES=0xb3ff441a68610b30fd5e2abbf3a1548eb6ba6f3559f2862bf2dc757e5828ca
volumes:
# Mount the volume on workdir and use .env stored in root of the volume
- deployments:/usr/src/app
# Mount the indexer code
- indexer_code:/usr/src/indexer
depends_on:
deployments-parser:
condition: service_completed_successfully
restart: on-failure
networks:
- internal
apibara-dna:
image: quay.io/apibara/starknet:1.5.0
command:
- start
- --rpc=http://starknet:5050
- --wait-for-rpc
- --data=/data
- --head-refresh-interval-ms=500
ports:
- 7171:7171
volumes:
- apibara:/data
networks:
- internal
restart: on-failure
### MongoDB with Mongo Express
mongo:
image: mongo:6.0.8
restart: always
ports:
- 27017:27017
volumes:
- mongo_data:/data/db
networks:
- internal
environment:
MONGO_INITDB_ROOT_USERNAME: mongo
MONGO_INITDB_ROOT_PASSWORD: mongo
indexer:
image: quay.io/apibara/sink-mongo:0.9.2
command:
- run
- /indexer/src/main.ts
environment:
# Whitelist environment variables
- ALLOW_ENV_FROM_ENV=DEBUG,APIBARA_AUTH_TOKEN,STARTING_BLOCK,STREAM_URL,SINK_TYPE,MONGO_CONNECTION_STRING,MONGO_DATABASE_NAME,STARKNET_NETWORK,KAKAROT_ADDRESS,ALLOW_NET,MONGO_REPLACE_DATA_INSIDE_TRANSACTION,DEFAULT_BLOCK_GAS_LIMIT
- DEBUG=""
- APIBARA_AUTH_TOKEN=""
- MONGO_CONNECTION_STRING=mongodb://mongo:mongo@mongo:27017
- MONGO_DATABASE_NAME=kakarot-local
- STARTING_BLOCK=0
- STREAM_URL=http://apibara-dna:7171
- SINK_TYPE=mongo
- STARKNET_NETWORK=http://starknet:5050
- ALLOW_NET=
- MONGO_REPLACE_DATA_INSIDE_TRANSACTION=false
- ALLOW_ENV=/deployments/.env
- DEFAULT_BLOCK_GAS_LIMIT=7000000
restart: on-failure
volumes:
- indexer_code:/indexer
- deployments:/deployments
networks:
- internal
depends_on:
starknet:
condition: service_started
deployments-parser:
condition: service_completed_successfully
otel:
image: otel/opentelemetry-collector-contrib
volumes:
- ./otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
ports:
- 1888:1888 # pprof extension
- 8888:8888 # Prometheus metrics exposed by the Collector
- 8889:8889 # Prometheus exporter metrics
- 13133:13133 # health_check extension
- 4317:4317 # OTLP gRPC receiver
- 4318:4318 # OTLP http receiver
- 55679:55679 # zpages extension
networks:
- internal
networks:
internal:
driver: bridge
volumes:
deployments:
apibara:
mongo_data:
indexer_code:
postgres_data:
redis_data: