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
@@ -150,6 +152,37 @@ The important entries to update for the manifest are:
150
152
151
153
- `features`: a list of all used [feature](#experimental-features) names.
152
154
155
+
- `indexerHints.prune`: Defines the retention of historical block data for a subgraph. Options include:
156
+
157
+
1. `"never"`: No pruning of historical data; retains the entire history.
158
+
2. `"auto"`: Retains the minimum necessary history as set by the indexer, optimizing query performance.
159
+
3. A specific number: Sets a custom limit on the number of historical blocks to retain.
160
+
161
+
```
162
+
indexerHints:
163
+
prune: auto
164
+
```
165
+
166
+
> The term "history" in this context of subgraphs is about storing data that reflects the old states of mutable entities. This capability is essential for [time travel queries](/querying/graphql-api/#time-travel-queries), This feature enables querying the past states of these entities at specific blocks throughout the blockchain's history.
167
+
168
+
Using `"auto"` is generally recommended as it maximizes query performance and is sufficient for most users who do not require access to extensive historical data.
169
+
170
+
For subgraphs leveraging [time travel queries](/querying/graphql-api/#time-travel-queries), it's advisable to either set a specific number of blocks for historical data retention or use `prune: never` to keep all historical entity states. Below are examples of how to configure both options in your subgraph's settings:
171
+
172
+
To retain a specific amount of historical data:
173
+
174
+
```
175
+
indexerHints:
176
+
prune: 1000 # Replace 1000 with the desired number of blocks to retain
177
+
```
178
+
179
+
To preserve the complete history of entity states:
180
+
181
+
```
182
+
indexerHints:
183
+
prune: never
184
+
```
185
+
153
186
- `dataSources.source`: the address of the smart contract the subgraph sources, and the ABI of the smart contract to use. The address is optional; omitting it allows to index matching events from all contracts.
154
187
155
188
- `dataSources.source.startBlock`: the optional number of the block that the data source starts indexing from. In most cases, we suggest using the block in which the contract was created.
0 commit comments