-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlocal_deploy.sh
More file actions
executable file
·57 lines (47 loc) · 1.94 KB
/
local_deploy.sh
File metadata and controls
executable file
·57 lines (47 loc) · 1.94 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
dfx stop
dfx start --clean --background
#create new identities
dfx identity new minter
dfx identity new archive_controller
# Set principal variables
DEFAULT=$(dfx identity get-principal --identity default)
MINTER=$(dfx identity get-principal --identity minter)
CONTROLLER=$(dfx identity get-principal --identity archive_controller)
dfx deploy ProcurePact_backend
BACKEND=$(dfx canister id ProcurePact_backend)
# Deploy the ICRC-1 ledger canister
dfx deploy icrc1_ledger_canister --argument "(variant { Init = record {
token_symbol = \"KEST\";
token_name = \"Tether KE\";
minting_account = record { owner = principal \"$MINTER\" };
transfer_fee = 10_000;
metadata = vec {};
feature_flags = opt record { icrc2 = true };
initial_balances = vec {
record { record { owner = principal \"$DEFAULT\"; }; 10_000_000_000; };
record { record { owner = principal \"$BACKEND\"; }; 50_000_000_000; };
};
archive_options = record {
num_blocks_to_archive = 1000;
trigger_threshold = 2000;
controller_id = principal \"$CONTROLLER\";
cycles_for_archive_creation = opt 10000000000000;
};
}})"
# Get the deployed ledger canister ID
LEDGER=$(dfx canister id icrc1_ledger_canister)
# Deploy the index canister, referencing the ledger canister principal
#index canister is used to query ledger transactions
dfx deploy icrc1_index_canister --argument "(opt variant { Init = record { ledger_id = principal \"$LEDGER\"; retrieve_blocks_from_ledger_interval_seconds = opt 10; } })"
# Deploy other canisters
dfx deploy escrow
dfx deploy invoice
dfx deploy credit
dfx deploy internet_identity
dfx deploy ProcurePact_frontend
#fund escrow canister with operating tokens
ESCROW=$(dfx canister id escrow)
CREDIT=$(dfx canister id credit)
dfx canister call ProcurePact_backend transfer "(principal \"$ESCROW\", 1000000)"
#fund credit canister
dfx canister call ProcurePact_backend transfer "(principal \"$CREDIT\", 1000000)"