Skip to content

Commit 4d0e214

Browse files
docs: enhance README for clarity and other docs updates for v1.4.0
* docs: enhance README for clarity - Enhanced README.md with updated project overview, key features, quick start instructions, and detailed API usage examples. - Improved documentation structure for better navigation and clarity, including links to relevant resources and support channels. * docs: update resource requirements and pruning configuration in documentation - Revised README.md to clarify resource requirements for different hardware profiles, including updated storage needs for pruning enabled and disabled scenarios. - Enhanced documentation on pruning configuration, specifying default values and safety margins for spent UTXO pruning. - Updated environment variable documentation to reflect changes in default settings for pruning options. * docs: update README and Docker documentation for environment management - Enhanced README.md to clarify log viewing instructions and added commands for merging environment files to avoid warnings. - Updated Docker documentation to include tips for managing environment files and emphasized the deprecation of the single Docker image deployment in favor of Docker Compose for better modularity and resource management. * docs: cleanup tags, highlight pruning info and other cosmetics - Revised README.md to clarify that Spent UTXO pruning is enabled by default starting from v1.4.0. - Enhanced warnings about the deprecation of the single Docker image deployment. * docs: enhance multi-assets guide with account balance and UTXO queries - Updated the multi-assets documentation to clarify the usage of `/account/balance` and `/account/coins` endpoints for querying account balances and UTXOs. - Added detailed request and response examples for both endpoints, including information on querying with stake addresses and known issues. - Improved structure with tabs for better navigation and clarity. * docs: add offline operations deployment docs and FULL VACCUM commands after pruning to reclaim file size * chore: update environment variable configurations - Disabled token registry and cleared base URL in .env.docker-compose-preprod - Updated env-vars documentation to reflect new vars and defaults --------- Co-authored-by: Kartiiyer12 <kartikiyer2020@gmail.com>
1 parent aa68703 commit 4d0e214

File tree

8 files changed

+466
-179
lines changed

8 files changed

+466
-179
lines changed

.env.docker-compose-preprod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ PEER_DISCOVERY=true
113113

114114
## Token Registry
115115
# Externally hosted token registry is currently only available for mainnet
116-
TOKEN_REGISTRY_ENABLED=true
117-
TOKEN_REGISTRY_BASE_URL=http://preview.integrations.cf-systems.internal:8080/api
116+
TOKEN_REGISTRY_ENABLED=false
117+
TOKEN_REGISTRY_BASE_URL=
118118
TOKEN_REGISTRY_CACHE_TTL_HOURS=1
119119
TOKEN_REGISTRY_LOGO_FETCH=true
120120
TOKEN_REGISTRY_REQUEST_TIMEOUT_SECONDS=2

README.md

Lines changed: 203 additions & 91 deletions
Large diffs are not rendered by default.

docs/docs/advanced-configuration/pruning.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ When enabled, the pruning process operates as follows:
2222

2323
1. New UTXOs are indexed as transactions occur.
2424
2. UTXOs are marked as spent when consumed in subsequent transactions.
25-
3. A background job periodically permanently deletes spent UTXOs that are older than a configurable safety margin (default: 2,160 blocks, ~12 hours on mainnet). This buffer safeguards data integrity against chain rollbacks within Cardano's finality window.
25+
3. A background job periodically permanently deletes spent UTXOs that are older than a configurable safety margin (default: 129,600 blocks, ~30 days on mainnet). This buffer safeguards data integrity against chain rollbacks within Cardano's finality window.
2626

2727
**Impact Summary:**
2828
| Aspect | Effect |
@@ -34,7 +34,7 @@ When enabled, the pruning process operates as follows:
3434

3535
## Impact on Rosetta API Endpoints
3636

37-
Spent UTXO pruning affects Rosetta API endpoints differently based on their reliance on historical transaction data. The table below summarizes the impact. Note that "Recent" refers to data within the safety margin (default ~12 hours).
37+
Spent UTXO pruning affects Rosetta API endpoints differently based on their reliance on historical transaction data. The table below summarizes the impact. Note that "Recent" refers to data within the safety margin (default ~30 days).
3838

3939
:::info Oldest Block Identifier
4040
When pruning is enabled, the `/network/status` endpoint includes an additional `oldest_block_identifier` object in its response. This identifier corresponds to the latest fully queryable block with complete data. Below this block index, blocks might have missing data due to pruning, making historical queries unreliable.
@@ -89,24 +89,24 @@ Spent UTXO pruning is configured via environment variables, typically set in you
8989
# --- Spent UTXO Pruning Configuration ---
9090

9191
# Enable or disable spent UTXO pruning.
92-
# Default: false (Pruning is disabled by default)
93-
# To enable, set to: true
92+
# Default: true (Pruning is enabled by default)
93+
# To disable, set to: false
9494
REMOVE_SPENT_UTXOS=true
9595

9696
# Safety margin: Number of recent blocks for which spent UTXOs are retained.
97-
# Default: 2160 (approximately 12 hours of blocks on mainnet)
97+
# Default: 129600 (approximately 30 days of blocks on mainnet)
9898
# This value balances safety for rollbacks against storage savings.
99-
# Example: To keep ~24 hours of spent UTXOs, set to 4320.
99+
# Example: To keep ~7 days of spent UTXOs, set to 30240.
100100
# Note: Larger REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT values provide longer historical query support
101101
# but use more disk space and delay the realization of storage benefits.
102-
REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT=2160
102+
REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT=129600
103103
```
104104

105105
:::note Configuration Guidelines
106106

107-
- Start with the default settings (`REMOVE_SPENT_UTXOS=false` keeps pruning off).
108-
- The provided defaults (`REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT=2160`) offer ~12 h of rollback safety on mainnet.
109-
- Increase `REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT` if you need a longer historical query window; decrease it for more aggressive space savings.
107+
- Default settings have pruning enabled (`REMOVE_SPENT_UTXOS=true`) for optimal storage efficiency.
108+
- The provided defaults (`REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT=129600`) offer ~30 days of rollback safety on mainnet.
109+
- Decrease `REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT` for more aggressive space savings (e.g., 2160 for ~12 hours); increase it if you need a longer historical query window.
110110
:::
111111

112112
## Migration and Operational Notes
@@ -132,7 +132,31 @@ The resynchronization process rebuilds the indexer database from your existing C
132132

133133
This is necessary in two main scenarios:
134134

135-
- **To reclaim disk space**: When you enable pruning on an existing instance, a resync will clear out historically spent UTXOs.
135+
- **To reclaim disk space**: When you enable pruning on an existing instance, a resync will clear out historically spent UTXOs. However, to actually reduce the file size on disk after `REMOVE_SPENT_UTXOS` is enabled and the indexer has fully synced, you must manually reclaim the space using PostgreSQL's VACUUM FULL command on the affected tables:
136+
137+
```bash
138+
# Connect to the PostgreSQL database
139+
docker exec -e PGPASSWORD="<password>" -it <postgres-container-name> psql -U <username> -d rosetta-java
140+
141+
# set schema
142+
set search_path to mainnet;
143+
144+
# Run VACUUM FULL on the tables that store UTXO data
145+
VACUUM FULL tx_input;
146+
VACUUM FULL address_utxo;
147+
```
148+
149+
:::warning Database Maintenance Required
150+
The VACUUM FULL operation requires an exclusive lock on the tables and can take significant time to complete. Plan for potential downtime during this maintenance operation. In addition, sufficient free disk space must be available, since VACUUM FULL rewrites each table by creating a new copy before replacing the old one. For example, in this case you would need approximately 400 GB of free space to complete the operation. The process will:
151+
152+
- **Reclaim disk space**: Remove the gaps left by deleted spent UTXOs
153+
- **Reorganize table data**: Compact the remaining data for better performance
154+
- **Require exclusive access**: Block all other operations on these tables during execution
155+
:::
156+
157+
:::tip Alternative Approach
158+
If you prefer to avoid the VACUUM FULL maintenance window, performing a complete indexer resynchronization (as described above) will achieve the same disk space reclamation while rebuilding the database from scratch with the new pruning configuration.
159+
:::
136160
- **To restore full history**: When you disable pruning, a resync will rebuild the complete transaction history that was previously pruned away.
137161

138162
:::tip Quick Resynchronization Steps

docs/docs/core-concepts/operation-modes.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import TabItem from '@theme/TabItem';
1313
<Tabs>
1414
<TabItem value="online" label="Online Mode" default>
1515

16-
## Online Mode
16+
1717

1818
In online mode, the system connects to the Cardano network, synchronizes the blockchain, and provides real-time access to blockchain data. This is the default mode and requires a connection to the Cardano network.
1919

@@ -29,20 +29,35 @@ This mode is used for blockchain synchronization, transaction broadcasting, and
2929
</TabItem>
3030
<TabItem value="offline" label="Offline Mode">
3131

32-
## Offline Mode
32+
3333

3434
In offline mode, the system operates without connecting to the Cardano network. The Cardano Node, YACI Indexer, and PostgreSQL components are disabled, and only the Rosetta API is active.
3535

3636
Offline mode is useful for transaction construction and signing in air-gapped environments or security-critical applications. This mode allows you to create and sign transactions without broadcasting them to the network, which is particularly important for cold wallet solutions and high-security setups.
3737

3838
:::tip Enabling Offline Mode
39-
To enable offline mode, set the `API_SPRING_PROFILES_ACTIVE` environment variable to `offline` in the configuration file:
40-
39+
To enable offline mode, set the `API_SPRING_PROFILES_ACTIVE` and `TOKEN_REGISTRY_ENABLED` as below:
4140
```bash
4241
API_SPRING_PROFILES_ACTIVE=offline
42+
TOKEN_REGISTRY_ENABLED=false
4343
```
44-
4544
:::
4645

46+
#### Deployment Option
47+
48+
##### Using Docker Compose
49+
50+
1. Clone the repository
51+
```bash
52+
git clone https://github.com/cardano-foundation/cardano-rosetta-java.git
53+
```
54+
2. Use the provided environment files:
55+
- The default configuration is in `.env.docker-compose`
56+
57+
```bash
58+
docker compose --env-file .env.docker-compose \
59+
-f docker-compose-offline.yaml up -d
60+
```
61+
4762
</TabItem>
4863
</Tabs>

docs/docs/install-and-deploy/docker.md

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Before you begin, ensure you have the following installed:
1414

1515
- Docker
1616
- Docker Compose
17-
- Java 21
17+
- Java 24
1818
- For integration tests: Node 14+
1919

2020
## Deployment Options
@@ -28,6 +28,9 @@ import TabItem from '@theme/TabItem';
2828
### Using Docker Compose
2929

3030
1. Clone the repository
31+
```bash
32+
git clone https://github.com/cardano-foundation/cardano-rosetta-java.git
33+
```
3134
2. Use the provided environment files or modify them if necessary:
3235
- The default configuration is in `.env.docker-compose`
3336
- Choose a hardware profile from the available options (see [Hardware Profiles](./hardware-profiles) for details):
@@ -44,6 +47,21 @@ docker compose --env-file .env.docker-compose \
4447
-f docker-compose.yaml up -d
4548
```
4649

50+
:::tip Managing Environment Files
51+
To avoid environment variable warnings when running `docker compose` commands later (like `docker compose logs`), you can merge the environment files:
52+
```bash
53+
# For mainnet with mid-level profile:
54+
cat .env.docker-compose .env.docker-compose-profile-mid-level > .env
55+
56+
# For preprod with entry-level profile:
57+
cat .env.docker-compose-preprod .env.docker-compose-profile-entry-level > .env
58+
59+
# Now you can run commands without warnings:
60+
docker compose ps
61+
docker compose logs -f
62+
```
63+
:::
64+
4765
:::note
4866
The first time you run the command, it will take significant time to build the cardano-node.
4967
On subsequent runs, it will use the cached version.
@@ -68,9 +86,21 @@ Mithril provides cryptographically certified blockchain snapshots for multiple C
6886
:::
6987

7088
</TabItem>
71-
<TabItem value="prebuilt" label="Pre-built Docker Image">
89+
<TabItem value="prebuilt" label="Pre-built Docker Image (Deprecated)">
90+
91+
### Using Pre-built Docker Image (Deprecated)
7292

73-
### Using Pre-built Docker Image
93+
:::danger Deprecated Feature
94+
⚠️ **The single Docker image deployment is deprecated and not recommended for production use.**
95+
96+
This method bundles all components (cardano-node, indexer, API, and PostgreSQL) into a single container, which:
97+
- Makes resource management difficult
98+
- Complicates debugging and maintenance
99+
- Prevents independent component scaling
100+
- Is less reliable for production workloads
101+
102+
**We strongly recommend using the Docker Compose deployment method instead**, which offers better modularity, resource management, and maintainability.
103+
:::
74104

75105
For every release, pre-built docker images are available on [DockerHub](https://hub.docker.com/orgs/cardanofoundation/repositories):
76106

@@ -100,9 +130,13 @@ API documentation is available [here](https://input-output-hk.github.io/cardano-
100130
:::
101131

102132
</TabItem>
103-
<TabItem value="source" label="Build from Source">
133+
<TabItem value="source" label="Build from Source (Single Image)">
104134

105-
### Building Docker Image from Source
135+
### Building Docker Image from Source (Single Container)
136+
137+
:::warning Deprecated Approach
138+
This builds the deprecated single Docker image that bundles all components together. For production deployments, use the Docker Compose method which builds and manages components separately.
139+
:::
106140

107141
```bash
108142
git clone https://github.com/cardano-foundation/cardano-rosetta-java
@@ -188,21 +222,27 @@ For information about running in online mode (default) or offline mode (for air-
188222
<TabItem value="logs" label="Viewing Logs" default>
189223

190224
```bash
191-
# Follow Docker container logs
192-
docker logs rosetta -f
225+
# For Docker Compose deployments:
226+
docker compose logs -f api
227+
docker compose logs -f yaci-indexer
228+
docker compose logs -f cardano-node
193229

194-
# Access node logs
230+
# For single container deployments (deprecated):
231+
docker logs rosetta -f
195232
docker exec rosetta tail -f /logs/node.log
196-
197-
# Access indexer logs
198233
docker exec rosetta tail -f /logs/indexer.log
199234
```
200235

201236
</TabItem>
202237
<TabItem value="interactive" label="Interactive Shell">
203238

204239
```bash
205-
# Get interactive bash shell
240+
# For Docker Compose deployments:
241+
docker exec -it cardano-rosetta-java-cardano-node-1 bash
242+
docker exec -it cardano-rosetta-java-api-1 bash
243+
docker exec -it cardano-rosetta-java-yaci-indexer-1 bash
244+
245+
# For single container deployments (deprecated):
206246
docker exec -it rosetta bash
207247

208248
# Useful commands within the container

0 commit comments

Comments
 (0)