/ sinks / sink-mongo / CHANGELOG.md
CHANGELOG.md
  1  # Changelog
  2  
  3  All notable changes to this project will be documented in this file.
  4  
  5  The format is based on [Common Changelog](https://common-changelog.org/), and
  6  this project adheres to
  7  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
  8  
  9  ## [0.5.3] - 2024-01-25
 10  
 11  _Persist state to Redis._
 12  
 13  ### Added
 14  
 15  -   You can now persist state to Redis! Use the `--persist-to-redis` flag with
 16      [the connection string to your Redis
 17      instance](https://docs.rs/redis/latest/redis/#connection-handling) and the sink
 18      will store its state there. Data is persisted under the `apibara:sink:{sink_id}`
 19      key and you can easily manage it with `redis-cli`.
 20  
 21  ## [0.5.2] - 2024-01-19
 22  
 23  _Improve `--allow-net` flag usage._
 24  
 25  ### Changed
 26  
 27  -   When the `--allow-net` flag is used and the value passed to it is an empty
 28      string, treat it as equivalent to allowing any host. This is especially useful
 29      if you're setting the flag with the `ALLOW_NET` environment variable.
 30  
 31  ## [0.5.1] - 2024-01-16
 32  
 33  _Enable network access._
 34  
 35  ### Added
 36  
 37  -   Indexers can now access the network to make HTTP/TCP calls. Use the `--allow-net` flag without arguments to allow connecting to any address, or restrict access to selected domains by specifying the domains as comma-separated values.
 38  
 39  ## [0.5.0] - 2024-01-13
 40  
 41  _Introduce factory mode to dynamically update the stream filter._
 42  
 43  ### Added
 44  
 45  -   Introduce factory mode. Use this to dynamically update the stream filter, for
 46      example to start receiving data from a smart contract deployed by another smart
 47      contract. Enable factory mode by exporting a `factory` function from your script.
 48  -   The sink now emits OpenTelemetry metrics to track the sync status.
 49  
 50  ### Changed
 51  
 52  -   The status response from the status server now includes the chain's head.
 53  
 54  ### Fixed
 55  
 56  -   Fixed an issue with the status server response timing out during the initial sync.
 57  
 58  ## [0.4.10] - 2023-12-02
 59  
 60  _Index data in a specific block range._
 61  
 62  ### Added
 63  
 64  -   Add a new `--ending-block` (`endingBlock` if configured from the script)
 65      option to stop the indexer at a specific block.
 66  
 67  ## [0.4.9] - 2023-11-30
 68  
 69  _Control indexer timeouts._
 70  
 71  ### Added
 72  
 73  -   Add new `--script-load-timeout-seconds` and
 74      `--script-transform-timeout-seconds` options to control the maximum time the
 75      indexer script has to initialize and transform data respectively.
 76  
 77  ## [0.4.8] - 2023-11-29
 78  
 79  _Write to multiple collections from one indexer._
 80  
 81  ### Added
 82  
 83  -   Add a new option to write to multiple collections from a single indexer.
 84      Change `collectionName` to `collectionNames` and specify a list of
 85      collections. When multi collection mode is enabled, the transform function
 86      return value changes. The transform must return data with the following type
 87      `{ collection: string, data: T }[]`, that is data together with the
 88      collection where to insert it. Refer to the documentation to learn more about
 89      multi collection mode.
 90  
 91  ## [0.4.7] - 2023-11-16
 92  
 93  _Add new environment-related options._
 94  
 95  ### Added
 96  
 97  -   Add new `--allow-env-from-env` flag to allow the indexer script to access
 98      the parent process environment variables. Users can pass a list of
 99      comma-separated variables to this option.
100  
101  ### Changed
102  
103  -   Cleanup the default logs to only show the current block number.
104  -   To restore the previous, more detailed logs, set the log level to debug.
105  
106  ## [0.4.6] - 2023-11-11
107  
108  _Fix an issue on Linux._
109  
110  ### Fixed
111  
112  -   Link against GLIBC 3.5. The most recent build was linking against GLIBC 3.8
113      which caused some issues on non-rolling release distributions.
114  
115  ## [0.4.5] - 2023-11-09
116  
117  _Write to the same collection from multiple indexers._
118  
119  ### Added
120  
121  -   Add a new `invalidate` option used to add additional conditions to the
122      invalidate query. Developers can constrain which documents are delete by an
123      indexer on data invalidation, so that multiple indexers can write to the
124      same collection.
125  
126  ## [0.4.4] - 2023-11-07
127  
128  _Improve performance for data-heavy indexers._
129  
130  ### Added
131  
132  -   Update Starknet's event filter to support the new `includeTransaction`,
133      and `includeReceipt` options. These options control whether the server will
134      send the transaction and/or receipt that generated an event. For indexers
135      that don't need this data, toggling this option on can improve performance
136      drastically.
137  
138  ### Changed
139  
140  -   Update the Deno runtime to `deno_core v0.244` and `deno_runtime v0.130`.
141  -   Use the new
142      [`#[op2]`](https://docs.rs/deno_core/0.224.0/deno_core/attr.op2.html) macro
143      to exchange data between Deno and Rust. Data serialization and
144      deserialization between the sink and the script is now faster.
145  
146  ## [0.4.3] - 2023-10-27
147  
148  _Fix exit code on disconnect._
149  
150  ### Fixed
151  
152  -   In some cases, the sink would exit with a `0` exit code on error. This
153      version ensures that the sink will return a non-zero exit code on all
154      errors.
155  
156  ## [0.4.2] - 2023-10-24
157  
158  _Error message improvements._
159  
160  ### Changed
161  
162  -   This version changes how errors are handled to improve error messages.
163      Errors now show more context and additional information that will help
164      developers debug their indexers.
165  -   The sink will return a non-zero error code on failure. We use the standard
166      unix exit codes in `sysexit.h`. Developers can use exit codes to decide
167      whether to restart the indexer or not.
168  
169  ## [0.4.1] - 2023-10-11
170  
171  _Disconnect when stream hangs._
172  
173  ### Added
174  
175  -   Add a new `--timeout-duration-seconds` flag to control the timeout between
176      stream messages. If the stream doesn't receive any message in this interval,
177      the sink exits. Defaults to 45 seconds.
178  
179  ## [0.4.0] - 2023-09-16
180  
181  _Introduce sink status gRPC service._
182  
183  ### Changed
184  
185  -   The status server is now a gRPC service. This service returns the sink
186      indexing status, the starting block, and the chain's current head block
187      from the upstream DNA service.
188  -   The status server now binds on a random port. This means it's easier to run
189      multiple sinks at the same time.
190  
191  ## [0.3.0] - 2023-08-29
192  
193  _Introduce entity mode to index stateful entities._
194  
195  ### Added
196  
197  -   Add _entity mode_ to index stateful entities. When this mode is turned on
198      (by setting the `entityMode` option to `true`), the indexer behaviour changes
199      to enable updating entities while indexing.
200      The return value of the transform is expected to be a list of `{ entity, update }`
201      objects, where `update` is a MongoDB update document or pipeline.
202      Please refer to the document to read more about entity mode.
203  
204  ## [0.2.0] - 2023-08-21
205  
206  _This release improves the developer experience when running locally._
207  
208  ### Added
209  
210  -   Add a `--persist-to-fs=my-dir` flag to persist the indexer's state to the
211      filesystem. This option creates a new directory (specified by the user) and
212      writes the indexer's current state to a file, with one file per indexer.
213      Developers shouldn't use this option for production, but only for
214      development since it lacks any locking mechanism to prevent multiple copies
215      of the same indexer running at the same time.
216  
217  ### Changed
218  
219  -   The transform function now is invoked with a single block of data.
220      Batching is a low-level mechanism used to control how often data is written to Mongo,
221      but it shouldn't affect the transform step.
222  
223  ## [0.1.0] - 2023-08-08
224  
225  _First tagged release 🎉_
226  
227  [0.5.3]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.5.3
228  [0.5.2]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.5.2
229  [0.5.1]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.5.1
230  [0.5.0]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.5.0
231  [0.4.10]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.4.10
232  [0.4.9]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.4.9
233  [0.4.8]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.4.8
234  [0.4.7]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.4.7
235  [0.4.6]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.4.6
236  [0.4.5]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.4.5
237  [0.4.4]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.4.4
238  [0.4.3]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.4.3
239  [0.4.2]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.4.2
240  [0.4.1]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.4.1
241  [0.4.0]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.4.0
242  [0.3.0]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.3.0
243  [0.2.0]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.2.0
244  [0.1.0]: https://github.com/apibara/dna/releases/tag/sink-mongo/v0.1.0