forked from cosmos/ledger-cosmos-obsolete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
120 lines (97 loc) · 4.12 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
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
#*******************************************************************************
#* (c) 2019 ZondaX GmbH
#*
#* 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.
#********************************************************************************
.PHONY: all deps build clean load delete
LEDGER_COSMOS_SRC=$(CURDIR)/src/ledger-user
LEDGER_TENDERMINT_SRC=$(CURDIR)/src/ledger-val
DOCKER_IMAGE=zondax/ledger-docker-bolos
DOCKER_BOLOS_SDK=/project/deps/nanos-secure-sdk
DOCKER_IMAGE=zondax/ledger-docker-bolos
DOCKER_BOLOS_SDK=/project/deps/nanos-secure-sdk
DOCKER_IMAGE2=zondax/ledger_bolos2
DOCKER_BOLOS_SDK2=/project/deps/nano2-sdk
SCP_PUBKEY=049bc79d139c70c83a4b19e8922e5ee3e0080bb14a2e8b0752aa42cda90a1463f689b0fa68c1c0246845c2074787b649d0d8a6c0b97d4607065eee3057bdf16b83
SCP_PRIVKEY=ff701d781f43ce106f72dc26a46b6a83e053b5d07bb3d4ceab79c91ca822a66b
all: build
deps:
@echo "Install dependencies"
$(CURDIR)/src/install_deps.sh
build_sandblock:
docker run -i --rm \
-e BOLOS_SDK=$(DOCKER_BOLOS_SDK) -e BOLOS_ENV=/opt/bolos \
-u $(shell id -u) -v $(shell pwd):/project \
$(DOCKER_IMAGE) \
make -C /project/src/ledger-user
build_sandblock2:
docker run -i --rm \
-e BOLOS_SDK=$(DOCKER_BOLOS_SDK2) -e BOLOS_ENV=/opt/bolos \
-u $(shell id -u) -v $(shell pwd):/project \
$(DOCKER_IMAGE2) \
make -C /project/src/ledger-user
build_tendermint:
docker run -i --rm \
-e BOLOS_SDK=$(DOCKER_BOLOS_SDK) -e BOLOS_ENV=/opt/bolos \
-u $(shell id -u) -v $(shell pwd):/project \
$(DOCKER_IMAGE) \
make -C /project/src/ledger-val
build_tendermint2:
docker run -i --rm \
-e BOLOS_SDK=$(DOCKER_BOLOS_SDK2) -e BOLOS_ENV=/opt/bolos \
-u $(shell id -u) -v $(shell pwd):/project \
$(DOCKER_IMAGE2) \
make -C /project/src/ledger-val
clean_sandblock:
BOLOS_SDK=$(CURDIR)/deps/nanos-secure-sdk BOLOS_ENV=/opt/bolos \
make -C $(LEDGER_COSMOS_SRC) clean
clean_tendermint:
BOLOS_SDK=$(CURDIR)/deps/nanos-secure-sdk BOLOS_ENV=/opt/bolos \
make -C $(LEDGER_TENDERMINT_SRC) clean
load_sandblock: build_sandblock
SCP_PRIVKEY=$(SCP_PRIVKEY) \
BOLOS_SDK=$(CURDIR)/deps/nanos-secure-sdk BOLOS_ENV=/opt/bolos \
make -C $(LEDGER_COSMOS_SRC) load
load_sandblock2: build_sandblock2
SCP_PRIVKEY=$(SCP_PRIVKEY) \
BOLOS_SDK=$(CURDIR)/deps/nano2-sdk BOLOS_ENV=/opt/bolos \
make -C $(LEDGER_COSMOS_SRC) load
load_tendermint: build_tendermint
SCP_PRIVKEY=$(SCP_PRIVKEY) \
BOLOS_SDK=$(CURDIR)/deps/nanos-secure-sdk BOLOS_ENV=/opt/bolos \
make -C $(LEDGER_TENDERMINT_SRC) load
load_tendermint2: build_tendermint2
SCP_PRIVKEY=$(SCP_PRIVKEY) \
BOLOS_SDK=$(CURDIR)/deps/nano2-sdk BOLOS_ENV=/opt/bolos \
make -C $(LEDGER_TENDERMINT_SRC) load
delete_sandblock:
SCP_PRIVKEY=$(SCP_PRIVKEY) \
BOLOS_SDK=$(CURDIR)/deps/nanos-secure-sdk BOLOS_ENV=/opt/bolos \
make -C $(LEDGER_COSMOS_SRC) delete
delete_tendermint:
SCP_PRIVKEY=$(SCP_PRIVKEY) \
BOLOS_SDK=$(CURDIR)/deps/nanos-secure-sdk BOLOS_ENV=/opt/bolos \
make -C $(LEDGER_TENDERMINT_SRC) delete
# This target will initialize the device with the integration testing mnemonic
dev_init:
@echo "Initializing device with test mnemonic! WARNING TAKES 2 MINUTES AND REQUIRES RECOVERY MODE"
@python -m ledgerblue.hostOnboard --apdu --id 0 --prefix "" --passphrase "" --pin 5555 --words "equip will roof matter pink blind book anxiety banner elbow sun young"
# This target will setup a custom developer certificate
dev_ca:
@python -m ledgerblue.setupCustomCA --targetId 0x31100004 --public $(SCP_PUBKEY) --name zondax
dev_ca_delete:
@python -m ledgerblue.resetCustomCA --targetId 0x31100004
clean: clean_sandblock clean_tendermint
build: build_sandblock build_tendermint
load: build load_sandblock load_tendermint
delete: delete_sandblock delete_tendermint