Skip to content

Commit 1eb24ba

Browse files
committed
docs: add SQLite database setup for heartbeats processor
Add documentation and automation for SQLite database setup required by the heartbeats processor when running 'make check' or 'make lint'. Changes: - Added SQLite database setup section to developer documentation - Updated format-and-lint.sh script to automatically create the database - Referenced tools/heartbeats-processor/schema.sql for schema creation - Set DATABASE_URL environment variable as required by SQLx This prevents 'database connection failed' errors when developers run make check/lint commands.
1 parent a8b7165 commit 1eb24ba

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

website/docs/developers/getting-started.mdx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,24 @@ make clean # Clean build artifacts
155155

156156
### Environment Configuration
157157

158-
Some components require environment variables:
158+
Some components require environment variables and database setup:
159+
160+
#### SQLite Database (Required for `make check`)
161+
162+
The heartbeats processor requires an SQLite database to be initialized before
163+
running `make check`:
159164

160165
```bash
161-
# For SQLx database operations (heartbeats processor)
166+
# Create the SQLite database with required schema
167+
sqlite3 /tmp/heartbeats.db < tools/heartbeats-processor/schema.sql
168+
169+
# Set the database URL environment variable
162170
export DATABASE_URL="sqlite:///tmp/heartbeats.db"
171+
```
172+
173+
#### Additional Environment Variables
163174

175+
```bash
164176
# For archive node development
165177
export OPENMINA_ARCHIVE_ADDRESS="http://localhost:3007"
166178
export PG_USER="openmina"

website/docs/developers/scripts/setup/format-and-lint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Set up SQLite database for heartbeats processor (required for make check/lint)
2+
echo "Setting up SQLite database for heartbeats processor..."
3+
sqlite3 /tmp/heartbeats.db < tools/heartbeats-processor/schema.sql
4+
export DATABASE_URL="sqlite:///tmp/heartbeats.db"
5+
16
# Format code (required before commits)
27
echo "Formatting code..."
38
make format

0 commit comments

Comments
 (0)