You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(tap): update GraphTally guide for post-Horizon
- Remove legacy V1 content (contracts,
separate escrow subgraph)
- Add Graph Horizon context and link to
overview
- Simplify to Horizon-first configuration with
horizon.enabled = true
- Add GraphOps gateway aggregator endpoint
- Document operator_mnemonics for key rotation
- Streamline architecture overview and getting
started
- Remove migration framing in favor of current
setup guide
Learn about The Graph's new payment system, **GraphTally**[(previously Timeline Aggregation Protocol)](https://docs.rs/tap_core/latest/tap_core/index.html). This system provides fast, efficient microtransactions with minimized trust.
5
+
Learn about The Graph's payment system, **GraphTally**[(previously Timeline Aggregation Protocol)](https://docs.rs/tap_core/latest/tap_core/index.html). GraphTally provides fast, efficient microtransactions with minimized trust.
6
6
7
7
## Overview
8
8
9
-
GraphTally provides the following key features:
9
+
GraphTally is the payment system for The Graph, integrated into the core protocol through [Graph Horizon](/graph-horizon/overview). It enables efficient pay-per-query payments between gateways and indexers.
10
10
11
-
- Efficiently handles micropayments.
12
-
- Adds a layer of consolidations to onchain transactions and costs.
13
-
- Allows Indexers control of receipts and payments, guaranteeing payment for queries.
14
-
- Enables decentralized, trustless gateways and improves indexer service performance for multiple senders.
11
+
Key benefits:
15
12
16
-
### How It Works
13
+
-**Efficient micropayments**: Pay-per-query without high transaction costs
14
+
-**Reduced onchain costs**: Receipts aggregate into single blockchain transactions
15
+
-**Payment guarantees**: Indexers control receipt aggregation, ensuring payment for served queries
16
+
-**Trustless operation**: Decentralized gateways with cryptographic verification
17
17
18
-
GraphTally allows a sender to make multiple payments to a receiver through **Receipts**, which are then aggregated into a single payment called a **Receipt Aggregate Voucher (RAV)**. This aggregated payment can be verified on the blockchain, reducing the number of transactions and simplifying the payment process.
18
+
## How It Works
19
19
20
-
For each query, the gateway sends a signed receipt that is stored in your database. The `indexer-tap-agent` aggregates these receipts into RAVs through periodic requests. You can update a RAV by sending it with newer receipts, which generates a new RAV with an increased value.
20
+
GraphTally enables a sender (gateway) to make multiple payments to a receiver (indexer) through **Receipts**, which aggregate into a **Receipt Aggregate Voucher (RAV)**. RAVs can be verified and redeemed on the blockchain.
21
+
22
+
**Payment flow:**
23
+
24
+
1. Gateway sends a signed receipt with each query
25
+
2.`indexer-service-rs` validates and stores receipts in your database
26
+
3.`indexer-tap-agent` periodically aggregates receipts into RAVs
27
+
4. RAVs accumulate value as new receipts arrive
28
+
5. After allocation closure, the final RAV is redeemed onchain
21
29
22
30
### RAV Details
23
31
24
-
- RAVs represent money waiting to be sent to the blockchain.
25
-
- The system continuously aggregates receipts to ensure that the total value of non-aggregated receipts does not exceed the configured `max_amount_willing_to_lose_grt`.
26
-
- Each RAV can be redeemed once in the contracts, which is why they are sent after the allocation is closed.
32
+
- RAVs represent pending payments waiting for blockchain redemption
33
+
- The system aggregates receipts continuously, keeping unaggregated value below `max_amount_willing_to_lose_grt`
34
+
- Each RAV redeems once onchain, so final RAVs are created after allocation closure
27
35
28
36
### Redeeming RAVs
29
37
30
-
The redemption process is fully automated when running both`indexer-tap-agent` and `indexer-agent`:
38
+
RAV redemption is fully automated when running `indexer-tap-agent` and `indexer-agent`:
31
39
32
-
1.An Indexer closes an allocation.
33
-
2. After the `recently-closed-allocation-buffer` period, `indexer-tap-agent`takes all pending receipts for that allocation and requests aggregation into a final RAV, marking it as `last`.
34
-
3.`indexer-agent`takes all the last RAVs and sends redeem requests to the blockchain, updating the `redeem_at` value.
40
+
1. Indexer closes an allocation
41
+
2. After the `recently-closed-allocation-buffer` period, `indexer-tap-agent`aggregates remaining receipts into a final RAV marked as `last`
42
+
3.`indexer-agent`submits redeem transactions to the blockchain
35
43
4. During the `finality-time` period, `indexer-agent` monitors for blockchain reorganizations:
36
-
- If the transaction was reverted, the RAV is resent to the blockchain.
In addition to typical indexer requirements, you'll need a `tap-escrow-subgraph` endpoint to query escrow information. You can use The Graph Network to query or self-host on your `graph-node`:
60
-
61
-
-[Graph TAP Arbitrum Sepolia Subgraph (for The Graph testnet)](https://thegraph.com/explorer/subgraphs/7ubx365MiqBH5iUz6XWXWT8PTof5BVAyEzdb8m17RvbD)
62
-
-[Graph TAP Arbitrum One Subgraph (for The Graph mainnet)](https://thegraph.com/explorer/subgraphs/4sukbNVTzGELnhdnpyPqsf1QqtzNHEYKKmJkgaT8z6M1)
63
-
64
-
> Note: `indexer-agent` does not currently handle the indexing of this Subgraph like it does for the Network Subgraph deployment. You must index it manually.
65
-
66
-
## Migration Guide
55
+
## Getting Started
67
56
68
57
### Software Requirements
69
58
70
-
#### Required Versions
71
-
72
-
-**indexer-agent**: [Latest version supporting TAP](https://github.com/graphprotocol/indexer/releases)
-**indexer-service-rs**: Handles incoming queries, validates receipts, routes to graph-node. Stateless and horizontally scalable.
75
+
-**indexer-tap-agent**: Aggregates receipts into RAVs. Run exactly **one instance**.
76
+
-**indexer-agent**: Manages allocations and redeems RAVs onchain.
93
77
94
-
#### 2. Replace Indexer Service
78
+
All three components share the same PostgreSQL database.
95
79
96
-
- Fully replace your TypeScript indexer-service with `indexer-service-rs`
97
-
- The new service is stateless and can be scaled horizontally
98
-
- Use the same database as your existing setup
80
+
### Configuration
99
81
100
-
#### 3. Deploy TAP Agent
82
+
Both `indexer-service-rs` and `indexer-tap-agent` use a shared TOML configuration file. Pass it with `--config /path/to/config.toml`.
101
83
102
-
- Run exactly **one instance** of `indexer-tap-agent`
103
-
- This component manages receipt aggregation and RAV creation
104
-
- It must have access to the same database as other indexer components
105
-
106
-
#### 4. Configuration
107
-
108
-
Both `indexer-service-rs` and `indexer-tap-agent` share a TOML configuration file. Create a configuration file and pass it with `--config /path/to/config.toml`.
109
-
110
-
##### Minimal Configuration Example
84
+
#### Configuration Example
111
85
112
86
```toml
113
-
# Essential configuration for indexer-rs components
114
-
# All values below must be updated to match your setup
0 commit comments