···23lexdir := "../lexicons"
40005lexgen:
6 go run ./cmd/lexgen/ --build-file cmd/lexgen/vylet.json {{lexdir}}
78cborgen:
9 go run ./gen
0000000000000000000000000
···23lexdir := "../lexicons"
45+default:
6+ @just --list
7+8lexgen:
9 go run ./cmd/lexgen/ --build-file cmd/lexgen/vylet.json {{lexdir}}
1011cborgen:
12 go run ./gen
13+14+migrate-up:
15+ go run ./cmd/database/migrate up
16+17+migrate-down:
18+ go run ./cmd/database/migrate down
19+20+migrate-create name:
21+ #!/usr/bin/env bash
22+ timestamp=$(date +%s)
23+ touch migrations/${timestamp}_{{name}}.up.cql
24+ touch migrations/${timestamp}_{{name}}.down.cql
25+ echo "Created migrations/${timestamp}_{{name}}.up.cql"
26+ echo "Created migrations/${timestamp}_{{name}}.down.cql"
27+28+deps:
29+ go mod download
30+ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
31+ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
32+33+cassandra-setup:
34+ ./scripts/setup-cassandra.sh
35+36+cassandra-shell:
37+ docker exec -it cassandra cqlsh
···1+CREATE TABLE IF NOT EXISTS profiles (
2+ did TEXT PRIMARY KEY,
3+ created_at TIMESTAMP,
4+ updated_at TIMESTAMP
5+);
+9
scripts/init.cql
···000000000
···1+-- Create keyspace if it doesn't exist
2+CREATE KEYSPACE IF NOT EXISTS vylet
3+WITH replication = {
4+ 'class': 'SimpleStrategy',
5+ 'replication_factor': 1
6+};
7+8+-- Use the keyspace
9+USE vylet;
+30
scripts/setup-cassandra.sh
···000000000000000000000000000000
···1+#!/bin/bash
2+3+echo "Waiting for Cassandra to be ready..."
4+max_attempts=30
5+attempt=0
6+7+while [ $attempt -lt $max_attempts ]; do
8+ if docker exec cassandra cqlsh -e "describe cluster" > /dev/null 2>&1; then
9+ echo "Cassandra is ready!"
10+ break
11+ fi
12+ attempt=$((attempt + 1))
13+ echo "Attempt $attempt/$max_attempts - Cassandra not ready yet..."
14+ sleep 2
15+done
16+17+if [ $attempt -eq $max_attempts ]; then
18+ echo "Cassandra failed to start within expected time"
19+ exit 1
20+fi
21+22+echo "Running initialization script..."
23+docker exec -i cassandra cqlsh < scripts/init.cql
24+25+echo "Cassandra setup complete!"
26+echo ""
27+echo "You can verify with:"
28+echo " docker exec -it cassandra cqlsh"
29+echo " USE vylet;"
30+echo " DESCRIBE TABLES;"