Skip to content

Commit d9e1c34

Browse files
committed
wip
1 parent 7b32223 commit d9e1c34

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

frost-client/examples/dkg_example/dkg_example.sh

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ GROUP_NAME="Alice, Bob and Eve"
7474
BOB_PUBLIC_KEY=$(echo "$CONTACTS_OUTPUT" | grep -A1 "Name: Bob" | grep "Public Key:" | cut -d' ' -f3)
7575
EVE_PUBLIC_KEY=$(echo "$CONTACTS_OUTPUT" | grep -A1 "Name: Eve" | grep "Public Key:" | cut -d' ' -f3)
7676

77-
# Run DKG processes
77+
# Run DKG processes with proper timing
78+
echo "Starting Alice (coordinator) DKG process..."
7879
use_frost_client dkg \
7980
-d "$GROUP_NAME" \
8081
-s "$SERVER_URL" \
@@ -83,20 +84,32 @@ use_frost_client dkg \
8384
-c "$GENERATED_DIR/alice.toml" &
8485
ALICE_DKG_PID=$!
8586

87+
# Give Alice time to create the DKG session
88+
echo "Waiting for Alice to create DKG session..."
89+
sleep 5
90+
91+
echo "Starting Bob DKG process..."
8692
use_frost_client dkg \
8793
-d "$GROUP_NAME" \
8894
-s "$SERVER_URL" \
8995
-t 2 \
9096
-c "$GENERATED_DIR/bob.toml" &
9197
BOB_DKG_PID=$!
9298

99+
# Brief delay before starting Eve
100+
sleep 2
101+
102+
echo "Starting Eve DKG process..."
93103
use_frost_client dkg \
94104
-d "$GROUP_NAME" \
95105
-s "$SERVER_URL" \
96106
-t 2 \
97107
-c "$GENERATED_DIR/eve.toml" &
98108
EVE_DKG_PID=$!
99109

110+
echo "Waiting for DKG processes to complete..."
111+
echo "This may take up to 2-3 minutes..."
112+
100113
# Wait for completion
101114
wait $ALICE_DKG_PID
102115
ALICE_EXIT=$?
@@ -109,11 +122,30 @@ EVE_EXIT=$?
109122
if [ $ALICE_EXIT -eq 0 ] && [ $BOB_EXIT -eq 0 ] && [ $EVE_EXIT -eq 0 ]; then
110123
echo "✅ DKG completed successfully!"
111124

125+
# Validate that DKG actually worked by checking for group keys
126+
echo "Validating DKG results..."
127+
for config in "$GENERATED_DIR/alice.toml" "$GENERATED_DIR/bob.toml" "$GENERATED_DIR/eve.toml"; do
128+
if ! grep -q "key_package" "$config" 2>/dev/null; then
129+
echo "❌ DKG validation failed: $config missing key_package" >&2
130+
exit 1
131+
fi
132+
if ! grep -q "public_key_package" "$config" 2>/dev/null; then
133+
echo "❌ DKG validation failed: $config missing public_key_package" >&2
134+
exit 1
135+
fi
136+
done
137+
112138
# Show one group info as confirmation
113139
GROUP_INFO=$(use_frost_client groups -c "$GENERATED_DIR/alice.toml" | head -2)
114140
echo "$GROUP_INFO"
115141
echo "📁 Config files saved to: $GENERATED_DIR/"
116142
else
117143
echo "❌ DKG failed (exit codes: A=$ALICE_EXIT, B=$BOB_EXIT, E=$EVE_EXIT)"
144+
145+
# Print some debug info to help diagnose the issue
146+
echo "Debug info:"
147+
echo "Alice config exists: $(test -f "$GENERATED_DIR/alice.toml" && echo "yes" || echo "no")"
148+
echo "Bob config exists: $(test -f "$GENERATED_DIR/bob.toml" && echo "yes" || echo "no")"
149+
echo "Eve config exists: $(test -f "$GENERATED_DIR/eve.toml" && echo "yes" || echo "no")"
118150
exit 1
119151
fi

frost-client/examples/helpers/use_frost_client.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ use_frost_client() {
99
echo "Error: frost-client command failed with arguments: $*" >&2
1010
return 1
1111
fi
12-
sleep 3
1312
}

frost-client/examples/signing_example/signing_example.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ use_frost_client coordinator \
100100
COORDINATOR_PID=$!
101101

102102
# Give coordinator time to create the signing session
103-
sleep 2
103+
echo "Waiting for coordinator to create signing session..."
104+
sleep 5
104105

105106
echo "Starting participant (Bob)..."
106107
echo "y" | use_frost_client participant \

0 commit comments

Comments
 (0)