Skip to content

Commit

Permalink
Create wallet canister sequentially
Browse files Browse the repository at this point in the history
  • Loading branch information
dskloetd committed Nov 4, 2024
1 parent 8bc4d2d commit 041125e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 5 additions & 1 deletion bin/dfx-sns-demo-mksns-parallel
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ create_all_sns() {
PROCESSES=()
echo "I am $$"
for ((i = 0; i < NUM_SNS_TO_MAKE; i++)); do
# Creating wallet canisters in parallel started occasionally failing with
# 0.24.1. When creating 10 in parallel, almost always at least 1 would fail.
# So we create the users outside the background process.
DEMO_USER="snsdemo_$i"
make_user "$DEMO_USER"
(
echo "Starting $BASHPID"
DEMO_USER="snsdemo_$i"
make_user "$DEMO_USER"
become_user "$DEMO_USER"

./bin/dfx-sns-demo-mksns-config --config_index $((CONFIG_INDEX_OFFSET + i)) --unique_logo "$UNIQUE_LOGO"
Expand Down
7 changes: 0 additions & 7 deletions bin/dfx-sns-import-by-proposal
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ for ((try = 20; try > 0; try--)); do
sleep 2
done

list_root_canister_id() {
dfx canister call nns-sns-wasm list_deployed_snses '(record{})' | idl2json | jq -r '.instances[] | .root_canister_id[0]'
}

echo "Current $(list_root_canister_id | wc -l) existing SNS root canister Ids:"
list_root_canister_id

if [[ "$SUCCESS" = "false" ]]; then
echo "Failed to import SNS canisters for proposal $PROPOSAL_ID" >&2
exit 1
Expand Down
7 changes: 7 additions & 0 deletions bin/dfx-stock-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ if [ "${PARALLEL_SNS_COUNT:-0}" -gt 0 ]; then
dfx-sns-demo-mksns-parallel --network "$DFX_NETWORK" --num_sns "$PARALLEL_SNS_COUNT" --majority snsdemo8 --config_index_offset 2 --unique_logo "$UNIQUE_LOGO"
fi

SNS_COUNT="$(dfx canister call nns-sns-wasm list_deployed_snses '(record{})' | idl2json | jq -r '.instances | length')"
EXPECTED_SNS_COUNT="$((2 + PARALLEL_SNS_COUNT))"
if [[ "$SNS_COUNT" != "$EXPECTED_SNS_COUNT" ]]; then
echo "❌ Expected $EXPECTED_SNS_COUNT SNSes. Found $SNS_COUNT"
exit 1
fi

: Set up ckbtc canisters
dfx-ckbtc-import --prefix ckbtc_
dfx-ckbtc-deploy --prefix ckbtc_ --network "$DFX_NETWORK" --yes
Expand Down

0 comments on commit 041125e

Please sign in to comment.