Initial commit: add .gitignore and README
Some checks failed
CI / lint-and-test (push) Has been cancelled

This commit is contained in:
defiQUG
2026-02-09 21:51:53 -08:00
commit c94eb595f8
120 changed files with 22079 additions and 0 deletions

102
scripts/check-setup.sh Executable file
View File

@@ -0,0 +1,102 @@
#!/bin/bash
# Setup verification script
# Checks if all required dependencies and configurations are in place
set -e
echo "🔍 Checking Solace Treasury DApp setup..."
echo ""
# Check Node.js
if command -v node &> /dev/null; then
NODE_VERSION=$(node --version)
echo "✅ Node.js: $NODE_VERSION"
else
echo "❌ Node.js not found. Please install Node.js >= 18.0.0"
exit 1
fi
# Check pnpm
if command -v pnpm &> /dev/null; then
PNPM_VERSION=$(pnpm --version)
echo "✅ pnpm: $PNPM_VERSION"
else
echo "❌ pnpm not found. Install with: npm install -g pnpm"
exit 1
fi
# Check PostgreSQL
if command -v psql &> /dev/null; then
echo "✅ PostgreSQL: $(psql --version | head -n1)"
else
echo "⚠️ PostgreSQL not found (required for database)"
fi
# Check if dependencies are installed
if [ -d "node_modules" ]; then
echo "✅ Dependencies installed"
else
echo "❌ Dependencies not installed. Run: pnpm install"
exit 1
fi
# Check contracts compilation
if [ -d "contracts/artifacts" ]; then
echo "✅ Contracts compiled"
else
echo "⚠️ Contracts not compiled. Run: cd contracts && pnpm run compile"
fi
# Check environment files
echo ""
echo "📋 Environment files:"
if [ -f "frontend/.env.local" ] || [ -f "frontend/.env" ]; then
echo "✅ Frontend env file exists"
else
echo "⚠️ Frontend .env.local not found (create from template)"
fi
if [ -f "backend/.env" ]; then
echo "✅ Backend env file exists"
else
echo "⚠️ Backend .env not found (create from template)"
fi
if [ -f "contracts/.env" ]; then
echo "✅ Contracts env file exists"
else
echo "⚠️ Contracts .env not found (create from template)"
fi
# Check database migrations
if [ -d "backend/drizzle" ] && [ "$(ls -A backend/drizzle/*.sql 2>/dev/null)" ]; then
echo "✅ Database migrations generated"
else
echo "⚠️ Database migrations not generated. Run: cd backend && pnpm run db:generate"
fi
# Check if database is accessible (if DATABASE_URL is set)
if [ -f "backend/.env" ]; then
source backend/.env
if [ -n "$DATABASE_URL" ]; then
if command -v psql &> /dev/null; then
if psql "$DATABASE_URL" -c "SELECT 1;" &> /dev/null; then
echo "✅ Database connection successful"
else
echo "⚠️ Database connection failed (check DATABASE_URL)"
fi
fi
fi
fi
echo ""
echo "✨ Setup check complete!"
echo ""
echo "Next steps:"
echo "1. Create .env files if missing"
echo "2. Set up database: cd backend && pnpm run db:migrate"
echo "3. Deploy contracts: cd contracts && pnpm run deploy:sepolia"
echo "4. Start dev servers: pnpm run dev"

114
scripts/setup-chain138.sh Executable file
View File

@@ -0,0 +1,114 @@
#!/usr/bin/env bash
# Setup script for Chain 138 configuration
# This script helps configure the DApp for Chain 138 deployment
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
echo "=========================================="
echo "Chain 138 Configuration Setup"
echo "=========================================="
echo ""
# Chain 138 RPC endpoints
RPC_URL="${CHAIN138_RPC_URL:-http://192.168.11.250:8545}"
WS_URL="${CHAIN138_WS_URL:-ws://192.168.11.250:8546}"
echo "Chain 138 RPC URL: $RPC_URL"
echo "Chain 138 WS URL: $WS_URL"
echo ""
# Check if contracts are deployed
DEPLOYMENT_FILE="$PROJECT_ROOT/contracts/deployments/chain138.json"
if [[ -f "$DEPLOYMENT_FILE" ]]; then
echo "Found deployment file: $DEPLOYMENT_FILE"
TREASURY_ADDRESS=$(jq -r '.contracts.TreasuryWallet' "$DEPLOYMENT_FILE" 2>/dev/null || echo "")
FACTORY_ADDRESS=$(jq -r '.contracts.SubAccountFactory' "$DEPLOYMENT_FILE" 2>/dev/null || echo "")
if [[ -n "$TREASURY_ADDRESS" && "$TREASURY_ADDRESS" != "null" ]]; then
echo "Treasury Wallet Address: $TREASURY_ADDRESS"
fi
if [[ -n "$FACTORY_ADDRESS" && "$FACTORY_ADDRESS" != "null" ]]; then
echo "SubAccount Factory Address: $FACTORY_ADDRESS"
fi
echo ""
fi
# Create frontend .env.production template
echo "Creating frontend/.env.production template..."
cat > "$PROJECT_ROOT/frontend/.env.production.template" <<EOF
# Chain 138 Configuration
NEXT_PUBLIC_CHAIN138_RPC_URL=$RPC_URL
NEXT_PUBLIC_CHAIN138_WS_URL=$WS_URL
NEXT_PUBLIC_CHAIN_ID=138
# Contract Addresses (update after deployment)
NEXT_PUBLIC_TREASURY_WALLET_ADDRESS=${TREASURY_ADDRESS:-}
NEXT_PUBLIC_SUB_ACCOUNT_FACTORY_ADDRESS=${FACTORY_ADDRESS:-}
# WalletConnect
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id
# Backend API
NEXT_PUBLIC_API_URL=http://192.168.11.61:3001
EOF
# Create backend .env template
echo "Creating backend/.env template..."
cat > "$PROJECT_ROOT/backend/.env.template" <<EOF
# Database Configuration
DATABASE_URL=postgresql://solace_user:your_password@192.168.11.62:5432/solace_treasury
# Chain 138 Configuration
RPC_URL=$RPC_URL
CHAIN_ID=138
CONTRACT_ADDRESS=${TREASURY_ADDRESS:-}
# Server Configuration
PORT=3001
NODE_ENV=production
EOF
# Create backend .env.indexer template
echo "Creating backend/.env.indexer template..."
cat > "$PROJECT_ROOT/backend/.env.indexer.template" <<EOF
# Database Configuration
DATABASE_URL=postgresql://solace_user:your_password@192.168.11.62:5432/solace_treasury
# Chain 138 Configuration
RPC_URL=$RPC_URL
CHAIN_ID=138
CONTRACT_ADDRESS=${TREASURY_ADDRESS:-}
# Indexer Configuration
START_BLOCK=0
EOF
echo ""
echo "=========================================="
echo "Configuration Templates Created"
echo "=========================================="
echo ""
echo "Templates created:"
echo " - frontend/.env.production.template"
echo " - backend/.env.template"
echo " - backend/.env.indexer.template"
echo ""
echo "Next steps:"
echo "1. Copy templates to actual .env files:"
echo " cp frontend/.env.production.template frontend/.env.production"
echo " cp backend/.env.template backend/.env"
echo " cp backend/.env.indexer.template backend/.env.indexer"
echo ""
echo "2. Update the .env files with:"
echo " - WalletConnect project ID"
echo " - Database password"
echo " - Contract addresses (if deployed)"
echo ""
echo "3. Deploy contracts (if not already deployed):"
echo " cd contracts && pnpm run deploy:chain138"
echo ""
echo "4. Update .env files with deployed contract addresses"