-
Notifications
You must be signed in to change notification settings - Fork 0
/
prelim.yaml
241 lines (223 loc) · 7.16 KB
/
prelim.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
substitutions:
_ACCOUNT_PASSWORD: "password"
_ETH_NETWORK_ID: "7777"
_ACCOUNTS_TO_CREATE: "10" # should be same as num. nodes
_BA_PARAMETER: "5"
_GAS_LIMIT: 52000000
_GAS_TARGET: 47000000
_TPS: 200 # per node, pick sufficiently high rate for saturation
_TX_SIZE: 3200
_CONCURRENT_NONCES: 4000 # don't set too high to ensure steady tx saturation (must be less than Geth's `--txpool.accountslots`).
_TOTAL_BLOCKS: 3000
services:
- name: geth
image: "ethereum/client-go:alltools-latest"
volumes:
- path: /accounts/
name: accounts
scope: singleton
script:
inline: >
mkdir -p /geth/keystore;
cp /accounts/keystore/* /geth/keystore;
cp /accounts/static-nodes${INDEX}.json /geth/static-nodes.json;
echo $_ACCOUNT_PASSWORD > /geth/pw.txt;
geth --nousb --datadir /geth/ init /accounts/genesis.json;
geth --networkid $_ETH_NETWORK_ID
--datadir /geth/
--http
--http.addr 0.0.0.0
--miner.gasprice=${MINER_GASPRICE}
--miner.gaslimit=$_GAS_LIMIT
--miner.gastarget=$_GAS_TARGET
--http.api "admin,web3,eth,net,personal,miner,txpool"
--http.corsdomain "0.0.0.0"
--txpool.nolocals
--http.vhosts=*
--verbosity=5
--port 30303
--nousb
--miner.etherbase $(cat /accounts/address${INDEX})
--unlock $(cat /accounts/address${INDEX})
--allow-insecure-unlock
--password /geth/pw.txt
--mine
--miner.threads=${MINER_THREADS}
--nodekeyhex $(cat /accounts/priv$INDEX)
--nodiscover
--txpool.accountslots 5500
environment:
MINER_GASPRICE: "1"
MINER_THREADS: "1"
resources:
cpus: 3
memory: 8 GB
storage: 40 GiB
- name: record
image: gcr.io/whiteblock/helpers/ethereum/record:master
script:
inline:
app --target http://$GETH_SERVICE0_COMMON_NETWORK:8545
resources:
memory: 1 GiB
- name: tps-logger
image: gcr.io/whiteblock/helpers/ethereum/tps-logger:master
script:
inline: tps-logger --node $GETH_SERVICE0_COMMON_NETWORK:8545 --record $RECORD_SERVICE0_COMMON_NETWORK:8080 --listen 0.0.0.0:17777
resources:
memory: 1 GiB
- name: eth-viewer
image: gcr.io/whiteblock/helpers/ethereum/viewer:latest
script:
inline: viewer --node $GETH_SERVICE0_COMMON_NETWORK:8545 --listen 0.0.0.0:16555
resources:
memory: 1 GiB
sidecars:
- name: tx-generator
sidecar-to:
- geth
volumes:
- path: /accounts/
name: accounts
scope: singleton
image: gcr.io/whiteblock/helpers/ethereum/tx:ef
script:
# recvAddrs${INDEX}.json will be comma separated addresses with 0x prefix
inline: >
cat /accounts/accounts.json
| jq --arg i "${INDEX}" 'del(.[$i | tonumber]) | map(.address) | join(",")'
> /accounts/recvAddrs${INDEX}.json;
privkey=$(cat /accounts/accounts.json | jq --arg i "${INDEX}" '.[$i | tonumber].privateKey');
tx --chain-id $_ETH_NETWORK_ID
--tps $_TPS
--target $SERVICE:8545
--private-key ${privkey}
--gas-limit ${TX_GAS_LIMIT}
--tx-size $_TX_SIZE
--gas-price ${TX_GAS_PRICE}
--destination $(cat /accounts/recvAddrs${INDEX}.json)
--concurrent-nonces $_CONCURRENT_NONCES
environment:
TX_GAS_PRICE: "4000000"
TX_GAS_LIMIT: "5000000"
resources:
cpus: 2
memory: 3 GB
task-runners:
- name: generate-accounts
image: "gcr.io/whiteblock/helpers/ethereum/accounts:master"
script:
inline: accounts generate -c $_ACCOUNTS_TO_CREATE -e -d /accounts
volumes:
- path: /accounts/
name: accounts
scope: singleton
resources:
memory: 2 GB
- name: generate-genesis
image: gcr.io/whiteblock/helpers/ethereum/genesis:master
volumes:
- path: /accounts/
name: accounts
scope: singleton
script:
inline: genesis generate -a /accounts/accounts.json -o consensus=ethash -o gasLimit=$_GAS_LIMIT -o difficulty=600000 | tee /accounts/genesis.json
resources:
memory: 2 GB
- name: generate-static-peers
image: gcr.io/whiteblock/helpers/ethereum/static-peers:master
volumes:
- path: /accounts/
name: accounts
scope: singleton
script:
inline: generate --accounts-file /accounts/accounts.json --network common-network --service geth | tee /accounts/static-nodes.json
- name: generate-topology
image: gcr.io/whiteblock/helpers/ethereum/topology:master
volumes:
- path: /accounts/
name: accounts
scope: singleton
script:
inline: python generate.py /accounts/static-nodes.json /accounts/ $_ACCOUNTS_TO_CREATE $_BA_PARAMETER 54321 10
- name: generate-keystore
image: gcr.io/whiteblock/helpers/geth/keystore:master
volumes:
- path: /accounts/
name: accounts
scope: singleton
script:
inline: >
echo $_ACCOUNT_PASSWORD > /tmp/pw.txt;
keystore -p /tmp/pw.txt -f /accounts/accounts.json -o /accounts/keystore/
resources:
cpus: 2
memory: 2 GB
- name: await-block-production
image: gcr.io/whiteblock/helpers/ethereum/await-blocks:master
script:
inline: await --target $GETH_SERVICE0_COMMON_NETWORK:8545
resources:
memory: 1 GB
- name: await-blocks-$_TOTAL_BLOCKS
image: gcr.io/whiteblock/helpers/ethereum/await-blocks:master
script:
inline: await --target $GETH_SERVICE0_COMMON_NETWORK:8545 --block $_TOTAL_BLOCKS
resources:
memory: 1 GB
tests:
- name: geth_demo
phases:
- name: generating-accounts
tasks:
- type: generate-accounts
- name: creating-keystore-genesis-static-peers
tasks:
- type: generate-genesis
- type: generate-keystore
- type: generate-static-peers
- name: setup-topology
tasks:
- type: generate-topology
- name: starting-geth-nodes
system:
- type: geth
count: 10 # <---------------------------------------------
resources:
networks:
- name: common-network
bandwidth: 100 Mbit
- name: awaiting-block-production
tasks:
- type: await-block-production
timeout: 30m
networks:
- name: common-network
- name: starting-stats-tools
system:
- type: record
port-mappings:
- "8080:8080"
resources:
networks:
- name: common-network
- name: start-custom-viewers
system:
- type: tps-logger
port-mappings:
- "17777:17777"
resources:
networks:
- name: common-network
- type: eth-viewer
port-mappings:
- "16555:16555"
resources:
networks:
- name: common-network
- name: waiting-for-block-$_TOTAL_BLOCKS
tasks:
- type: await-blocks-$_TOTAL_BLOCKS
timeout: 120m
networks:
- name: common-network