Skip to content

Commit 3f3c19b

Browse files
committed
Update README in indexer package
1 parent 1412010 commit 3f3c19b

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

coffee_ws/src/sui_indexer/README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ The Sui Indexer node monitors and indexes events from a specified Sui package. I
88

99
## Database Location
1010

11-
For development, the SQLite database is stored in the package source directory as `sui_indexer.db`.
11+
**Development:** The SQLite database is stored in the workspace data directory at `<workspace_root>/data/sui_indexer/sui_indexer.db`. This ensures the database persists across `colcon build` cycles and is not affected by install directory changes.
1212

13-
For production deployments, you should specify an absolute path using the `database_url` parameter to ensure proper data persistence and access permissions.
13+
**Production:** You can specify an absolute path using the `database_url` parameter to ensure proper data persistence and access permissions for production deployments.
14+
15+
**Important:** The database location has been moved out of the install directory to prevent data loss during builds. The Prisma client is also generated locally within the workspace to avoid virtual environment pollution.
1416

1517
## Usage
1618

@@ -37,7 +39,7 @@ The following parameters can be configured when launching the indexer:
3739
- `network` (Optional, default: 'testnet'): Sui network to connect to (testnet, mainnet, devnet)
3840
- `polling_interval_ms` (Optional, default: 1000): Polling interval in milliseconds
3941
- `default_limit` (Optional, default: 50): Default limit for event queries
40-
- `database_url` (Optional, default: 'file:sui_indexer.db'): Database URL for the indexer. For production, use an absolute path (e.g., 'file:/var/lib/sui_indexer/sui_indexer.db')
42+
- `database_url` (Optional, default: workspace data directory): Database URL for the indexer. When not specified, defaults to `<workspace_root>/data/sui_indexer/sui_indexer.db`. For production, use an absolute path (e.g., 'file:/var/lib/sui_indexer/sui_indexer.db')
4143

4244
Example with multiple parameters:
4345
```bash
@@ -52,4 +54,12 @@ ros2 launch sui_indexer indexer.launch.py \
5254

5355
The indexer publishes to the following topics:
5456
- `/sui_events`: Published events from the Sui blockchain
55-
- `/indexer_status`: Status updates from the indexer
57+
- `/indexer_status`: Status updates from the indexer
58+
59+
## Architecture Notes
60+
61+
**Workspace Integration:** This package follows ROS2 best practices by:
62+
- Storing persistent data outside the install directory
63+
- Generating Prisma client locally within workspace data directory
64+
- Using environment isolation to prevent global variable pollution
65+
- Supporting both development and production deployment patterns

0 commit comments

Comments
 (0)