This repository was archived by the owner on Mar 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (47 loc) · 1.72 KB
/
Makefile
File metadata and controls
59 lines (47 loc) · 1.72 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
DOCKER_COMPOSE := $(shell which docker-compose)
ifeq (${DOCKER_COMPOSE},)
DOCKER_COMPOSE = docker compose
endif
## Recipes
.DEFAULT_GOAL := help
.PHONY: help
help:
@echo "Recipes for local development and testing"
@echo "They require to have installed and found in PATH:"
@echo
@echo "* Docker with compose (e.g. 'docker compose' or 'docker-comose')"
@echo "* Node and its corresponding NPM (verified with v18.7.x)"
@echo "* Rust toochain (verified with v1.67.0) \n"
@awk 'BEGIN { \
FS = ":.*##"; \
printf "Usage:\n make \033[36m<target>\033[0m\n" \
} \
/^[a-zA-Z_-]+:.*?##/ { \
printf " \033[36m%-17s\033[0m %s\n", $$1, $$2 \
} \
/^##@/ { \
printf "\n\033[1m%s\033[0m\n", substr($$0, 5) \
} ' $(MAKEFILE_LIST)
## Public recipes
.PHONY: clean
clean: ## Remove resources generated by the local environment, tests, etc.
${DOCKER_COMPOSE} down -v --remove-orphans --rmi all
cd smart-contracts; npm run clean
@-docker image rm --force ethereum/solc:0.8.18
.PHONY: local-env-start
local-env-start: ## Start the local environment (IPFS, Ethereum, etc.)
${DOCKER_COMPOSE} up -d
$(MAKE) .deploy-smart-contracts
.PHONY: local-env-stop
local-env-stop: ## Stops the local environment
${DOCKER_COMPOSE} down
.PHONY: generate-smart-contracts-abi
generate-smart-conracts-abi: smart-contracts/node_modules ## Generate the smart contracts ABI and copy them to the contract-bindings crate
cd smart-contracts; npm run truffle -- compile
cp smart-contracts/build/contracts/CIDsOwners.json contracts-bindings/contracts/
## Private recipes
.PHONY: .deploy-smart-contracts
.deploy-smart-contracts: smart-contracts/node_modules
cd smart-contracts; npm run truffle -- migrate
smart-contracts/node_modules:
cd smart-contracts; npm install