Skip to content

Commit fec640e

Browse files
authored
docs: Update call API endpoint, pool operations guide, and add unparsed blo… (#547)
* Update call API endpoint, pool operations guide, and add unparsed blocks documentation * Update unparsed blocks doc and environment variables guide * Correct notes for SYNC variable in env-vars * Remove status field
1 parent d9192b5 commit fec640e

File tree

4 files changed

+182
-10
lines changed

4 files changed

+182
-10
lines changed

api/src/main/resources/rosetta-specifications-1.4.15/api.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,12 @@ paths:
451451
$ref: '#/components/schemas/Error'
452452
/call:
453453
post:
454-
summary: Make a Network-Specific Procedure Call
454+
summary: Cardano-Specific Procedure Call
455455
description: |
456-
Call invokes an arbitrary, network-specific procedure call with network-specific parameters. The guidance for what this endpoint should or could do is purposely left vague. In Ethereum, this could be used to invoke `eth_call` to implement an entire Rosetta API interface for some smart contract that is not parsed by the implementation creator (like a DEX). This endpoint could also be used to provide access to data that does not map to any Rosetta models instead of requiring an integrator to use some network-specific SDK and call some network-specific endpoint (like surfacing staking parameters). Call is NOT a replacement for implementing Rosetta API endpoints or mapping network-specific data to Rosetta models. Rather, it enables developers to build additional Rosetta API interfaces for things they care about without introducing complexity into a base-level Rosetta implementation. Simply put, imagine that the average integrator will use layered Rosetta API implementations that each surfaces unique data.
457-
456+
Starting from Rosetta-java version 1.3.0, the parameter `CONTINUE_PARSING_ON_ERROR=true|false` has been added to allow exchanges and integrators to configure yaci-core to ignore unparsed blocks and store them in a separate error table in the database.
457+
This is a Cardano network-specific procedure call, using Coinbase Mesh’s generic /call endpoint. It enables exchanges and integrators to:
458+
- Review blocks that could not be fully parsed.
459+
- Mark blocks as “checked” if they do not affect their users or transactions.
458460
## Supported Methods
459461
460462
### get_parse_error_blocks
@@ -564,13 +566,13 @@ components:
564566
properties:
565567
blockchain:
566568
type: string
567-
example: bitcoin
569+
example: cardano
568570
network:
569571
description: If a blockchain has a specific chain-id or network identifier, it should go in this field. It is up to the client to determine which network-specific identifier is mainnet or testnet.
570572
type: string
571573
example: mainnet
572-
sub_network_identifier:
573-
$ref: '#/components/schemas/SubNetworkIdentifier'
574+
# sub_network_identifier:
575+
# $ref: '#/components/schemas/SubNetworkIdentifier'
574576
SubNetworkIdentifier:
575577
description: In blockchains with sharded state, the SubNetworkIdentifier is required to query some object on a specific shard. This identifier is optional for all non-sharded blockchains.
576578
type: object
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Handling Unparsed Blocks
2+
3+
## 1. Overview
4+
5+
In some cases, **yaci-core** may not be able to parse certain Cardano blocks due to unexpected or malformed data. To address this, **yaci-store** has introduced a feature that allows these **unparsed blocks to be ignored** and **stored in a separate error table** in the database, instead of halting the indexing process.
6+
7+
With this graceful error handling in place, it's now possible to surface these parse-error blocks to exchanges and integrators so they can:
8+
9+
- Detect if any of their transactions are present in an errored block.
10+
- Review and “mark checked” blocks if they do not impact their users or operations.
11+
12+
This capability is exposed as **Cardano network-specific procedure calls**, using **Coinbase Mesh’s generic `/call` endpoint**, which supports **dynamic method routing**. This allows clients to query and update the state of errored blocks in a flexible and standardized way.
13+
14+
Starting from **Rosetta-java version 1.3.0**, the parameter `CONTINUE_PARSING_ON_ERROR=true|false` has been introduced:
15+
16+
- When it is set to `true`, yaci-core will skip unparsed blocks and add them to the error table.
17+
- When it is set to `false`, yaci-core will stop indexing when it encounters an unparsed block.
18+
19+
---
20+
21+
## 2. How to Use
22+
23+
You can interact with the parse-error block system through the `/call` endpoint. Below are the available operations.
24+
25+
### 2.1 Review blocks that could not be fully parsed
26+
27+
Use this call to get the list of blocks that failed to parse.
28+
29+
#### Request
30+
31+
```bash
32+
curl --location 'http://localhost:8082/call' \
33+
--header 'Content-Type: application/json' \
34+
--data '{
35+
"network_identifier": {
36+
"blockchain": "cardano",
37+
"network": "preprod"
38+
},
39+
"method": "get_parse_error_blocks",
40+
"parameters": {
41+
"status": "UNREVIEWED"
42+
}
43+
}'
44+
```
45+
:::note
46+
- Pagination is not required, as the number of errored blocks is expected to be low.
47+
:::
48+
#### Response
49+
```json
50+
{
51+
"result": {
52+
"parse_error_blocks": [
53+
{
54+
"error_id": 1,
55+
"block_number": 3686994,
56+
"status": "UNREVIEWED",
57+
"lastUpdated": "2025-07-18T16:18:00.266457",
58+
"note": "Please review all transactions within a block, https://explorer.cardano.org/block/3686994"
59+
},
60+
{
61+
"error_id": 2,
62+
"block_number": 3686995,
63+
"status": "UNREVIEWED",
64+
"lastUpdated": "2025-07-18T16:18:00.266457",
65+
"note": "Please review all transactions within a block, https://explorer.cardano.org/block/3686995"
66+
}
67+
]
68+
},
69+
"idempotent": false
70+
}
71+
```
72+
📚 For detailed information, please see the **[API page](/cardano-rosetta-java/api#tag/call/post/call)**.
73+
74+
### 2.2 Mark blocks as “checked” if they do not affect users or transactions
75+
After reviewing a block, you can mark it as reviewed with a comment and status.
76+
#### Request
77+
78+
```bash
79+
curl --location 'http://localhost:8082/call' \
80+
--header 'Content-Type: application/json' \
81+
--data '{
82+
"network_identifier": {
83+
"blockchain": "cardano",
84+
"network": "preprod"
85+
},
86+
"method": "mark_parse_error_block_checked",
87+
"parameters": {
88+
"block_number": 3686994,
89+
"status": "REVIEWED_DOES_NOT_AFFECT_US",
90+
"comment": "no impact to operation",
91+
"checked_by": "Admin"
92+
}
93+
}
94+
```
95+
:::note
96+
- `block_number` specifies which block to update.
97+
- `status` reflects the outcome of your review, e.g., REVIEWED_DOES_NOT_AFFECT_US.
98+
- Use `comment` and `checked_by` fields to provide audit context.
99+
:::
100+
101+
#### Response
102+
```json
103+
{
104+
"result": {
105+
"parse_error_blocks_response": [
106+
{
107+
"error_id": 1,
108+
"block_number": 3686994,
109+
"status": "REVIEWED_DOES_NOT_AFFECT_US",
110+
"comment": "no impact to operation",
111+
"checked_by": "Admin",
112+
"lastUpdated": "2025-07-28T04:25:57.632987219"
113+
}
114+
]
115+
},
116+
"idempotent": true
117+
}
118+
```
119+
📚 For detailed information, please see the **[API page](/cardano-rosetta-java/api#tag/call/post/call)**.
120+
121+
### 2.3 What to do when unparsed blocks are detected
122+
When **yaci-core** encounters unparsed blocks, and you want to attempt parsing them again after resolving the issue (e.g. upgrading parser logic), follow these steps:
123+
124+
1. **Upgrade `yaci-core`** to the latest version that supports parsing the problematic block(s).
125+
2. **Remove the data volume** used by the indexer.
126+
```bash
127+
docker compose --env-file .env.docker-compose \
128+
--env-file .env.docker-compose-profile-mid-level \
129+
-f docker-compose.yaml stop yaci-indexer
130+
131+
docker volume rm cardano-rosetta-java_data
132+
133+
```
134+
3. **Restart the indexer service** using Docker Compose:
135+
```bash
136+
docker compose --env-file .env.docker-compose \
137+
--env-file .env.docker-compose-profile-mid-level \
138+
-f docker-compose.yaml start yaci-indexer
139+
```
140+

docs/docs/install-and-deploy/env-vars.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Within root folder of the project there are example `.env` files, which can be c
8383
| `DB_POSTGRES_BGWRITER_DELAY` | Delay between background writer cycles | 200ms (mid-level profile) | added in release 1.2.6 |
8484
| `BLOCK_TRANSACTION_API_TIMEOUT_SECS` | Timeout for fetching blocks in seconds | 5 | added in release 1.2.11 |
8585
| `CONTINUE_PARSING_ON_ERROR` | Continue processing failed to parse blocks | true | added in release 1.3.0 |
86+
| `SYNC` | DB, indexer containers only start once the cardano node is at the tip | true: online mode, false: offline mode| added in release 1.2.0 |
8687

8788
## Deprecated Environment Variables (Previous Versions)
8889

docs/docs/user-guides/pool-operations.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ In addition to standard transaction operations, the following operations are ava
2222
| `poolRegistration` | Register a new stake pool |
2323
| `poolRegistrationWithCert` | Register a pool using a pre-created certificate |
2424
| `poolRetirement` | Retire an existing stake pool |
25+
| `poolGovernanceVote` | SPO submit governance vote |
2526

2627
:::note
2728
For all pool operations, the cold key is needed to sign the payloads, so it will be passed as an address.
2829
:::
2930

30-
## Pool Registration
31+
## Pool Operations
3132

3233
<Tabs>
3334
<TabItem value="standard" label="Standard Registration" default>
@@ -46,7 +47,6 @@ A pool registration operation requires `poolRegistrationParams` as metadata. The
4647
"index": 3
4748
},
4849
"type": "poolRegistration",
49-
"status": "success",
5050
"account": {
5151
"address": "1b268f4cba3faa7e36d8a0cc4adca2096fb856119412ee7330f692b5"
5252
},
@@ -96,7 +96,6 @@ For pool registration using a pre-created certificate, you need to include the c
9696
"index": 3
9797
},
9898
"type": "poolRegistrationWithCert",
99-
"status": "success",
10099
"account": {
101100
"address": "1b268f4cba3faa7e36d8a0cc4adca2096fb856119412ee7330f692b5"
102101
},
@@ -117,14 +116,44 @@ To retire a stake pool, you need to specify the epoch in which the pool should b
117116
"index": 1
118117
},
119118
"type": "poolRetirement",
120-
"status": "success",
121119
"account": {
122120
"address": "153806dbcd134ddee69a8c5204e38ac80448f62342f8c23cfe4b7edf"
123121
},
124122
"metadata": {
125123
"epoch": 200
126124
}
127125
}
126+
```
127+
128+
</TabItem>
129+
<TabItem value="Voting" label="Governance vote">
130+
131+
To vote for governance action, you need to specify value for `governance_action_hash`, `pool_credential`, `vote` and `vote_rationale` is an option
132+
133+
```json
134+
{
135+
"operation_identifier": {
136+
"index": 3
137+
},
138+
"type": "poolGovernanceVote",
139+
"account": {
140+
"address": "6c518b4861bb88b1395ceb116342cecbcfb8736282655f9a61c4c368"
141+
},
142+
"metadata": {
143+
"poolGovernanceVoteParams": {
144+
"governance_action_hash": "40c2a42fe324759a640dcfddbc69ef2e3b7fe5a998af8d6660359772bf44c9dc00",
145+
"pool_credential": {
146+
"hex_bytes": "60afbe982faaee34b02ad0e75cd50d5d7a734f5daaf7b67bc8c492eb5299af2b",
147+
"curve_type": "edwards25519"
148+
},
149+
"vote": "yes",
150+
"vote_rationale": {
151+
"data_hash": "c77f8427e2808cbd4c7093aa704fb0fcb48b2ab3bdd84fa7f4dec2eb7de344c9",
152+
"url": "ipfs://bafybeig7hluox6xefqdgmwcntvsguxcziw2oeogg2fbvygex2aj6qcfo64"
153+
}
154+
}
155+
}
156+
}
128157
```
129158

130159
</TabItem>

0 commit comments

Comments
 (0)