Skip to content

Commit

Permalink
docs(filters): added legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
paulobressan committed Aug 10, 2023
1 parent a6f8631 commit 00ed2d6
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 300 deletions.
5 changes: 1 addition & 4 deletions docs/pages/v2/filters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ These are the existing filters that are included as part the main _Oura_ codebas
- [ParseCbor](filters/parse_cbor.mdx): a filter that maps cbor transactions to a data structure.
- [SplitBlock](filters/split_block.mdx): a filter that will decode the cbor block and extract all transactions in an event in the format CborTx.
- [Deno](filters/deno.mdx): a filter that allows JS code to be implemented as a stage within the pipeline.

### Legacy V1
- [Fingerprint](filters/fingerprint.mdx): a filter that adds a (probably) unique identifier (fingerprint) to each event.
- [Selection](filters/selection.mdx): a filter that evaluates different built-in predicates to decide which events should go through the pipeline.
- [Legacy V1](filters/legacy_v1.mdx): a filter that transforms the block data to the Oura V1 data structure.

New filters are being developed, information will be added in this documentation to reflect the updated list. Contributions and feature request are welcome in our [Github Repo](https://github.com/txpipe/oura).
22 changes: 0 additions & 22 deletions docs/pages/v2/filters/fingerprint.mdx

This file was deleted.

61 changes: 61 additions & 0 deletions docs/pages/v2/filters/legacy_v1.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Legacy V1 filter

Transforms the block data to the Oura V1 data structure. This filter is ideal for compatibility with systems that are using Oura V1 and want to migrate without much work.

## Configuration

Adding the following section to the daemon config file will enable the filter as part of the pipeline:

```toml
[[filters]]
type = "LegacyV1"
include_block_end_events = false
include_transaction_details = false
include_transaction_end_events = false
include_block_details = false
include_block_cbor = false
include_byron_ebb = false
```

### Section `LegacyV1`

- `type`: the literal value `LegacyV1`.
- `include_block_end_events`: if enabled, the source will output an event signaling the end of a block, duplicating all of the data already sent in the corresponding block start event. Default value is `false`.
- `include_transaction_details`: if enabled, each transaction event payload will contain an nested version of all of the details of the transaction (inputs, outputs, mint, assets, metadata, etc). Useful when the pipeline needs to process the tx as a unit, instead of handling each sub-object as an independent event. Default value is `false`.
- `include_transaction_end_events`: if enabled, the source will output an event signaling the end of a transaction, duplicating all of the data already sent in the corresponding transaction start event. Defaul value is `false`.
- `include_block_cbor`: if enabled, the block event will include the raw, unaltered cbor content received from the node, formatted as an hex string. Useful when some custom cbor decoding is required. Default value is `false`.
- `include_byron_ebb`: if enabled, a block event will be emmitted for legacy epoch boundary block of the Byron era (deprecated in newer eras). Useful when performing validation on previous block hashes. Default value is `false`.
- `include_block_details`: If enabled, will be added the basic details of each transaction. Default value is `false`.

## Examples

Below is an example of the data that will be sent to the sink with all settings disabled.

```json
{
"event": "apply",
"point": {
"slot": 100110525,
"hash": "c808fc4142c5f10a2a6d0922edbd23972100d7d22e2255206bd05e968cc045f1"
},
"record": {
"context": {
"block_hash": "c808fc4142c5f10a2a6d0922edbd23972100d7d22e2255206bd05e968cc045f1",
"block_number": 9142145,
"slot": 100110525,
"timestamp": 1691676816,
"tx_idx": 6,
"tx_hash": "4329140c6711f2197c8c81bfff4b75fb95892375050dafda30ba146476ca3d65",
"input_idx": null,
"output_idx": null,
"output_address": null,
"certificate_idx": null
},
"collateral": {
"tx_id": "981881a382a41f85140076b088a93456a999e6cd2796a28c0a8c7858cea40175",
"index": 4
},
"fingerprint": null
}
}
```
274 changes: 0 additions & 274 deletions docs/pages/v2/filters/selection.mdx

This file was deleted.

0 comments on commit 00ed2d6

Please sign in to comment.