-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathMakefile
More file actions
804 lines (665 loc) · 37.8 KB
/
Copy pathMakefile
File metadata and controls
804 lines (665 loc) · 37.8 KB
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
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
# (c) Cartesi and individual authors (see AUTHORS)
# SPDX-License-Identifier: Apache-2.0 (see LICENSE)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
TARGET_OS?=$(shell uname)
export TARGET_OS
ROLLUPS_NODE_VERSION := 2.0.0-alpha.12
ROLLUPS_CONTRACTS_VERSION := 3.0.0-alpha.6
ROLLUPS_CONTRACTS_URL:=https://github.com/cartesi/rollups-contracts/releases/download/
ROLLUPS_CONTRACTS_ARTIFACT:=rollups-contracts-$(ROLLUPS_CONTRACTS_VERSION)-artifacts.tar.gz
ROLLUPS_CONTRACTS_SHA256:=ad1e0880766d25419fc6da1858ea4e7b9074b400e9d9ef68da88b12f4a8bba45
ROLLUPS_PRT_CONTRACTS_VERSION := 3.0.0-alpha.3
ROLLUPS_PRT_CONTRACTS_URL:=https://github.com/cartesi/dave/releases/download/
ROLLUPS_PRT_CONTRACTS_ARTIFACT:=cartesi-rollups-prt-$(ROLLUPS_PRT_CONTRACTS_VERSION)-contract-artifacts.tar.gz
ROLLUPS_PRT_CONTRACTS_SHA256:=240f4934df7a313dc05a4ae6cc3eee97b5c146952c4218502fec0db83f36a5a5
IMAGE_TAG ?= devel
BUILD_TYPE ?= release
ifeq ($(TARGET_OS),Darwin)
PREFIX ?= /opt/cartesi
ifeq ($(MACOSX_DEPLOYMENT_TARGET),)
export MACOSX_DEPLOYMENT_TARGET := $(shell sw_vers -productVersion | sed -E "s/([[:digit:]]+)\.([[:digit:]]+)\..+/\1.\2.0/")
endif
else
PREFIX ?= /usr
endif
BIN_RUNTIME_PATH= $(PREFIX)/bin
DOC_RUNTIME_PATH= $(PREFIX)/doc/cartesi-rollups-node
BIN_INSTALL_PATH= $(abspath $(DESTDIR)$(BIN_RUNTIME_PATH))
DOC_INSTALL_PATH= $(abspath $(DESTDIR)$(DOC_RUNTIME_PATH))
DEB_ARCH?= $(shell dpkg --print-architecture 2>/dev/null || echo amd64)
DEB_FILENAME= cartesi-rollups-node-v$(ROLLUPS_NODE_VERSION)_$(DEB_ARCH).deb
DEB_PACKAGER_IMG ?= cartesi/rollups-node:debian-packager
# Docker image platform
BUILD_PLATFORM ?=
ifneq ($(BUILD_PLATFORM),)
DOCKER_PLATFORM=--platform $(BUILD_PLATFORM)
endif
# Go artifacts
GO_ARTIFACTS := $(addprefix cartesi-rollups-,node cli evm-reader advancer validator claimer jsonrpc-api prt machine-tool)
# These artifacts embed the machine runtime and therefore require libcartesi.
# Keep this list explicit: every other artifact is built with CGO_ENABLED=0, so
# the normal build fails if a C dependency leaks into a pure service or tool.
MACHINE_GO_ARTIFACTS := cartesi-rollups-node cartesi-rollups-advancer
PURE_GO_ARTIFACTS := $(filter-out $(MACHINE_GO_ARTIFACTS),$(GO_ARTIFACTS))
# fixme(vfusco): path on all oses
CGO_CFLAGS:= -I$(PREFIX)/include
CGO_LDFLAGS:= -L$(PREFIX)/lib
export CGO_CFLAGS
export CGO_LDFLAGS
CARTESI_TEST_MACHINE_IMAGES_PATH:= $(PREFIX)/share/cartesi-machine/images/
export CARTESI_TEST_MACHINE_IMAGES_PATH
GO_VERSION_LDFLAGS := -s -w -X 'github.com/cartesi/rollups-node/internal/version.BuildVersion=$(ROLLUPS_NODE_VERSION)'
PURE_GO_BUILD_PARAMS := -ldflags "$(GO_VERSION_LDFLAGS)"
MACHINE_GO_BUILD_PARAMS := -ldflags "$(GO_VERSION_LDFLAGS) -r $(PREFIX)/lib"
ifeq ($(BUILD_TYPE),debug)
PURE_GO_BUILD_PARAMS += -gcflags "all=-N -l"
MACHINE_GO_BUILD_PARAMS += -gcflags "all=-N -l"
endif
# Tests and Go development tools cover machine packages, so retain the
# machine-capable parameters for those existing recipes.
GO_BUILD_PARAMS = $(MACHINE_GO_BUILD_PARAMS)
GO_TEST_PACKAGES ?= ./...
GO_TEST_FLAGS ?=
VERBOSE ?=
ifeq ($(VERBOSE),true)
PURE_GO_BUILD_PARAMS += -v
MACHINE_GO_BUILD_PARAMS += -v
GO_TEST_FLAGS += -v
endif
TEST_PATTERN ?=
ifneq ($(TEST_PATTERN),)
# Single-quote the pattern: a shard union like ^Test(A|B)$ contains shell
# metacharacters that would otherwise break the recipe's `go test` line.
# $(value ...) keeps the raw text so the trailing `$` anchor is not eaten by
# make's re-expansion when TEST_PATTERN arrives via a sub-make.
GO_TEST_FLAGS += -run '$(value TEST_PATTERN)'
endif
TEST_PACKAGES ?=
ifneq ($(TEST_PACKAGES),)
GO_TEST_PACKAGES := $(addprefix ./, $(addsuffix /..., $(subst :, ,$(TEST_PACKAGES))))
endif
COVERAGE_DIR := coverage
COVER ?=
ifeq ($(COVER),true)
GO_TEST_FLAGS += -coverprofile=$(COVERAGE_DIR)/coverage.out -covermode=atomic -coverpkg=./...
COVER_DEPS := $(COVERAGE_DIR)
COVER_REPORT := coverage-report
endif
ROLLUPS_CONTRACTS_ABI_BASEDIR:= rollups-contracts/
ROLLUPS_PRT_CONTRACTS_ABI_BASEDIR:= rollups-prt-contracts/
all: build
# =============================================================================
# Build
# =============================================================================
build: build-go ## Build all artifacts
build-go: $(GO_ARTIFACTS) ## Build Go artifacts (node, cli, evm-reader)
env:
@echo export CGO_CFLAGS=\"$(CGO_CFLAGS)\"
@echo export CGO_LDFLAGS=\"$(CGO_LDFLAGS)\"
@echo export CARTESI_LOG_LEVEL="info"
@echo export CARTESI_BLOCKCHAIN_DEFAULT_BLOCK="latest"
@echo export CARTESI_BLOCKCHAIN_HTTP_ENDPOINT="http://localhost:8545"
@echo export CARTESI_BLOCKCHAIN_ID="31337"
@echo export CARTESI_EVM_READER_POLLING_INTERVAL="1"
@echo export CARTESI_CONTRACTS_INPUT_BOX_ADDRESS="0x346B3df038FE9f8380071eC6514D5a83aD143939"
@echo export CARTESI_CONTRACTS_AUTHORITY_FACTORY_ADDRESS="0x3C1FE01c542a88A523FF6847eD1E26176c8C4ED0"
@echo export CARTESI_CONTRACTS_QUORUM_FACTORY_ADDRESS="0x1f94009389F408B8D0ADfFcF8BBDCe5552BaCa5F"
@echo export CARTESI_CONTRACTS_APPLICATION_FACTORY_ADDRESS="0xC549F89cF1ca43eDDECC64Ac2208F4b283B1c483"
@echo export CARTESI_CONTRACTS_SELF_HOSTED_APPLICATION_FACTORY_ADDRESS="0x6145C5996a71a379E030aEb0440df79D60833418"
@echo export CARTESI_CONTRACTS_DAVE_APP_FACTORY_ADDRESS="0x33FFf0b681c90664dD048a60400AE2D827a4c5bb"
@echo export CARTESI_DEVNET_ERC20_PORTAL_ADDRESS="0x22E57511C30CcE6CDaa742E13CE3b774fDC663b1"
@echo export CARTESI_DEVNET_TEST_ERC20_ADDRESS="0x88A2120B7068E78692C8fd12E751d610B6377E4d"
@echo export CARTESI_DEVNET_WITHDRAWAL_OUTPUT_BUILDER_ADDRESS="0x0745787835A019cd4dae8EDB541Fbc0647793d63"
@echo export CARTESI_AUTH_MNEMONIC=\"test test test test test test test test test test test junk\"
@echo export CARTESI_DATABASE_CONNECTION="postgres://postgres:password@localhost:5432/rollupsdb?sslmode=disable"
@echo export CARTESI_SNAPSHOTS_DIR="snapshots"
@echo export CARTESI_TEST_DATABASE_CONNECTION="postgres://test_user:password@localhost:5432/test_rollupsdb?sslmode=disable"
@echo export CARTESI_TEST_MACHINE_IMAGES_PATH=\"$(CARTESI_TEST_MACHINE_IMAGES_PATH)\"
@echo export PATH=\"$(CURDIR):$$PATH\"
@$(if $(MACOSX_DEPLOYMENT_TARGET),echo export MACOSX_DEPLOYMENT_TARGET=\"$(MACOSX_DEPLOYMENT_TARGET)\")
# =============================================================================
# Artifacts
# =============================================================================
$(PURE_GO_ARTIFACTS):
@echo "Building pure Go artifact $@"
CGO_ENABLED=0 go build $(PURE_GO_BUILD_PARAMS) ./cmd/$@
$(MACHINE_GO_ARTIFACTS):
@echo "Building Go artifact $@"
CGO_ENABLED=1 go build $(MACHINE_GO_BUILD_PARAMS) ./cmd/$@
tidy-go:
@go mod tidy
generate: generate-contracts generate-config generate-inspect ## Generate all code files committed to the repo
generate-contracts: contracts ## Generate contract ABI bindings
@echo "Generating contract bindings"
@go generate ./pkg/contracts/...
generate-config: ## Generate config code from Config.toml
@echo "Generating config code"
@go generate ./internal/config/...
generate-inspect: ## Generate inspect API client
@echo "Generating inspect client"
@go generate ./pkg/inspectclient/...
check-generate: generate ## Check whether the generated files are in sync
@echo "Checking differences on the repository..."
@if git diff --exit-code; then \
echo "No differences found."; \
else \
echo "ERROR: Differences found in the resulting files."; \
exit 1; \
fi
contracts: $(ROLLUPS_CONTRACTS_ABI_BASEDIR)/.stamp $(ROLLUPS_PRT_CONTRACTS_ABI_BASEDIR)/.stamp ## Export the contract artifacts
$(ROLLUPS_CONTRACTS_ABI_BASEDIR)/.stamp:
@echo "Downloading rollups-contracts artifacts"
@mkdir -p $(ROLLUPS_CONTRACTS_ABI_BASEDIR)
@curl -sSL $(ROLLUPS_CONTRACTS_URL)/v$(ROLLUPS_CONTRACTS_VERSION)/$(ROLLUPS_CONTRACTS_ARTIFACT) -o $(ROLLUPS_CONTRACTS_ARTIFACT)
@echo "$(ROLLUPS_CONTRACTS_SHA256) $(ROLLUPS_CONTRACTS_ARTIFACT)" | shasum -a 256 --check > /dev/null
@tar -zxf $(ROLLUPS_CONTRACTS_ARTIFACT) -C $(ROLLUPS_CONTRACTS_ABI_BASEDIR)
@touch $@
@rm -f $(ROLLUPS_CONTRACTS_ARTIFACT)
$(ROLLUPS_PRT_CONTRACTS_ABI_BASEDIR)/.stamp:
@echo "Downloading rollups-prt-contracts artifacts"
@mkdir -p $(ROLLUPS_PRT_CONTRACTS_ABI_BASEDIR)
@curl -sSL $(ROLLUPS_PRT_CONTRACTS_URL)/v$(ROLLUPS_PRT_CONTRACTS_VERSION)/$(ROLLUPS_PRT_CONTRACTS_ARTIFACT) -o $(ROLLUPS_PRT_CONTRACTS_ARTIFACT)
@echo "$(ROLLUPS_PRT_CONTRACTS_SHA256) $(ROLLUPS_PRT_CONTRACTS_ARTIFACT)" | shasum -a 256 --check > /dev/null
@tar -zxf $(ROLLUPS_PRT_CONTRACTS_ARTIFACT) -C $(ROLLUPS_PRT_CONTRACTS_ABI_BASEDIR)
@touch $@
@rm $(ROLLUPS_PRT_CONTRACTS_ARTIFACT)
migrate: ## Run migration on development database
@echo "Running PostgreSQL migration"
@go run $(GO_BUILD_PARAMS) dev/migrate/main.go
generate-db: ## Generate repository/db with Jet
@echo "Generating internal/repository/postgres/db with jet"
@rm -rf internal/repository/postgres/db
@go run github.com/go-jet/jet/v2/cmd/jet -dsn=$$CARTESI_DATABASE_CONNECTION -schema=public -path=./internal/repository/postgres/db
@rm -rf internal/repository/postgres/db/rollupsdb/public/model
# =============================================================================
# Clean
# =============================================================================
clean: clean-go clean-contracts clean-docs clean-devnet-files clean-dapps clean-test-dependencies clean-test-logs clean-debian-packages ## Clean all artifacts
clean-go: ## Clean Go artifacts
@echo "Cleaning Go artifacts"
@go clean -i -r -cache
@rm -f $(GO_ARTIFACTS)
@rm -rf $(COVERAGE_DIR)
clean-contracts: ## Clean contract artifacts
@echo "Cleaning contract artifacts"
@rm -rf $(ROLLUPS_CONTRACTS_ABI_BASEDIR) $(ROLLUPS_PRT_CONTRACTS_ABI_BASEDIR)
@rm -f $(ROLLUPS_CONTRACTS_ARTIFACT) $(ROLLUPS_PRT_CONTRACTS_ARTIFACT)
clean-docs: ## Clean the documentation
@echo "Cleaning the documentation"
@rm -rf docs/cli docs/node docs/evm-reader docs/advancer docs/validator docs/config.md
clean-devnet-files: ## Clean the devnet files
@echo "Cleaning devnet files"
@rm -f deployment.json anvil_state.json
clean-debian-packages:
@echo "Cleaning debian package"
@rm -f cartesi-rollups-node-v*.deb
clean-dapps: ## Clean the dapps
@echo "Cleaning dapps"
@rm -rf applications snapshots
clean-test-dependencies: ## Clean the test dependencies
@echo "Cleaning test dependencies"
@rm -rf $(DOWNLOADS_DIR)
clean-test-logs: ## Clean integration test log files
@echo "Cleaning integration test logs"
@rm -f integration-logs.txt integration-logs-*.txt
# Reaps the deterministically-named local shard projects (and the default
# single-project name). A SIGKILL/OOM during a local sharded run skips the
# cleanup trap and leaks each project's anonymous Postgres volume; this is the
# manual recovery. CI uses ephemeral runners and does not need it.
clean-integration-compose: ## Tear down leftover integration shard×topology compose projects and volumes
@echo "Cleaning integration compose projects"
@cleanup_project() { \
project="$$1"; \
docker rm -f "$$project-integration-test-run" >/dev/null 2>&1 || true; \
ids="$$(docker ps -aq --filter "label=com.docker.compose.project=$$project" --filter "label=com.docker.compose.service=integration-test" 2>/dev/null || true)"; \
if [ -n "$$ids" ]; then docker rm -f $$ids >/dev/null 2>&1 || true; fi; \
docker compose -p "$$project" -f test/compose/compose.integration.yaml down -v --remove-orphans 2>/dev/null || true; \
}; \
for t in $(INTEGRATION_TOPOLOGIES) ; do \
cleanup_project rollups-node-integration-all-$$t ; \
for s in $(INTEGRATION_SHARDS) ; do \
cleanup_project rollups-node-integration-$$s-$$t ; \
done ; \
done; \
cleanup_project rollups-node-integration
# =============================================================================
# Tests
# =============================================================================
test: unit-test ## Execute all tests
$(COVERAGE_DIR):
@mkdir -p $@
coverage-report:
@go tool cover -func=$(COVERAGE_DIR)/coverage.out
@go tool cover -html=$(COVERAGE_DIR)/coverage.out -o $(COVERAGE_DIR)/coverage.html
@echo "Coverage report: $(COVERAGE_DIR)/coverage.html"
unit-test: $(COVER_DEPS) ## Execute go unit tests
@echo "Running go unit tests"
@go clean -testcache
@go test -p 1 $(GO_BUILD_PARAMS) $(GO_TEST_FLAGS) $(GO_TEST_PACKAGES)
@$(if $(COVER_REPORT),$(MAKE) $(COVER_REPORT))
GOTESTSUM_FORMAT ?= testdox
ifeq ($(VERBOSE),true)
GOTESTSUM_FORMAT = standard-verbose
endif
COMPOSE_TOPOLOGY_GOTESTSUM_FORMAT = $(GOTESTSUM_FORMAT)
ifeq ($(strip $(SHARD)),)
ifeq ($(origin GOTESTSUM_FORMAT),file)
COMPOSE_TOPOLOGY_GOTESTSUM_FORMAT = standard-verbose
endif
endif
integration-test: ## Execute e2e tests
@echo "Running end-to-end tests"
@if command -v gotestsum >/dev/null 2>&1; then \
gotestsum --format $(GOTESTSUM_FORMAT) -- -count=1 -timeout 55m $(GO_BUILD_PARAMS) $(GO_TEST_FLAGS) -tags=endtoendtests ./test/integration/...; \
else \
go test -count=1 -timeout 55m $(GO_BUILD_PARAMS) $(GO_TEST_FLAGS) -tags=endtoendtests ./test/integration/...; \
fi
echo-dapp: applications/echo-dapp ## Echo dapp
reject-dapp: applications/reject-dapp ## Reject dapp
exception-dapp: applications/exception-dapp ## Exception dapp
applications/echo-dapp: ## Create echo-dapp test application
@echo "Creating echo-dapp test application"
@mkdir -p applications
@cartesi-machine --ram-length=128Mi --store=applications/echo-dapp --final-hash -- ioctl-echo-loop --vouchers=1 --delegate-call-vouchers=1 --notices=1 --reports=1 --verbose=1
applications/reject-dapp: ## Create reject-dapp test application
@echo "Creating reject-dapp test application"
@mkdir -p applications
@cartesi-machine --ram-length=128Mi --store=applications/reject-dapp --final-hash -- "rollup accept && echo '{\"payload\": \"0x726561736f6e20666f722072656a656374696e67\" }' | rollup report && rollup reject"
applications/exception-dapp: ## Create exception-dapp test application
@echo "Creating exception-dapp test application"
@mkdir -p applications
@cartesi-machine --ram-length=128Mi --store=applications/exception-dapp --final-hash -- "rollup accept && echo '{\"payload\": \"0x7468697320697320612064756d6d7920657863657074696f6e2074657874\"}' | rollup exception"
reject-loop-dapp: applications/reject-loop-dapp ## Reject loop dapp
exception-loop-dapp: applications/exception-loop-dapp ## Exception loop dapp
erc20-withdrawal-dapp: applications/erc20-withdrawal-dapp ## ERC-20 withdrawal test dapp
applications/reject-loop-dapp: ## Create reject-loop-dapp test application
@echo "Creating reject-loop-dapp test application"
@mkdir -p applications
@cartesi-machine --ram-length=128Mi --store=applications/reject-loop-dapp --final-hash -- ioctl-echo-loop --vouchers=1 --notices=1 --reports=1 --reject=1 --verbose=1
applications/exception-loop-dapp: ## Create exception-loop-dapp test application
@echo "Creating exception-loop-dapp test application"
@mkdir -p applications
@cartesi-machine --ram-length=128Mi --store=applications/exception-loop-dapp --final-hash -- ioctl-echo-loop --vouchers=1 --notices=1 --reports=1 --exception=1 --verbose=1
applications/erc20-withdrawal-dapp: test/dapps/erc20-withdrawal/install.sh ## Create ERC-20 withdrawal test application
@echo "Creating ERC-20 withdrawal test application"
@mkdir -p applications
@PORTAL=$${CARTESI_DEVNET_ERC20_PORTAL_ADDRESS:-0x22E57511C30CcE6CDaa742E13CE3b774fDC663b1}; \
TOKEN=$${CARTESI_DEVNET_TEST_ERC20_ADDRESS:-0x88A2120B7068E78692C8fd12E751d610B6377E4d}; \
cartesi-machine --ram-length=128Mi \
--flash-drive=label:accounts,length:4Mi,mke2fs:false,mount:false,user:dapp \
--env=TRUSTED_ERC20_PORTAL=$$PORTAL \
--env=TRUSTED_ERC20_TOKEN=$$TOKEN \
--append-init-file=test/dapps/erc20-withdrawal/install.sh \
--store=applications/erc20-withdrawal-dapp --final-hash -- /usr/local/bin/erc20-withdrawal-dapp
deploy-echo-dapp: applications/echo-dapp ## Deploy echo-dapp test application
@echo "Deploying echo-dapp test application"
@./cartesi-rollups-cli deploy application echo-dapp applications/echo-dapp/
deploy-reject-dapp: applications/reject-dapp ## Deploy reject-dapp test application
@echo "Deploying reject-dapp test application"
@./cartesi-rollups-cli deploy application reject-dapp applications/reject-dapp/
deploy-exception-dapp: applications/exception-dapp ## Deploy exception-dapp test application
@echo "Deploying exception-dapp test application"
@./cartesi-rollups-cli deploy application exception-dapp applications/exception-dapp/
deploy-prt-echo-dapp: applications/echo-dapp ## Deploy echo-dapp test application
@echo "Deploying echo-dapp test application"
@./cartesi-rollups-cli deploy application prt-echo-dapp applications/echo-dapp/ --prt
deploy-erc20-withdrawal-dapp: applications/erc20-withdrawal-dapp ## Deploy ERC-20 withdrawal test application
@set -e; \
APP=$${APP:-erc20-withdrawal-dapp}; \
GUARDIAN=$${GUARDIAN:-0x70997970C51812dc3A010C7d01b50e0d17dc79C8}; \
BUILDER=$${CARTESI_DEVNET_WITHDRAWAL_OUTPUT_BUILDER_ADDRESS:-0x0745787835A019cd4dae8EDB541Fbc0647793d63}; \
DRIVE_START_INDEX=$$(jq -r '.config.flash_drive[] | select(.length == 4194304) | (.start / 4194304 | floor)' \
applications/erc20-withdrawal-dapp/config.json); \
WITHDRAWAL_CONFIG=$$(jq -cn \
--arg guardian "$$GUARDIAN" \
--arg builder "$$BUILDER" \
--argjson drive "$$DRIVE_START_INDEX" \
'{guardian:$$guardian,log2_leaves_per_account:0,log2_max_num_of_accounts:17,accounts_drive_start_index:$$drive,withdrawal_output_builder:$$builder}'); \
echo "Deploying $$APP with accounts-drive start index $$DRIVE_START_INDEX"; \
./cartesi-rollups-cli deploy application "$$APP" applications/erc20-withdrawal-dapp \
--salt "$$(openssl rand -hex 32)" \
--withdrawal-config "$$WITHDRAWAL_CONFIG" \
--enable=false; \
./cartesi-rollups-cli app execution-parameters set "$$APP" snapshot_policy EVERY_EPOCH; \
./cartesi-rollups-cli app status "$$APP" enabled --yes
fund-wallet: ## Fund the default Anvil wallet with ETH and test ERC-20
@set -e; \
RPC_URL=$${CARTESI_BLOCKCHAIN_HTTP_ENDPOINT:-http://localhost:8545}; \
TOKEN=$${CARTESI_DEVNET_TEST_ERC20_ADDRESS:-0x88A2120B7068E78692C8fd12E751d610B6377E4d}; \
WALLET=$${WALLET:-$$(cast rpc --rpc-url "$$RPC_URL" eth_accounts | jq -r '.[0]')}; \
ETH_WEI=$${ETH_WEI:-0x8ac7230489e80000}; \
TOKEN_AMOUNT=$${TOKEN_AMOUNT:-1000000}; \
echo "Funding $$WALLET with $$ETH_WEI wei"; \
cast rpc --rpc-url "$$RPC_URL" anvil_setBalance "$$WALLET" "$$ETH_WEI" >/dev/null; \
echo "Minting $$TOKEN_AMOUNT test ERC-20 units to $$WALLET"; \
cast send --rpc-url "$$RPC_URL" --from "$$WALLET" --unlocked "$$TOKEN" "mint(uint256)" "$$TOKEN_AMOUNT" >/dev/null
withdraw-wallet: cartesi-rollups-cli ## Send a test withdrawal request from the current signer
@set -e; \
APP=$${APP:-erc20-withdrawal-dapp}; \
AMOUNT=$${AMOUNT:-25}; \
PAYLOAD=$$(printf '0x01%016x' "$$AMOUNT"); \
echo "Sending withdrawal request to $$APP: amount=$$AMOUNT payload=$$PAYLOAD"; \
./cartesi-rollups-cli send "$$APP" "$$PAYLOAD" --hex --yes --json
# Temporary test dependencies target while we are not using distribution packages
DOWNLOADS_DIR = test/downloads
CARTESI_TEST_MACHINE_IMAGES = $(DOWNLOADS_DIR)/linux.bin $(DOWNLOADS_DIR)/rootfs.ext2
$(CARTESI_TEST_MACHINE_IMAGES):
@mkdir -p $(DOWNLOADS_DIR)
@wget -nc -i test/dependencies -P $(DOWNLOADS_DIR)
@shasum -ca 256 test/dependencies.sha256
@cd $(DOWNLOADS_DIR) && ln -s rootfs-tools.ext2 rootfs.ext2
@cd $(DOWNLOADS_DIR) && ln -s linux-6.5.13-ctsi-2-v0.21.0.bin linux.bin
download-test-dependencies: | $(CARTESI_TEST_MACHINE_IMAGES)
dependencies.sha256:
@shasum -a 256 $(DOWNLOADS_DIR)/rootfs-tools* $(DOWNLOADS_DIR)/linux-*.bin > $@
# =============================================================================
# Static Analysis
# =============================================================================
lint: ## Run the linter
@echo "Running the linter"
@golangci-lint run ./...
fmt: ## Run go fmt
@echo "Running go fmt"
@go fmt ./...
fmt-check: ## Check go formatting (non-destructive)
@echo "Checking go formatting"
@test -z "$$(gofmt -l .)" || (echo "Unformatted files:" && gofmt -l . && exit 1)
vet: ## Run go vet
@echo "Running go vet"
@go vet ./...
escape: ## Run go escape analysis
@echo "Running go escape analysis"
go build -gcflags="-m -m" ./...
# =============================================================================
# Docs
# =============================================================================
docs: generate-cli-docs generate-config-docs ## Generate all documentation
generate-cli-docs: ## Generate CLI documentation
@echo "Generating CLI documentation"
@go run $(GO_BUILD_PARAMS) dev/gen-docs/main.go
generate-config-docs: ## Generate config documentation from Config.toml
@echo "Generating config documentation"
@cd internal/config/generate && go run . -mode=docs
# =============================================================================
# Docker
# =============================================================================
devnet: clean-contracts ## Build docker devnet image
@docker build $(DOCKER_PLATFORM) -t cartesi/rollups-node-devnet:$(IMAGE_TAG) -f test/devnet/Dockerfile .
image: ## Build the docker images using bake
@docker build $(DOCKER_PLATFORM) -t cartesi/rollups-node:$(IMAGE_TAG) .
tester-image: ## Build the docker images using bake
@docker build $(DOCKER_PLATFORM) --target=tester -t cartesi/rollups-node:tester .
debian-packager: ## Build debian packager image
@echo "Building debian packager image $(DEB_PACKAGER_IMG) $(BUILD_PLATFORM)"
@docker build $(DOCKER_PLATFORM) --target debian-packager -t $(DEB_PACKAGER_IMG) .
run-with-compose: ## Run the node with the anvil devnet
@docker compose up
start-devnet: ## Run the anvil devnet docker container
@echo "Starting devnet"
@docker run --rm --name devnet -p 8545:8545 -d cartesi/rollups-node-devnet:$(IMAGE_TAG)
@$(MAKE) copy-devnet-files
copy-devnet-files deployment.json: ## Copy the devnet files to the host (it must be running)
@echo "Copying devnet files"
@docker cp devnet:/usr/share/devnet/deployment.json deployment.json
@docker cp devnet:/usr/share/devnet/anvil_state.json anvil_state.json
start-postgres: ## Run the PostgreSQL 16 docker container
@echo "Starting portgres"
@docker run --rm --name postgres -p 5432:5432 -d -e POSTGRES_PASSWORD=password -e POSTGRES_DB=rollupsdb -v $(CURDIR)/test/postgres/init-test-db.sh:/docker-entrypoint-initdb.d/init-test-db.sh postgres:18-alpine
@$(MAKE) migrate
start: start-postgres start-devnet ## Start the anvil devnet and PostgreSQL 16 docker containers
stop-devnet: ## Stop the anvil devnet docker container
@docker stop devnet || true
stop-postgres: ## Stop the PostgreSQL 16 docker container
@docker stop postgres || true
stop: stop-devnet stop-postgres ## Stop all running docker containers
restart-devnet: ## Restart the anvil devnet docker container
@$(MAKE) stop-devnet
@$(MAKE) start-devnet
restart-postgres: ## Restart the PostgreSQL 16 docker container and migrate it
@$(MAKE) stop-postgres
@$(MAKE) start-postgres
restart: ## Restart all running docker containers
@$(MAKE) stop-devnet
@$(MAKE) stop-postgres
@$(MAKE) start-devnet
@$(MAKE) start-postgres
shutdown-compose: ## Remove the containers and volumes from previous compose run
@docker compose down -v
unit-test-with-compose: $(CARTESI_TEST_MACHINE_IMAGES) ## Run unit tests using docker compose with auto-shutdown
@trap 'docker compose -f test/compose/compose.test.yaml down -v || true' EXIT && \
docker compose -f test/compose/compose.test.yaml run --rm --remove-orphans unit-test
lint-with-docker: ## Run linting inside Docker (no host Go needed)
@docker run --rm cartesi/rollups-node:tester sh -c 'make lint && make vet && make fmt-check'
check-license: ## Verify license headers on Go source files
@scripts/check-license-header.sh
# =============================================================================
# Integration test sharding
# =============================================================================
# Each shard runs as an isolated Docker Compose project (own Anvil, Postgres,
# and test-managed node); tests within a shard stay sequential. The anchors
# (^...$$) are load-bearing: go test -run matches unanchored, and several test
# names are prefixes of others (Foreclose / ForecloseReplay / ForeclosePrt).
# Every top-level test must match exactly one shard; this is enforced by
# `make integration-test-shard-check`.
#
# Shards are grouped by semantic family, not balanced by runtime: `withdrawal`
# is a single test while `restart` and `replay` are the heaviest. Each shard
# gets its own CI runner and the full per-job `go test -timeout 55m`
# (run-integration-tests.sh) budget; `restart` (multi-suite, ~25-min setup
# contexts) is the first to watch if a shard ever approaches that ceiling.
# Discovery (integration-test-shard-check) lists tests with a plain Go
# toolchain, so the integration package must stay free of the Cartesi CGo
# dependency for the check to build on the CI setup runner.
INTEGRATION_SHARDS := basic quorum prt replay restart withdrawal
INTEGRATION_SHARD_basic := ^Test(EchoAuthority|RejectException|MultiApp|EchoAuthorityStaging)$$
INTEGRATION_SHARD_quorum := ^Test(EchoQuorum|SameBlockInputs)$$
INTEGRATION_SHARD_prt := ^Test(EchoPrt|RejectExceptionPrt|ForeclosePrt)$$
INTEGRATION_SHARD_replay := ^Test(Foreclose|ForecloseReplay|DivergentClaim)$$
INTEGRATION_SHARD_restart := ^Test(Restart|SnapshotPolicy)$$
INTEGRATION_SHARD_withdrawal := ^TestWithdrawalLifecycle$$
# -----------------------------------------------------------------------------
# Node topology axis — orthogonal to shards.
# -----------------------------------------------------------------------------
# A shard selects WHICH tests run; a topology selects HOW the node is deployed.
# CI runs the (shard, topology) cells in parallel. Both topologies are
# test-managed (TestMain starts and can restart them), so both run every shard.
# standalone — the all-in-one cartesi-rollups-node process.
# multiprocess — one OS process per service (evm-reader, advancer, validator,
# claimer, prt, jsonrpc-api) sharing Postgres, started as
# subprocesses by TestMain (on the host, or inside the test
# container under compose). See test/integration/multinode_helpers_test.go.
#
# Applicability is per-topology data (INTEGRATION_SHARDS_<topology>). multiprocess
# runs the SAME shards as standalone — the node-lifecycle tests stop/start the
# whole service set via the topology-aware harness. Killing a single service
# (partial failure) is separate future fault-injection work.
INTEGRATION_TOPOLOGIES := standalone multiprocess
NODE_TOPOLOGY ?= standalone
INTEGRATION_SHARDS_standalone := $(INTEGRATION_SHARDS)
INTEGRATION_SHARDS_multiprocess := $(INTEGRATION_SHARDS)
# The CI matrix is the set of (shard, topology) cells, encoded "shard:topology".
INTEGRATION_CELLS := $(foreach t,$(INTEGRATION_TOPOLOGIES),$(foreach s,$(INTEGRATION_SHARDS_$(t)),$(s):$(t)))
COMPOSE_PROJECT ?= rollups-node-integration
INTEGRATION_LOGS ?= integration-logs.txt
INTEGRATION_TEST_JOBS ?= 3
CLEAN_STALE_LOCAL_NODE ?= false
# String helpers for building run patterns / matrices.
comma := ,
empty :=
space := $(empty) $(empty)
# --- Selection driven by NODE_TOPOLOGY and SHARD ----------------------------
# Selected topologies: NODE_TOPOLOGY (default standalone), a space-separated
# list, or the sugar value `all`.
TOPOLOGIES_SELECTED = $(if $(filter all,$(NODE_TOPOLOGY)),$(INTEGRATION_TOPOLOGIES),$(NODE_TOPOLOGY))
# shards_for(topology): the SHARD filter (or all) intersected with what the
# topology supports (INTEGRATION_SHARDS_<topology>).
shards_for = $(filter $(if $(strip $(SHARD)),$(SHARD),$(INTEGRATION_SHARDS_$(1))),$(INTEGRATION_SHARDS_$(1)))
# run_pattern(topology): the selected shards' -run regexes as one alternation.
run_pattern = $(subst $(space),|,$(strip $(foreach s,$(call shards_for,$(1)),$(INTEGRATION_SHARD_$(s)))))
# Selected (shard:topology) cells, for PARALLEL fan-out.
SELECTED_CELLS = $(foreach t,$(TOPOLOGIES_SELECTED),$(foreach s,$(call shards_for,$(t)),$(s):$(t)))
# Label for project/log names: the SHARD filter joined by '-', or "all".
SUITE_LABEL = $(if $(strip $(SHARD)),$(subst $(space),-,$(strip $(SHARD))),all)
# Validate NODE_TOPOLOGY / SHARD at parse time for the two entry points so a
# bad invocation fails before any prerequisite work (downloading images, etc).
ifneq ($(filter integration-test-with-compose integration-test-local,$(MAKECMDGOALS)),)
$(if $(strip $(TOPOLOGIES_SELECTED)),,$(error NODE_TOPOLOGY must select at least one topology. Known topologies: $(INTEGRATION_TOPOLOGIES)))
$(foreach t,$(TOPOLOGIES_SELECTED),$(if $(filter $(t),$(INTEGRATION_TOPOLOGIES)),,$(error unknown topology '$(t)'. Known topologies: $(INTEGRATION_TOPOLOGIES))))
$(foreach s,$(SHARD),$(if $(filter $(s),$(INTEGRATION_SHARDS)),,$(error unknown shard '$(s)'. Known shards: $(INTEGRATION_SHARDS))))
endif
# PARALLEL is compose-only: the host node binds fixed ports. Fail at parse time,
# before the (slow) build prerequisites of integration-test-local.
ifneq ($(filter integration-test-local,$(MAKECMDGOALS)),)
ifeq ($(PARALLEL),true)
$(error PARALLEL is not supported for integration-test-local (the host node binds fixed ports 10000/10011/10012). Use 'integration-test-with-compose PARALLEL=true')
endif
endif
# =============================================================================
# Two entry points. Both honor:
# NODE_TOPOLOGY one topology (default standalone), a list, or `all`
# SHARD restrict to a subset of shards (default: all applicable)
# PARALLEL =true runs cells concurrently (compose only)
# A requested-but-inapplicable (shard, topology) is skipped with a message.
# =============================================================================
integration-test-with-compose: $(CARTESI_TEST_MACHINE_IMAGES) ## Run integration tests via docker compose (NODE_TOPOLOGY=, SHARD=, PARALLEL=true)
ifeq ($(PARALLEL),true)
ifeq ($(strip $(SELECTED_CELLS)),)
@echo "skip: no applicable integration cells selected"
else
@$(MAKE) -k -j $(INTEGRATION_TEST_JOBS) $(addprefix _compose-cell-,$(SELECTED_CELLS))
endif
else
@set -e; for t in $(TOPOLOGIES_SELECTED); do $(MAKE) _compose-topology-$$t; done
endif
# One topology: the union of selected shards in one compose project, sequential.
_compose-topology-%:
@pattern='$(call run_pattern,$*)'; \
if [ -z "$$pattern" ]; then echo "skip: no applicable shards for topology '$*' (SHARD filter excludes all)"; exit 0; fi; \
COMPOSE_PROJECT='$(if $(filter rollups-node-integration,$(COMPOSE_PROJECT)),rollups-node-integration-$(SUITE_LABEL)-$*,$(COMPOSE_PROJECT))' \
INTEGRATION_LOGS='integration-logs-$(SUITE_LABEL)-$*.txt' \
TEST_PATTERN="$$pattern" SHARD_NAME='$(SUITE_LABEL)-$*' NODE_TOPOLOGY='$*' \
GOTESTSUM_FORMAT='$(COMPOSE_TOPOLOGY_GOTESTSUM_FORMAT)' \
scripts/compose-integration-run.sh
# One (shard:topology) cell in its own project — PARALLEL fan-out target.
_compose-cell-%:
@COMPOSE_PROJECT='$(COMPOSE_PROJECT)-$(firstword $(subst :, ,$*))-$(lastword $(subst :, ,$*))' \
INTEGRATION_LOGS='integration-logs-$(firstword $(subst :, ,$*))-$(lastword $(subst :, ,$*)).txt' \
TEST_PATTERN='$(INTEGRATION_SHARD_$(firstword $(subst :, ,$*)))' \
SHARD_NAME='$(firstword $(subst :, ,$*))' \
NODE_TOPOLOGY='$(lastword $(subst :, ,$*))' \
GOTESTSUM_FORMAT='$(GOTESTSUM_FORMAT)' \
scripts/compose-integration-run.sh
integration-test-shard-check: ## Verify every integration test belongs to exactly one shard
@scripts/check-integration-shards.sh \
$(foreach s,$(INTEGRATION_SHARDS),'$(s)=$(INTEGRATION_SHARD_$(s))')
list-integration-shards: ## Print integration shard names as a JSON array
@echo '[$(subst $(space),$(comma),$(patsubst %,"%",$(INTEGRATION_SHARDS)))]'
list-integration-cells: ## Print shard×topology cells as a JSON array of {shard,topology} (for the CI matrix)
@printf '['; sep=''; \
for cell in $(INTEGRATION_CELLS); do \
printf '%s{"shard":"%s","topology":"%s"}' "$$sep" "$${cell%%:*}" "$${cell##*:}"; \
sep=','; \
done; \
printf ']\n'
test-with-compose: ## Run all tests using docker compose with auto-shutdown
@$(MAKE) unit-test-with-compose
@$(MAKE) integration-test-with-compose
integration-test-local: build cartesi-rollups-machine-tool echo-dapp reject-loop-dapp exception-loop-dapp erc20-withdrawal-dapp ## Run integration tests on the host (NODE_TOPOLOGY=, SHARD=; requires: make start && eval $$(make env); CLEAN_STALE_LOCAL_NODE=true to stop test-port listeners)
@set -e; first=1; for t in $(TOPOLOGIES_SELECTED); do \
if [ "$$first" = 1 ]; then first=0; else echo "=== resetting dev DB + devnet between topologies ==="; $(MAKE) restart; fi; \
$(MAKE) _local-topology-$$t; \
done
# One topology on the host: in-process node (standalone) or service subprocesses
# (multiprocess, via TestMain reading NODE_TOPOLOGY).
_local-topology-%:
@pattern='$(call run_pattern,$*)'; \
if [ -z "$$pattern" ]; then echo "skip: no applicable shards for topology '$*' (SHARD filter excludes all)"; exit 0; fi; \
cartesi-rollups-cli db init; \
test_ports="10000 10001 10002 10003 10004 10005 10006 10011 10012"; \
busy_pids="$$(for p in $$test_ports; do lsof -tiTCP:$$p -sTCP:LISTEN 2>/dev/null || true; done | sort -u | tr '\n' ' ')"; \
if [ -n "$$busy_pids" ]; then \
if [ "$(CLEAN_STALE_LOCAL_NODE)" = "true" ]; then \
echo "Stopping process(es) listening on integration test ports: $$busy_pids"; \
kill $$busy_pids 2>/dev/null || true; \
sleep 2; \
else \
echo "ERROR: integration test ports are already in use by PID(s): $$busy_pids" >&2; \
echo "Stop those processes, or rerun with CLEAN_STALE_LOCAL_NODE=true to stop test-port listeners." >&2; \
exit 1; \
fi; \
fi; \
export CARTESI_TEST_DAPP_PATH=$(CURDIR)/applications/echo-dapp; \
export CARTESI_TEST_REJECT_DAPP_PATH=$(CURDIR)/applications/reject-loop-dapp; \
export CARTESI_TEST_EXCEPTION_DAPP_PATH=$(CURDIR)/applications/exception-loop-dapp; \
export CARTESI_TEST_ERC20_WITHDRAWAL_DAPP_PATH=$(CURDIR)/applications/erc20-withdrawal-dapp; \
NODE_TOPOLOGY='$*' TEST_PATTERN="$$pattern" $(MAKE) integration-test
deploy-load-test-apps: applications/echo-dapp ## Deploy 3 echo-dapp instances for load testing
@echo "Deploying load-test apps (3 echo-dapps with different salts)..."
@./cartesi-rollups-cli deploy application load-test-flood applications/echo-dapp/ \
--salt=0000000000000000000000000000000000000000000000000000000000000A01
@./cartesi-rollups-cli deploy application load-test-trickle-1 applications/echo-dapp/ \
--salt=0000000000000000000000000000000000000000000000000000000000000A02
@./cartesi-rollups-cli deploy application load-test-trickle-2 applications/echo-dapp/ \
--salt=0000000000000000000000000000000000000000000000000000000000000A03
@echo "Done. 3 apps deployed: load-test-flood, load-test-trickle-1, load-test-trickle-2"
load-test: deploy-load-test-apps ## Deploy 3 apps and run advancer starvation load test
@echo "NOTE: Start the node (separate terminal) with: CARTESI_ADVANCER_INPUT_BATCH_SIZE=10 cartesi-rollups-node"
@scripts/load-test.sh
ci-test: ## Run the CI test pipeline locally (unit + integration across all topologies)
# @$(MAKE) lint-with-docker
@$(MAKE) integration-test-shard-check
@$(MAKE) unit-test-with-compose
@$(MAKE) integration-test-with-compose NODE_TOPOLOGY=all
clean-test-compose-resources: ## Clean up compose resources after some unexpected test failure
@echo "Cleaning up Docker Compose resources..."
@docker compose -f test/compose/compose.test.yaml down -v || true
help: ## Show help for each of the Makefile recipes
@grep "##" $(MAKEFILE_LIST) | grep -v grep | sed -e 's/:.*##\(.*\)/:\n\t\1\n/'
version: ## Show the current version
@echo $(ROLLUPS_NODE_VERSION)
THIRD_PARTY_LICENSES.md: dev/licenses.tpl go.mod ## Update the THIRD_PARTY_LICENSES.md file
go-licenses report --template dev/licenses.tpl ./... > $@
# =============================================================================
# Install
# =============================================================================
install: $(GO_ARTIFACTS) ## Install all Go artifacts
@echo "Installing Go artifacts to $(BIN_INSTALL_PATH)"
@mkdir -m 0755 -p $(BIN_INSTALL_PATH)
@for artifact in $(GO_ARTIFACTS); do \
install -m0755 $$artifact $(BIN_INSTALL_PATH)/; \
done
copy-debian-package: ## Copy debian package from debian packager image
@echo "Copying debian package from image $(DEB_PACKAGER_IMG) $(BUILD_PLATFORM)"
@docker create --name debian-packager $(DOCKER_PLATFORM) $(DEB_PACKAGER_IMG)
@docker cp debian-packager:/build/cartesi/go/rollups-node/$(DEB_FILENAME) .
@docker rm debian-packager > /dev/null
build-debian-package: install
mkdir -p $(DESTDIR)/DEBIAN $(DOC_INSTALL_PATH)
install -m0644 LICENSE $(DOC_INSTALL_PATH)/copyright
sed 's|ARG_VERSION|$(ROLLUPS_NODE_VERSION)|g;s|ARG_ARCH|$(DEB_ARCH)|g' control.template > $(DESTDIR)/DEBIAN/control
dpkg-deb -Zxz --root-owner-group --build $(DESTDIR) $(DEB_FILENAME)
.PHONY: \
build build-go $(GO_ARTIFACTS) cartesi-rollups-machine-tool \
clean clean-go clean-contracts clean-docs clean-devnet-files clean-dapps clean-test-dependencies clean-test-logs clean-integration-compose clean-debian-packages \
test unit-test unit-test-with-compose integration-test integration-test-with-compose integration-test-local test-with-compose ci-test coverage-report \
integration-test-shard-check list-integration-shards list-integration-cells \
generate generate-contracts generate-config generate-inspect check-generate generate-db \
docs generate-cli-docs generate-config-docs \
lint fmt fmt-check vet escape check-license \
devnet image tester-image debian-packager run-with-compose shutdown-compose \
start start-devnet start-postgres stop stop-devnet stop-postgres restart restart-devnet restart-postgres \
install copy-debian-package build-debian-package \
deploy-erc20-withdrawal-dapp fund-wallet withdraw-wallet \
env help version