-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
52 lines (37 loc) · 1.77 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
export SHELL:=/bin/bash
.PHONY: install-deps gen-wallet set-cluster-url show-network-config
export RENEC_TESTNET_URL:= https://api-testnet.renec.foundation:8899/
export RENEC_MAINNET_URL:= https://api-mainnet-beta.renec.foundation:8899/
export RENEC_LOCALNET_URL:= http:https://127.0.0.1:8899
export PATH:=$(HOME)/.local/share/solana/install/active_release/bin:$(PATH)
CLUSTER ?= testnet
export WALLET_PATH:=.wallets
export PROGRAM_NAME?=dapp-starter
export CLUSTER_URL := $(if $(filter testnet,$(CLUSTER)),$(RENEC_TESTNET_URL),\
$(if $(filter mainnet,$(CLUSTER)),$(RENEC_MAINNET_URL),\
$(if $(filter localnet,$(CLUSTER)),$(RENEC_LOCALNET_URL),\
$(error Unknown cluster name: $(CLUSTER)))))
export CLI_VERSION := $(if $(filter testnet,$(CLUSTER)),1.14.6,$(if $(filter mainnet,$(CLUSTER)),1.9.29,$(if $(filter localnet,$(CLUSTER)),1.9.29,$(error Unknown cluster name: $(CLUSTER)))))
show-network-config:
@echo "interacting with cluster: $(CLUSTER_URL), CLI_VERSION: $(CLI_VERSION)"
install-deps: show-network-config
@. ./dev-scripts/install-program-deps.sh
localnet:
@$(MAKE) install-deps CLI_VERSION=1.9.29
solana-test-validator --reset
gen-wallet: install-deps
@./dev-scripts/gen-wallet.sh "$(name)"
import-wallet: install-deps
./dev-scripts/import-wallet.sh "$(name)"
faucet:
@$(MAKE) install-deps CLI_VERSION=$(CLI_VERSION)
@./dev-scripts/faucet.sh --name "$(name)" $(amount)
build:
@$(MAKE) install-deps CLI_VERSION=1.14.6 ANCHOR_VERSION=0.25.0
@./dev-scripts/build.sh
deploy: set-cluster-url
@$(MAKE) install-deps CLI_VERSION=$(CLI_VERSION)
@./dev-scripts/deploy.sh "$(name)"
port-dapp:
@$(MAKE) install-deps CLI_VERSION=$(CLI_VERSION)
@./dev-scripts/port-program.sh "$(program_file_path)" "$(keypair_path)" "$(program_id_keypair)"