-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjunolator
executable file
·55 lines (48 loc) · 1.24 KB
/
junolator
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
#!/bin/bash
deploy () {
# Deploy II
# NNS-dapp expect II to be deployed locally with the ICP Index canister ID
dfx deploy internet_identity
# Deploy satellite
PRINCIPAL="$(dfx identity get-principal)"
dfx deploy satellite --specified-id jx5yt-yyaaa-aaaal-abzbq-cai --argument "$(didc encode '(record {controllers = vec { principal"'${PRINCIPAL}'";}})' --format hex)" --argument-type raw
II="$(dfx canister id internet_identity)"
SAT="$(dfx canister id satellite)"
echo -e "\n**************************************************"
echo -e "* Satellite: ${SAT} *"
echo -e "* Internet identity: ${II} *"
echo -e "**************************************************"
}
init() {
# Init .env file with location to identity (if file does not exist yet)
if [[ ! -e .env ]]; then
IDENTITY="$(dfx identity whoami)"
echo "DFX_IDENTITY_PEM_PATH=${HOME}/.config/dfx/identity/${IDENTITY}/identity.pem" > .env
fi
}
install() {
npm ci
}
case $1 in
start)
dfx start
;;
stop)
dfx stop
;;
deploy)
init
install
deploy
node scripts/collections.mjs
;;
upgrade)
node scripts/upgrade.mjs
;;
config)
node scripts/collections.mjs
;;
ctrl)
node scripts/controllers.mjs
;;
esac