forked from DUST-COIN/DSTC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
local_ledger.sh
executable file
·94 lines (77 loc) · 3.64 KB
/
local_ledger.sh
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
# #!/bin/bash
# # Step 1: Set up identities
# dfx identity new minter
# dfx identity use minter
# export MINTER=$(dfx identity get-principal)
# export TOKEN_NAME="DUST"
# export TOKEN_SYMBOL="DSTC"
# export TOKEN_IMAGE_URL="https://github.com/amschel99/DSTC/blob/master/src/DSTC_frontend/public/logo.jpeg" # Replace with actual image URL
# dfx identity use default
# export DEFAULT=$(dfx identity get-principal)
# export PRE_MINTED_TOKENS=1_000_000_000_000 # Set pre-minted token amount
# export TRANSFER_FEE=1_000 # Set transfer fee
# dfx identity new archive_controller
# dfx identity use archive_controller
# export ARCHIVE_CONTROLLER=$(dfx identity get-principal)
# export TRIGGER_THRESHOLD=10000
# export NUM_OF_BLOCK_TO_ARCHIVE=5000
# export CYCLE_FOR_ARCHIVE_CREATION=1000000000000
# export FEATURE_FLAGS=true # Enable feature flags
# # Step 2: Deploy the canister with automated arguments
# dfx deploy icrc1_ledger_canister --network ic --argument "(variant { Init = record {
# token_symbol = \"${TOKEN_SYMBOL}\";
# token_name = \"${TOKEN_NAME}\";
# minting_account = record { owner = principal \"${MINTER}\" };
# transfer_fee = ${TRANSFER_FEE};
# metadata = vec {
# record { key = \"description\"; value = \"This is the DUST token.\" };
# record { key = \"image\"; value = \"${TOKEN_IMAGE_URL}\" }
# };
# feature_flags = opt record { icrc2 = ${FEATURE_FLAGS} };
# initial_balances = vec { record { record { owner = principal \"${DEFAULT}\" }; ${PRE_MINTED_TOKENS} } };
# archive_options = record {
# num_blocks_to_archive = ${NUM_OF_BLOCK_TO_ARCHIVE};
# trigger_threshold = ${TRIGGER_THRESHOLD};
# controller_id = principal \"${ARCHIVE_CONTROLLER}\";
# cycles_for_archive_creation = opt ${CYCLE_FOR_ARCHIVE_CREATION};
# };
# }})"
# # Step 3: Verify deployment (optional)
# # You can add verification commands here if necessary
# echo "Deployment to mainnet complete."
#!/bin/bash
dfx identity new minter
dfx identity use minter
export MINTER=$(dfx identity get-principal)
export TOKEN_NAME="DUST" # Change the token name here
export TOKEN_SYMBOL="DSTC" # Change token symbol here
export TOKEN_IMAGE_URL="https://github.com/amschel99/DSTC/blob/master/src/DSTC_frontend/public/logo.jpeg"
dfx identity use default
export DEFAULT=$(dfx identity get-principal)
export PRE_MINTED_TOKENS=1_000_000_000_000 # Insert amount of pre minted tokens
export TRANSFER_FEE=1_000 # Insert the transfer fee
dfx identity new archive_controller
dfx identity use archive_controller
export ARCHIVE_CONTROLLER=$(dfx identity get-principal)
export TRIGGER_THRESHOLD=10000
export NUM_OF_BLOCK_TO_ARCHIVE=5000
export CYCLE_FOR_ARCHIVE_CREATION=1000000000000
export FEATURE_FLAGS=true # Set the feature flags to true
dfx deploy icrc1_ledger_canister --argument "(variant {Init =
record {
token_symbol = \"${TOKEN_SYMBOL}\";
token_name = \"${TOKEN_NAME}\";
minting_account = record { owner = principal \"${MINTER}\" };
transfer_fee = ${TRANSFER_FEE};
metadata = vec {};
feature_flags = opt record{icrc2 = ${FEATURE_FLAGS}};
initial_balances = vec { record { record { owner = principal \"${DEFAULT}\"; }; ${PRE_MINTED_TOKENS}; }; };
archive_options = record {
num_blocks_to_archive = ${NUM_OF_BLOCK_TO_ARCHIVE};
trigger_threshold = ${TRIGGER_THRESHOLD};
controller_id = principal \"${ARCHIVE_CONTROLLER}\";
cycles_for_archive_creation = opt ${CYCLE_FOR_ARCHIVE_CREATION};
};
}
})"
# ./did.sh && dfx generate test_token_1_backend && dfx deploy test_token_1_backend # Command for deploying canister one locally