-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquickstart.sh
More file actions
executable file
·79 lines (64 loc) · 2 KB
/
quickstart.sh
File metadata and controls
executable file
·79 lines (64 loc) · 2 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
#!/bin/bash
# Quick Start Script for Canonical Transaction Gateway
set -e
echo "🚀 Starting Canonical Transaction Gateway..."
# Check prerequisites
echo "Checking prerequisites..."
if ! command -v docker &> /dev/null; then
echo "❌ Docker is not installed. Please install Docker first."
exit 1
fi
if ! command -v docker-compose &> /dev/null; then
echo "❌ Docker Compose is not installed. Please install Docker Compose first."
exit 1
fi
if ! command -v go &> /dev/null; then
echo "❌ Go is not installed. Please install Go 1.21 or higher."
exit 1
fi
echo "✅ Prerequisites met"
# Install Go dependencies
echo "📦 Installing Go dependencies..."
go mod download
# Generate protobuf code
echo "🔨 Generating protobuf code..."
if ! command -v protoc &> /dev/null; then
echo " protoc not found. Installing protoc-gen-go..."
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
else
make proto
fi
# Build the gateway
echo "Building gateway..."
make build
# Start infrastructure services
echo "Starting infrastructure services (Redis, Kafka, Jaeger, etc.)..."
cd docker
docker-compose up -d redis postgres kafka jaeger prometheus grafana
cd ..
# Wait for services to be ready
echo "⏳ Waiting for services to be ready..."
sleep 10
# Check service health
echo "🏥 Checking service health..."
docker-compose -f docker/docker-compose.yml ps
echo ""
echo "Infrastructure services are running!"
echo ""
echo "Access the following services:"
echo " - Jaeger UI (Tracing): http://localhost:16686"
echo " - Prometheus: http://localhost:9091"
echo " - Grafana: http://localhost:3000 (admin/admin123)"
echo " - Redis: localhost:6379"
echo " - Kafka: localhost:9092"
echo ""
echo "To start the gateway:"
echo " ./bin/gateway --config configs/gateway.yaml"
echo ""
echo "To run tests:"
echo " make test"
echo ""
echo "To stop all services:"
echo " docker-compose -f docker/docker-compose.yml down"
echo ""