-
Notifications
You must be signed in to change notification settings - Fork 155
684 lines (597 loc) · 24.3 KB
/
ci.yml
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
name: CI
on:
pull_request:
paths-ignore:
- '**.md'
push:
branches:
- master
- main
- develop
paths-ignore:
- '**.md'
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
MC_TELEMETRY: 0
permissions:
checks: write
jobs:
build-dev:
runs-on: [self-hosted, Linux, large]
container: mobilecoin/builder-install:v0.0.30
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Rust
uses: ./.github/actions/setup-rust
- name: Cargo build (SW)
uses: actions-rs/cargo@v1
with:
command: build
# This build dies with linker OOM, so limit the number of concurrent jobs.
args: --locked -j 4
- name: Check dirty git
uses: ./.github/actions/check-dirty-git
build-prod:
runs-on: [self-hosted, Linux, large]
container: mobilecoin/builder-install:v0.0.30
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Rust
uses: ./.github/actions/setup-rust
- name: Cargo build (HW)
env:
SGX_MODE: HW
uses: actions-rs/cargo@v1
with:
command: build
# This build dies with linker OOM, so limit the number of concurrent jobs.
args: --locked -j 4
- name: Check dirty git
uses: ./.github/actions/check-dirty-git
build-and-test-wasm:
runs-on: [self-hosted, Linux, large]
container: mobilecoin/builder-install:v0.0.30
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build and test the wasm-test crate
env:
SGX_MODE: HW
run: wasm-pack test --node wasm-test
lint-rust:
runs-on: [self-hosted, Linux, large]
container: mobilecoin/builder-install:v0.0.30
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
components: rustfmt, clippy
- name: Run lint script
run: ./tools/lint.sh --check
- name: Check dirty git
uses: ./.github/actions/check-dirty-git
build-and-test-go:
runs-on: [self-hosted, Linux, large]
container: mobilecoin/builder-install:v0.0.30
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
cache-dependency-path: go-grpc-gateway/go.sum
go-version-file: go-grpc-gateway/go.mod
- name: Build go
working-directory: go-grpc-gateway
run: ./install_tools.sh && ./build.sh
- name: Check dirty git
uses: ./.github/actions/check-dirty-git
- name: Lint Go code
working-directory: go-grpc-gateway
run: ./lint.sh
- name: Check dirty git
uses: ./.github/actions/check-dirty-git
- name: Build rust testing stub
working-directory: go-grpc-gateway/testing
env:
SGX_MODE: SW
run: cargo build --locked
- name: Run curl test
working-directory: go-grpc-gateway
run: ./test.sh
- name: Check dirty git
uses: ./.github/actions/check-dirty-git
docs:
runs-on: [self-hosted, Linux, large]
container: mobilecoin/builder-install:v0.0.30
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Rust
uses: ./.github/actions/setup-rust
- name: Generate docs
run: cargo doc --no-deps && tar -C target -czvf /tmp/doc.tgz doc/
- name: Store docs
uses: actions/upload-artifact@v3
with:
name: doc.tgz
path: /tmp/doc.tgz
- name: Check dirty git
uses: ./.github/actions/check-dirty-git
mc-tests:
runs-on: [self-hosted, Linux, large]
container: mobilecoin/builder-install:v0.0.30
strategy:
matrix:
num_runners: [2]
runner_index: [1, 2]
# Run each shard to completion.
fail-fast: false
env:
NUM_RUNNERS: ${{ matrix.num_runners }}
RUNNER_INDEX: ${{ matrix.runner_index }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Rust
uses: ./.github/actions/setup-rust
- name: List packages to test
run: |
cargo metadata --no-deps --format-version=1 | jq -r '.packages[].name' | \
grep -v -e mc-fog -e mc-consensus | \
awk "{ print \"-p \" \$1 }" | \
sort > /tmp/test-packages
split -n "l/$RUNNER_INDEX/$NUM_RUNNERS" /tmp/test-packages | \
tee /tmp/mc-test-packages
# Hack: mc-util-sample-ledger needs mc-util-keyfile bins.
# TODO: Replace with artifact deps when that does not require
# additional cargo flags.
if grep -q generate-sample-ledger /tmp/mc-test-packages
then
echo '-p mc-util-keyfile' >> /tmp/mc-test-packages
fi
- name: Run tests
uses: ./.github/actions/run-mc-tests
with:
args: $(cat /tmp/mc-test-packages)
junit_xml_filename: junit-mc-tests-${{matrix.runner_index}}.xml
consensus-tests:
runs-on: [self-hosted, Linux, large]
container: mobilecoin/builder-install:v0.0.30
strategy:
matrix:
num_runners: [2]
runner_index: [1, 2]
# Run each shard to completion.
fail-fast: false
env:
NUM_RUNNERS: ${{ matrix.num_runners }}
RUNNER_INDEX: ${{ matrix.runner_index }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Rust
uses: ./.github/actions/setup-rust
- name: List packages to test
run: |
cargo metadata --no-deps --format-version=1 | jq -r '.packages[].name' | \
awk "/mc-consensus/ { print \"-p \" \$1 }" | \
sort > /tmp/test-packages
split -n "l/$RUNNER_INDEX/$NUM_RUNNERS" /tmp/test-packages | \
tee /tmp/consensus-test-packages
- name: Run tests
uses: ./.github/actions/run-mc-tests
with:
args: $(cat /tmp/consensus-test-packages)
junit_xml_filename: junit-consensus-tests-${{matrix.runner_index}}.xml
fog-tests:
runs-on: [self-hosted, Linux, large]
container: mobilecoin/builder-install:v0.0.30
strategy:
matrix:
num_runners: [2]
runner_index: [1, 2]
# Run each shard to completion.
fail-fast: false
env:
NUM_RUNNERS: ${{ matrix.num_runners }}
RUNNER_INDEX: ${{ matrix.runner_index }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Rust
uses: ./.github/actions/setup-rust
- name: List packages to test
run: |
cargo metadata --no-deps --format-version=1 | jq -r '.packages[].name' | \
awk "/mc-fog/ { print \"-p \" \$1 }" | \
grep -v mc-fog-ingest | \
sort > /tmp/test-packages
split -n "l/$RUNNER_INDEX/$NUM_RUNNERS" /tmp/test-packages | \
tee /tmp/fog-test-packages
# Hack: mc-fog-distribution needs bins from
# mc-util-{keyfile,generate-sample-ledger}.
# TODO: Replace with artifact deps when that does not require
# additional cargo flags.
if grep -q fog-distribution /tmp/fog-test-packages
then
echo '-p mc-util-keyfile -p mc-util-generate-sample-ledger' >> /tmp/fog-test-packages
fi
- name: Start postgres
run: service postgresql start
- name: Run tests
uses: ./.github/actions/run-mc-tests
with:
# The fog-overseer tests are large and sometimes fail to build;
# limiting the number of build-jobs helps with that.
args: $(cat /tmp/fog-test-packages) --build-jobs 4
junit_xml_filename: junit-fog-tests-${{matrix.runner_index}}.xml
env:
# TEST_DATABASE_URL points at the server, as Fog recovery DB tests
# create and drop PG databases.
TEST_DATABASE_URL: postgres://localhost
fog-ingest-tests:
runs-on: [self-hosted, Linux, large]
container: mobilecoin/builder-install:v0.0.30
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Rust
uses: ./.github/actions/setup-rust
- name: Start postgres
run: service postgresql start
- name: Run tests
uses: ./.github/actions/run-mc-tests
with:
# These tests time out without release mode.
args: -p 'mc-fog-ingest-*' --release
junit_xml_filename: junit-fog-ingest-tests.xml
env:
# TEST_DATABASE_URL points at the server, as Fog recovery DB tests
# create and drop PG databases.
TEST_DATABASE_URL: postgres://localhost
fog-conformance-tests:
runs-on: [self-hosted, Linux, large]
container: mobilecoin/builder-install:v0.0.30
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
# FIXME: This fails with Python 3.10: "AttributeError: module
# 'importlib' has no attribute 'abc'. Did you mean: '_abc'?"
python-version: '3.9'
- name: Setup Rust
uses: ./.github/actions/setup-rust
- name: Set up environment
working-directory: tools/fog-local-network
run: |
python3 -m venv env
. ./env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
./build.sh
service postgresql start
- name: fog_conformance_tests.py
working-directory: tools/fog-local-network
env:
# TEST_DATABASE_URL points at the server, as Fog recovery DB tests
# create and drop PG databases.
TEST_DATABASE_URL: postgres://localhost
run: |
. ./env/bin/activate
python3 fog_conformance_tests.py --release
- name: Upload core dumps
uses: ./.github/actions/upload-core-dumps
- name: Check dirty git
uses: ./.github/actions/check-dirty-git
fog-local-network-tests:
runs-on: [self-hosted, Linux, large]
container: mobilecoin/builder-install:v0.0.30
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3'
- name: Setup Rust
uses: ./.github/actions/setup-rust
- name: Build and generate sample data
run: |
# Generate enclave signing key
openssl genrsa -out Enclave_private.pem -3 3072
export CONSENSUS_ENCLAVE_PRIVKEY="$PWD/Enclave_private.pem"
export INGEST_ENCLAVE_PRIVKEY="$PWD/Enclave_private.pem"
export LEDGER_ENCLAVE_PRIVKEY="$PWD/Enclave_private.pem"
export VIEW_ENCLAVE_PRIVKEY="$PWD/Enclave_private.pem"
export MC_LOG=debug
# Build binaries
cargo build \
-p mc-admin-http-gateway \
-p mc-consensus-mint-client \
-p mc-consensus-service \
-p mc-consensus-tool \
-p mc-crypto-x509-test-vectors \
-p mc-fog-distribution \
-p mc-fog-ingest-client \
-p mc-fog-ingest-server \
-p mc-fog-ledger-server \
-p mc-fog-report-server \
-p mc-fog-sql-recovery-db \
-p mc-fog-test-client \
-p mc-fog-view-server \
-p mc-ledger-distribution \
-p mc-mobilecoind \
-p mc-mobilecoind-dev-faucet \
-p mc-util-generate-sample-ledger \
-p mc-util-grpc-admin-tool \
-p mc-util-keyfile \
-p mc-util-seeded-ed25519-key-gen \
--release
BIN_DIR="$PWD/target/release"
# Run in temp dir to appease check-dirty-git.
mkdir -p /tmp/fog-local-network
cd /tmp/fog-local-network
# Generate sample keys and ledger.
FOG_AUTHORITY_ROOT=$("$BIN_DIR/mc-crypto-x509-test-vectors" --type=chain --test-name=ok_rsa_head)
"$BIN_DIR/sample-keys" --num 10 --seed=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
"$BIN_DIR/generate-sample-ledger" --txs 100
# Generate sample Fog keys.
"$BIN_DIR/sample-keys" --num 4 --output-dir fog_keys --fog-report-url 'insecure-fog://localhost:6200' --fog-authority-root "$FOG_AUTHORITY_ROOT"
service postgresql start
- name: Run local network
env:
# TEST_DATABASE_URL points at the server, as Fog recovery DB tests
# create and drop PG databases.
TEST_DATABASE_URL: postgres://localhost
run: |
BIN_DIR="$PWD/target/release"
SCRIPT_DIR="$PWD/tools/fog-local-network"
export MC_CHAIN_ID="local"
export MC_LOG=info
# This is needed since we want to capture the output of mc-consensus-tool, and we can't have the
# logs getting in the way.
export MC_LOG_STDERR=1
cd /tmp/fog-local-network
export LEDGER_BASE="$PWD/ledger"
# Run local network in background.
MC_LOG="info,rustls=warn,hyper=warn,tokio_reactor=warn,mio=warn,want=warn,rusoto_core=error,h2=error,reqwest=error,rocket=error,<unknown>=error" \
python3 "$SCRIPT_DIR/fog_local_network.py" --network-type dense5 --skip-build &
# Give it time to spin up
for PORT in 3200 3201 3202 3203 3204 4444; do
for _unused in $(seq 0 60); do
if ss -l | grep -q ":$PORT"; then break; else sleep 1; fi;
done
done
# Save some typing
export MC_PEER="insecure-mc://localhost:3200/,insecure-mc://localhost:3201/,insecure-mc://localhost:3202/,insecure-mc://localhost:3203/,insecure-mc://localhost:3204/"
# Run fog-distribution client to exercise Fog
echo "Running fog distro"
"$BIN_DIR/fog-distribution" \
--sample-data-dir . \
--max-threads 1 \
--num-tx-to-send 10
# Give it time to quiet down
"$BIN_DIR/mc-consensus-tool" wait-for-quiet
# Run test-client
echo "Running test client"
"$BIN_DIR/test_client" \
--consensus insecure-mc://localhost:3200/ \
--consensus insecure-mc://localhost:3201/ \
--consensus insecure-mc://localhost:3202/ \
--consensus insecure-mc://localhost:3203/ \
--consensus insecure-mc://localhost:3204/ \
--num-clients 4 \
--num-transactions 40 \
--consensus-wait 300 \
--transfer-amount 20 \
--fog-view insecure-fog-view://localhost:8200 \
--fog-ledger insecure-fog-ledger://localhost:8200 \
--key-dir "$PWD/fog_keys"
PRE_AUTH_BLOCK_INDEX=$("$BIN_DIR/mc-consensus-tool" wait-for-quiet)
# Authorize minters
echo "Authorizing minters"
python3 "$SCRIPT_DIR/../local-network/authorize-minters.py"
PRE_MINT_BLOCK_INDEX=$("$BIN_DIR/mc-consensus-tool" wait-for-quiet --beyond-block="$PRE_AUTH_BLOCK_INDEX")
echo "Done waiting, PRE_MINT_BLOCK_INDEX=${PRE_MINT_BLOCK_INDEX}"
# Mint 1 million token1's to the first 4 fog accounts
echo "Minting"
for ACCOUNT_NUM in $(seq 0 3); do
"$BIN_DIR/mc-consensus-mint-client" \
"generate-and-submit-mint-tx" \
--node insecure-mc://localhost:3200/ \
--signing-key "$BIN_DIR/mc-local-network/minting-keys/minter1" \
--recipient "$(cat "fog_keys/account_keys_${ACCOUNT_NUM}.b58pub")" \
--fog-ingest-enclave-css "$BIN_DIR/ingest-enclave.css" \
--token-id 1 \
--amount 1000000
done
"$BIN_DIR/mc-consensus-tool" wait-for-quiet --beyond-block="$PRE_MINT_BLOCK_INDEX"
# Run test-client
echo "Running test client (tokens 0 and 1)"
"$BIN_DIR/test_client" \
--consensus insecure-mc://localhost:3200/ \
--consensus insecure-mc://localhost:3201/ \
--consensus insecure-mc://localhost:3202/ \
--consensus insecure-mc://localhost:3203/ \
--consensus insecure-mc://localhost:3204/ \
--num-clients 4 \
--num-transactions 40 \
--consensus-wait 300 \
--transfer-amount 20 \
--token-ids 0,1 \
--fog-view insecure-fog-view://localhost:8200 \
--fog-ledger insecure-fog-ledger://localhost:8200 \
--key-dir "$PWD/fog_keys"
# Run mobilecoind-dev-faucet
MC_LOG="info" \
"$BIN_DIR"/mobilecoind-dev-faucet \
--keyfile "$PWD/keys/account_keys_0.json" --activate --target-queue-depth 500 &
# Give it time to spin up
for _unused in $(seq 0 60); do
if ss -l | grep -q ":9090"; then break; else sleep 1; fi;
done
# Try hitting the faucet
curl -s localhost:9090/status
curl -s localhost:9090/ -d '{"b58_address": "5KBMnd8cs5zPsytGgZrjmQ8z9VJYThuh1B39pKzDERTfzm3sVGQxnZPC8JEWP69togpSPRz3e6pBsLzwnMjrXTbDqoRTQ8VF98sQu7LqjL5"}' -X POST
curl -s localhost:9090/ -d '{"b58_address": "5KBMnd8cs5zPsytGgZrjmQ8z9VJYThuh1B39pKzDERTfzm3sVGQxnZPC8JEWP69togpSPRz3e6pBsLzwnMjrXTbDqoRTQ8VF98sQu7LqjL5"}' -X POST
# Try triggering small slam twice and see that it doesn't get stuck
curl -s localhost:9090/slam -d '{"target_num_tx":500}' -X POST
"$BIN_DIR/mc-consensus-tool" wait-for-quiet
curl -s localhost:9090/slam -d '{"target_num_tx":500}' -X POST
- name: Upload core dumps
uses: ./.github/actions/upload-core-dumps
- name: Check dirty git
uses: ./.github/actions/check-dirty-git
minting-and-burning-tests:
runs-on: [self-hosted, Linux, large]
container: mobilecoin/builder-install:v0.0.30
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3'
- name: Setup Rust
uses: ./.github/actions/setup-rust
- name: Build and generate sample data
run: |
# Generate enclave signing key
openssl genrsa -out Enclave_private.pem -3 3072
export CONSENSUS_ENCLAVE_PRIVKEY="$PWD/Enclave_private.pem"
export INGEST_ENCLAVE_PRIVKEY="$PWD/Enclave_private.pem"
export LEDGER_ENCLAVE_PRIVKEY="$PWD/Enclave_private.pem"
export VIEW_ENCLAVE_PRIVKEY="$PWD/Enclave_private.pem"
export MC_LOG=debug
# Build binaries
cargo build \
-p mc-admin-http-gateway \
-p mc-consensus-mint-client \
-p mc-consensus-service \
-p mc-consensus-tool \
-p mc-crypto-x509-test-vectors \
-p mc-fog-distribution \
-p mc-fog-ingest-client \
-p mc-fog-ingest-server \
-p mc-fog-ledger-server \
-p mc-fog-report-server \
-p mc-fog-sql-recovery-db \
-p mc-fog-test-client \
-p mc-fog-view-server \
-p mc-ledger-distribution \
-p mc-mobilecoind \
-p mc-mobilecoind-dev-faucet \
-p mc-util-generate-sample-ledger \
-p mc-util-grpc-admin-tool \
-p mc-util-keyfile \
-p mc-util-seeded-ed25519-key-gen \
--release
BIN_DIR="$PWD/target/release"
# Run in temp dir to appease check-dirty-git.
mkdir -p /tmp/fog-local-network
cd /tmp/fog-local-network || exit 1
# Generate sample keys and ledger.
FOG_AUTHORITY_ROOT=$("$BIN_DIR/mc-crypto-x509-test-vectors" --type=chain --test-name=ok_rsa_head)
"$BIN_DIR/sample-keys" --num 10 --seed=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
"$BIN_DIR/generate-sample-ledger" --txs 100
# Generate sample Fog keys.
"$BIN_DIR/sample-keys" --num 4 --output-dir fog_keys --fog-report-url 'insecure-fog://localhost:6200' --fog-authority-root "$FOG_AUTHORITY_ROOT"
service postgresql start
- name: Run local network
env:
# TEST_DATABASE_URL points at the server, as Fog recovery DB tests
# create and drop PG databases.
TEST_DATABASE_URL: postgres://localhost
run: |
BIN_DIR="$PWD/target/release"
SCRIPT_DIR="$PWD/tools/fog-local-network"
STRATEGIES_DIR="$PWD/mobilecoind/strategies"
export MC_CHAIN_ID="local"
export MC_LOG=info
# This is needed since we want to capture the output of mc-consensus-tool, and we can't have the
# logs getting in the way.
export MC_LOG_STDERR=1
# Used by mc-consensus-tool
export MC_PEER="insecure-mc://localhost:3200/,insecure-mc://localhost:3201/,insecure-mc://localhost:3202/,insecure-mc://localhost:3203/,insecure-mc://localhost:3204/"
cd /tmp/fog-local-network
export LEDGER_BASE="$PWD/ledger"
# Run local network in background.
MC_LOG="info,rustls=warn,hyper=warn,tokio_reactor=warn,mio=warn,want=warn,rusoto_core=error,h2=error,reqwest=error,rocket=error,<unknown>=error" \
python3 "$SCRIPT_DIR/fog_local_network.py" --network-type dense5 --skip-build &
# Give it time to spin up
for PORT in 3200 3201 3202 3203 3204 4444; do
for _unused in $(seq 0 60); do
if ss -l | grep -q ":$PORT"; then break; else sleep 1; fi;
done
done
PRE_AUTH_BLOCK_INDEX=$("$BIN_DIR/mc-consensus-tool" wait-for-quiet)
# Authorize minters
echo "Authorizing minters"
python3 "$SCRIPT_DIR/../local-network/authorize-minters.py"
echo "Waiting for quiet after authorizing minters..."
PRE_MINT_BLOCK_INDEX=$("$BIN_DIR/mc-consensus-tool" wait-for-quiet --beyond-block="$PRE_AUTH_BLOCK_INDEX")
echo "Done waiting, PRE_MINT_BLOCK_INDEX=${PRE_MINT_BLOCK_INDEX}"
# Mint 1 million token1's to the first 4 accounts
echo "Minting"
for ACCOUNT_NUM in $(seq 0 4); do
"$BIN_DIR/mc-consensus-mint-client" \
generate-and-submit-mint-tx \
--node insecure-mc://localhost:3200/ \
--signing-key "$BIN_DIR/mc-local-network/minting-keys/minter1" \
--recipient "$(cat "keys/account_keys_${ACCOUNT_NUM}.b58pub")" \
--token-id 1 \
--amount 1000000
done
echo "Waiting for quiet after minting"
POST_MINT_BLOCK_INDEX=$("$BIN_DIR/mc-consensus-tool" wait-for-quiet --beyond-block "$PRE_MINT_BLOCK_INDEX")
echo "Done waiting, POST_MINT_BLOCK_INDEX = ${POST_MINT_BLOCK_INDEX}"
# Use burn.py to burn some token1
cd "$STRATEGIES_DIR" || exit 1
./compile_proto.sh
python3 burn.py \
--mobilecoind-host localhost \
--mobilecoind-port 4444 \
--key "$LEDGER_BASE/../keys/account_keys_2.json" \
--value 550000 \
--token-id 1 \
--fee 10000 \
--burn-redemption-memo "0xf43f5e8C04519efE0f54d7eBAEab20E86b235114"
- name: Upload core dumps
uses: ./.github/actions/upload-core-dumps
- name: Check dirty git
uses: ./.github/actions/check-dirty-git
publish-test-results:
runs-on: [self-hosted, Linux, small]
if: success() || failure()
needs:
- mc-tests
- consensus-tests
- fog-tests
- fog-ingest-tests
steps:
- name: Download XML reports
if: success() || failure()
uses: actions/download-artifact@v3
with:
name: junit-xml
- name: Publish Test Report
if: success() || failure()
uses: mikepenz/action-junit-report@v4
with:
check_name: Test Report
report_paths: '**/*.xml'
# via https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true