forked from Swalla-Enterprise-Solutions/Decentralized-Ajo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify-setup.sh
More file actions
142 lines (123 loc) · 6.38 KB
/
Copy pathverify-setup.sh
File metadata and controls
142 lines (123 loc) · 6.38 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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/usr/bin/env bash
# AjoFactory Deployment Setup Verification Script
# This script verifies that all deployment files have been created correctly
set -e
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ AjoFactory Deployment Setup Verification ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
# Color codes
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Initialize counters
total=0
found=0
# Function to check file exists
check_file() {
local file=$1
local description=$2
total=$((total + 1))
if [ -f "$file" ]; then
echo -e "${GREEN}✓${NC} $description"
echo " → $file"
found=$((found + 1))
else
echo -e "${RED}✗${NC} $description"
echo " → $file (NOT FOUND)"
fi
}
# Function to check directory exists
check_dir() {
local dir=$1
local description=$2
total=$((total + 1))
if [ -d "$dir" ]; then
echo -e "${GREEN}✓${NC} $description"
echo " → $dir"
found=$((found + 1))
else
echo -e "${RED}✗${NC} $description"
echo " → $dir (NOT FOUND)"
fi
}
echo "📋 Checking configuration files..."
echo "─────────────────────────────────────────────────────────────────"
check_file "hardhat.config.ts" "Hardhat configuration"
check_file ".env.example" "Environment template"
check_file "tsconfig.json" "TypeScript configuration"
check_file "package.json" "Package configuration (with Hardhat scripts)"
echo ""
echo "📝 Checking smart contracts..."
echo "─────────────────────────────────────────────────────────────────"
check_file "contracts/ethereum/AjoFactory.sol" "AjoFactory smart contract"
echo ""
echo "🚀 Checking deployment scripts..."
echo "─────────────────────────────────────────────────────────────────"
check_file "scripts/deploy.ts" "Main deployment script"
check_file "scripts/check-deployment.ts" "Deployment status checker"
echo ""
echo "🧪 Checking test files..."
echo "─────────────────────────────────────────────────────────────────"
check_file "test/AjoFactory.test.ts" "Unit tests for AjoFactory"
echo ""
echo "📚 Checking utility files..."
echo "─────────────────────────────────────────────────────────────────"
check_file "lib/deployment-utils.ts" "Deployment utility functions"
echo ""
echo "📖 Checking documentation..."
echo "─────────────────────────────────────────────────────────────────"
check_file "DEPLOYMENT_SEPOLIA.md" "Complete deployment guide"
check_file "DEPLOYMENT_WORKFLOW.md" "Quick reference guide"
check_file "FRONTEND_INTEGRATION.md" "Frontend integration guide"
check_file "DEPLOYMENT_COMPLETE.md" "Setup summary"
echo ""
echo "📁 Checking directories..."
echo "─────────────────────────────────────────────────────────────────"
check_dir "contracts/ethereum" "Ethereum contracts directory"
check_dir "scripts" "Deployment scripts directory"
check_dir "test" "Test directory"
check_dir "frontend/constants/deployments" "Frontend deployment constants"
check_dir "deployments" "Local deployments tracking directory"
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ Verification Results ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
if [ $found -eq $total ]; then
echo -e "${GREEN}✅ All files and directories present!${NC}"
echo " ($found/$total items found)"
else
echo -e "${YELLOW}⚠️ Some files are missing${NC}"
echo " ($found/$total items found)"
fi
echo ""
echo "📋 Next Steps:"
echo "─────────────────────────────────────────────────────────────────"
echo "1. Install dependencies:"
echo " ${YELLOW}pnpm install${NC}"
echo ""
echo "2. Configure environment:"
echo " ${YELLOW}cp .env.example .env${NC}"
echo " Edit .env with your credentials"
echo ""
echo "3. Get testnet ETH:"
echo " Visit: https://sepoliafaucet.com/"
echo ""
echo "4. Deploy to Sepolia:"
echo " ${YELLOW}pnpm contract:deploy:sepolia${NC}"
echo ""
echo "5. Check deployment status:"
echo " ${YELLOW}npx hardhat run scripts/check-deployment.ts --network sepolia${NC}"
echo ""
echo "6. Read documentation:"
echo " - DEPLOYMENT_SEPOLIA.md (Complete guide)"
echo " - DEPLOYMENT_WORKFLOW.md (Quick reference)"
echo " - FRONTEND_INTEGRATION.md (Frontend guide)"
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ Ready to deploy! 🚀 ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""