-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
52 lines (39 loc) · 1.35 KB
/
Makefile
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
# include .env file and export its env vars
# (-include to ignore error if it does not exist)
-include .env
install: update npm solc
# dapp deps
update:; dapp update
# npm deps for linting etc.
npm:; yarn install
# install solc version
SOLC_VERSION := 0_8_9
solc:; nix-env -f https://github.com/dapphub/dapptools/archive/master.tar.gz -iA solc-static-versions.solc_${SOLC_VERSION}
# Build & test
build :; dapp build
test :; dapp test
clean :; dapp clean
lint :; yarn run lint
# Deployment helpers
deploy :; @./scripts/deploy.sh
deploy-guild :; @./scripts/deploy-guild.sh
# mainnet
deploy-mainnet: export ETH_RPC_URL = $(call network,mainnet)
deploy-mainnet: check-api-key deploy
deploy-guild-mainnet: export ETH_RPC_URL = $(call network, mainnet)
deploy-guild-mainnet: check-api-key deploy-guild
# rinkeby
deploy-rinkeby: export ETH_RPC_URL = $(call network,rinkeby)
deploy-rinkeby: check-api-key deploy
deploy-guild-rinkeby: export ETH_RPC_URL = $(call network, mainnet)
deploy-guild-rinkeby: check-api-key deploy-guild
check-api-key:
ifndef ALCHEMY_API_KEY
$(error ALCHEMY_API_KEY is undefined)
endif
# Returns the URL to deploy to a hosted node.
# Requires the ALCHEMY_API_KEY env var to be set.
# The first argument determines the network (mainnet / rinkeby / ropsten / kovan / goerli)
define network
https://eth-$1.alchemyapi.io/v2/${ALCHEMY_API_KEY}
endef