Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Treasury instance within treasury metadata transactions
# this is used to filter out metadata and transactions which are not relevant

# 9e65e4ed7d6fd86fc4827d2b45da6d2c601fb920e8bfd794b8ecc619 = Intersect 2025 budget instance

TREASURY_INSTANCE=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ API instance hosted at

```
administration-data/
├── .env # Environment variables (not committed)
├── indexer/ # YACI Store indexer configuration
│ ├── application.properties
│ ├── config/
Expand Down Expand Up @@ -162,7 +163,14 @@ The YACI Store indexer exposes its own API on port 8081:

### Treasury Reserve Contract

We can configure the Treasury Reserve instance that we index for.
We can configure the Treasury Reserve instance that we index for via the `.env` file at the project root:

```bash
# .env
TREASURY_INSTANCE=9e65e4ed7d6fd86fc4827d2b45da6d2c601fb920e8bfd794b8ecc619
```

This environment variable is passed to the indexer container via `docker-compose.yml` and used by the `treasury-filter.mvel` plugin script to filter metadata.

| Property | Value |
|----------|-------|
Expand Down Expand Up @@ -252,7 +260,7 @@ ORDER BY block_time DESC LIMIT 10;

YACI Store plugins filter blockchain data to only store treasury-relevant information:

- **Metadata Filter**: Only metadata with label `1694` (TOM standard) AND instance `9e65e4ed7d6fd86fc4827d2b45da6d2c601fb920e8bfd794b8ecc619`
- **Metadata Filter**: Only metadata with label `1694` (TOM standard) AND the treasury instance configured via `TREASURY_INSTANCE` in `.env`

This reduces database size by ~95% while keeping all treasury data.

Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ services:
depends_on:
postgres:
condition: service_healthy
env_file:
- .env
environment:
- JAVA_OPTS=-Xmx2g -Xms1g
ports:
Expand Down
4 changes: 2 additions & 2 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ This document describes how data flows through the Cardano Administration Data S
│ │
▼ ▼
┌─────────────────────────────────────┐
│ instance == "9e65e4ed..." ?
│ (Treasury instance ID)
│ instance == TREASURY_INSTANCE ?
│ (from env variable)
└─────────────────────────────────────┘
│ │
YES NO
Expand Down
12 changes: 12 additions & 0 deletions indexer/SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ Note: The script may fail if the release tag format is different. In that case,

## Configuration

### Environment Variables

Create a `.env` file in the project root with the treasury instance to filter for:

```bash
TREASURY_INSTANCE=9e65e4ed7d6fd86fc4827d2b45da6d2c601fb920e8bfd794b8ecc619
```

This is used by the `treasury-filter.mvel` plugin script to filter metadata by instance.

### Application Properties

Edit `application.properties` to configure:
- Database connection details
- Cardano network settings
Expand Down
2 changes: 1 addition & 1 deletion indexer/plugins/scripts/treasury-filter.mvel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Treasury instance identifier - only track metadata for this specific instance
TREASURY_INSTANCE = "9e65e4ed7d6fd86fc4827d2b45da6d2c601fb920e8bfd794b8ecc619";
TREASURY_INSTANCE = System.getenv("TREASURY_INSTANCE");

// Filter metadata - only keep label 1694 with matching treasury instance
def filterMetadata(items) {
Expand Down