-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdirect-trigger-pause.sh
More file actions
executable file
·61 lines (51 loc) · 1.59 KB
/
direct-trigger-pause.sh
File metadata and controls
executable file
·61 lines (51 loc) · 1.59 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
58
59
60
61
#!/bin/bash
# Directly trigger Pause-with-DON workflow (bypass sentinel node)
# This calls the CRE CLI directly with the HTTP payload
#
# Usage: ./direct-trigger-pause.sh [fraud_score]
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# Load .env file if it exists
if [ -f ".env" ]; then
export $(cat .env | grep -v '^#' | xargs)
fi
FRAUD_SCORE="${1:-85}"
echo "================================================"
echo "🔴 Direct Pause Workflow Trigger"
echo "================================================"
echo ""
echo "Fraud Score: $FRAUD_SCORE"
echo ""
# Build HTTP payload
PAYLOAD=$(cat <<EOF
{
"action": "pause",
"target": "0xFA93de331FCd870D83C21A0275d8b3E7aA883F45",
"reason": "Test trigger - fraud detected",
"broadcast": true,
"metadata": {
"fraudScore": $FRAUD_SCORE,
"riskFactors": ["Large transfer", "Suspicious pattern", "Test trigger"],
"suspiciousTx": "0x0000000000000000000000000000000000000000000000000000000000000000",
"from": "0x1234567890123456789012345678901234567890",
"to": "0xFA93de331FCd870D83C21A0275d8b3E7aA883F45",
"value": "1000000000",
"timestamp": $(date +%s)
}
}
EOF
)
echo "Payload:"
echo "$PAYLOAD" | jq . 2>/dev/null || echo "$PAYLOAD"
echo ""
echo "Running: cre workflow simulate ..."
echo ""
cd /home/user/Desktop/Chainlink/sentinel
cre workflow simulate ./workflows/pause-with-don \
--target local-simulation \
--broadcast \
--http-payload "$PAYLOAD"
echo ""
echo "================================================"
echo "✅ Workflow triggered"
echo "================================================"