### Install sqlx-cli Source: https://github.com/jpg-store/comet-oura/blob/main/examples/lib/README.md Installs the sqlx-cli command-line interface using cargo, which is required for database operations in this example. ```sh cargo install sqlx-cli ``` -------------------------------- ### Initialize Docker Compose Source: https://github.com/jpg-store/comet-oura/blob/main/examples/postgresql/README.md Starts the services defined in the docker-compose.yml file. This is typically the first step to bring up the necessary infrastructure for the example. ```bash docker-compose up ``` -------------------------------- ### Database Setup and Migrations Source: https://github.com/jpg-store/comet-oura/blob/main/examples/lib/README.md Configures the database environment by setting the DATABASE_URL, creating the SQLite database, and applying migrations using the sqlx-cli. ```sh # Set db path env export DATABASE_URL="sqlite:local.db" # Create database cargo sqlx db create # Start migrations cargo sqlx migrate run --source ./src/migrations ``` -------------------------------- ### Oura Watch Mode Examples Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/usage/watch.mdx Provides practical examples of how to use the Oura watch mode with different connection types, network configurations, and starting points. ```sh oura watch relays-new.cardano-mainnet.iohk.io:3001 --bearer tcp ``` ```sh oura watch /opt/cardano/cnode/sockets/node0.socket --bearer unix ``` ```sh oura watch /opt/cardano/cnode/sockets/node0.socket --bearer unix --magic testnet ``` ```sh oura watch relays-new.cardano-mainnet.iohk.io:3001 \ --bearer tcp \ --since 49159253,d034a2d0e4c3076f57368ed59319010c265718f0923057f8ff914a3b6bfd1314 ``` ```sh oura watch preview-node.world.dev.cardano.org:30002 --bearer tcp --magic preview ``` ```sh oura watch preprod-node.world.dev.cardano.org:30000 --bearer tcp --magic preprod ``` -------------------------------- ### Golang Wasm Plugin Example Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/filters/wasm.mdx This entry links to an example demonstrating how to build a Wasm plugin using Golang. It serves as a practical guide for developers looking to create Wasm stages for the pipeline. ```go https://github.com/txpipe/oura/blob/main/examples/wasm_basic/README.md ``` -------------------------------- ### UtxoRPC Connection Example Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/sources/utxorpc.mdx An example configuration showing how to connect to a remote Dolos node in a preproduction environment using UtxoRPC. ```toml [source] type = "UtxoRPC" url = "https://50051-romantic-calmness-b55bqg.us1.demeter.run" max_items_per_page = 20 ``` -------------------------------- ### Build and Install Oura from Source Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/installation/from_source.mdx Clones the Oura repository, navigates into the directory, and installs the project with all features enabled using Cargo. ```shell git clone git@github.com:txpipe/oura.git cd oura cargo install --all-features --path . ``` -------------------------------- ### Build and Install Oura from Source Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/installation/from_source.mdx Clones the Oura repository, navigates into the directory, and installs the project with all features enabled using Cargo. ```shell git clone git@github.com:txpipe/oura.git cd oura cargo install --all-features --path . ``` -------------------------------- ### Running the Oura Example Source: https://github.com/jpg-store/comet-oura/blob/main/examples/lib/README.md Executes the Oura lib example using cargo run. The application connects to a Cardano foundation node via N2N source. ```sh cargo run ``` -------------------------------- ### Run Oura Pipeline Source: https://github.com/jpg-store/comet-oura/blob/main/examples/_deprecated/deno_cip68/README.md Command to execute the Oura pipeline with the custom Deno filter. Assumes Oura v2 is installed and the configuration is in `daemon.toml`. ```shell cargo run --bin oura -- daemon --config ./daemon.toml ``` -------------------------------- ### Install Oura Binary for GNU/Linux Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/installation/binary_release.mdx Downloads and installs the Oura binary release for GNU/Linux using curl and tar. The executable is moved to /usr/local/bin for system-wide access. ```shell curl --silent --location https://git.io/JD2ix | \ tar xz -C /tmp && mv /tmp/oura /usr/local/bin ``` -------------------------------- ### Starting from a Specific Chain Point Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/sources/n2c.mdx TOML configuration demonstrating how to start reading from a particular point in the Cardano chain using the `intersect` option. ```toml [source] type = "N2C" address = ["Unix", "/opt/cardano/cnode/sockets/node0.socket"] magic = "mainnet" [source.intersect] type = "Point" value = [48896539, "5d1f1b6149b9e80e0ff44f442e0cab0b36437bb92eacf987384be479d4282357"] ``` -------------------------------- ### Mithril Source Configuration Example Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/sources/mithril.mdx An example TOML configuration for setting up the Mithril source. This includes the aggregator URL, genesis key for verification, the directory to save snapshots, and a flag to skip validation. ```toml [source] type = "Mithril" aggregator = "https://aggregator.pre-release-preview.api.mithril.network/aggregator" genesis_key = "5b3132372c37332c3132342c3136312c362c3133372c3133312c3231332c3230372c3131372c3139382c38352c3137362c3139392c3136322c3234312c36382c3132332c3131392c3134352c31332c3233322c3234332c34392c3232392c322c3234392c3230352c3230352c33392c3233352c34345d" snapshot_download_dir = "./snapshot" skip_validation = false ``` -------------------------------- ### Watch Data Starting At A Particular Block Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/usage/watch.mdx Example of starting the watch mode from a specific block identified by its slot and hash. ```sh oura watch relays-new.cardano-mainnet.iohk.io:3001 \ --bearer tcp \ --since 49159253,d034a2d0e4c3076f57368ed59319010c265718f0923057f8ff914a3b6bfd1314 ``` -------------------------------- ### Install Oura Binary for GNU/Linux Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/installation/binary_release.mdx Downloads and installs the Oura binary release for GNU/Linux using curl and tar. The executable is moved to /usr/local/bin for system-wide access. ```shell curl --silent --location https://git.io/JD2ix | \ tar xz -C /tmp && mv /tmp/oura /usr/local/bin ``` -------------------------------- ### Watch Live Data From Preview Testnet Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/usage/watch.mdx Example of connecting to the Preview testnet using TCP. ```sh oura watch preview-node.world.dev.cardano.org:30002 --bearer tcp --magic preview ``` -------------------------------- ### Install Oura Binary for MacOS Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/installation/binary_release.mdx Downloads and installs the Oura binary release for MacOS using curl and tar. The executable is moved to /usr/local/bin for system-wide access. ```shell curl --silent --location https://git.io/JD2iH | \ tar xz -C /tmp && mv /tmp/oura /usr/local/bin ``` -------------------------------- ### Install Oura Binary for MacOS Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/installation/binary_release.mdx Downloads and installs the Oura binary release for MacOS using curl and tar. The executable is moved to /usr/local/bin for system-wide access. ```shell curl --silent --location https://git.io/JD2iH | \ tar xz -C /tmp && mv /tmp/oura /usr/local/bin ``` -------------------------------- ### Watch Live Data From Pre-Production Testnet Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/usage/watch.mdx Example of connecting to the Pre-Production testnet using TCP. ```sh oura watch preprod-node.world.dev.cardano.org:30000 --bearer tcp --magic preprod ``` -------------------------------- ### Logs Sink Configuration Example Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/sinks/logs.mdx Provides an example TOML configuration for the Logs sink, specifying output path, format, file size limits, total file count, and compression settings. ```toml [sink] type = "Logs" output_path = "/var/oura/mainnet" output_format = "JSONL" max_bytes_per_file = 1_000_000 max_total_files = 10 compress_files = true ``` -------------------------------- ### N2N Mainnet Connection Example Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/sources/n2n.mdx Example TOML configuration demonstrating how to connect to a remote Cardano mainnet node using the N2N source. ```toml [source] type = "N2N" peers = ["relays-new.cardano-mainnet.iohk.io:3001"] ``` -------------------------------- ### Testnet Chain Configuration Example Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/advanced/custom_network.mdx An example TOML configuration for the Oura daemon, demonstrating the expected values for connecting to the Cardano Testnet. This serves as a reference for custom network configurations. ```toml [chain] byron_epoch_length = 432000 byron_slot_length = 20 byron_known_slot = 0 byron_known_hash = "8f8602837f7c6f8b8867dd1cbc1842cf51a27eaed2c70ef48325d00f8efb320f" byron_known_time = 1564010416 shelley_epoch_length = 432000 shelley_slot_length = 1 shelley_known_slot = 1598400 shelley_known_hash = "02b1c561715da9e540411123a6135ee319b02f60b9a11a603d3305556c04329f" shelley_known_time = 1595967616 address_hrp = "addr_test" adahandle_policy = "8d18d786e92776c824607fd8e193ec535c79dc61ea2405ddf3b09fe3" ``` -------------------------------- ### Install Oura using Cargo Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/usage/library.mdx This snippet shows how to add the Oura library as a dependency to your Rust project using Cargo. ```rust cargo add oura ``` -------------------------------- ### Extracted CIP68 Reference NFT Data Source: https://github.com/jpg-store/comet-oura/blob/main/examples/_deprecated/deno_cip68/README.md Example JSON output representing parsed CIP68 reference NFT data, including label, policy, metadata, version, and transaction hash. ```json { "label": "000643b042756438363031", "policy": "4523c5e21d409b81c95b45b0aea275b8ea1406e6cafea5583b9f8a5f", "metadata": { "name": "SpaceBud #8601", "traits": "", "type": "Shark", "image": "ipfs://bafkreidrqwxpxhyc5bo364fzzwv7nhnjel6y6zkywriw33jopb2p4tba5u", "sha256": "7185aefb9f02e85dbf70b9cdabf69da922fd8f6558b4516ded2e7874fe4c20ed" }, "version": 1, "txHash": "720dd358d2b28531e181f93eed0e0d24db364232ddaccf6655abf92790a062d5" } ``` -------------------------------- ### Oura Daemon Output Example Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/guides/cardano_2_kafka.mdx Example output from the Oura daemon when running in daemon mode, showing connection status, handshake details, node tip information, and block fetching progress. ```sh [2021-12-13T22:16:43Z INFO oura::sources::n2n::setup] handshake output: Accepted(7, VersionData { network_magic: 764824073, initiator_and_responder_diffusion_mode: false }) [2021-12-13T22:16:43Z INFO oura::sources::n2n::setup] chain point query output: Some(Tip(Point(47867448, "f170baa5702c91b23580291c3a184195df7c77d3e1a03b3d6424793aacc850d6"), 6624258)) [2021-12-13T22:16:43Z INFO oura::sources::n2n::setup] node tip: Point(47867448,"f170baa5702c91b23580291c3a184195df7c77d3e1a03b3d6424793aacc850d6") [2021-12-13T22:16:44Z INFO oura::sources::n2n] rolling block to point Point(47867448, "f170baa5702c91b23580291c3a184195df7c77d3e1a03b3d6424793aacc850d6") [2021-12-13T22:16:52Z INFO oura::sources::n2n] requesting block fetch for point Some(Point(47867448, "f170baa5702c91b23580291c3a184195df7c77d3e1a03b3d6424793aacc850d6")) [2021-12-13T22:17:15Z INFO oura::sources::n2n] requesting block fetch for point Some(Point(47867448, "f170baa5702c91b23580291c3a184195df7c77d3e1a03b3d6424793aacc850d6")) [2021-12-13T22:17:20Z INFO oura::sources::n2n] requesting block fetch for point Some(Point(47867448, "f170baa5702c91b23580291c3a184195df7c77d3e1a03b3d6424793aacc850d6")) ``` -------------------------------- ### Starting from a Specific Chain Point Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/sources/n2n.mdx TOML configuration to start reading chain data from a specific point (slot and block hash) using the N2C source. ```toml [source] type = "N2C" address = ["Tcp", "relays-new.cardano-mainnet.iohk.io:3001"] magic = "mainnet" [source.intersect] type = "Point" value = [48896539, "5d1f1b6149b9e80e0ff44f442e0cab0b36437bb92eacf987384be479d4282357"] ``` -------------------------------- ### Install Oura using Cargo Source: https://github.com/jpg-store/comet-oura/blob/main/docs/pages/v2/usage/library.mdx This snippet shows how to add the Oura library as a dependency to your Rust project using Cargo. ```rust cargo add oura ``` -------------------------------- ### Hydra Source Configuration Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/sources/hydra.mdx Example TOML configuration for setting up the Hydra source. It specifies the source type and the websocket URL for the Hydra server. ```toml [source] type = "Hydra" ws_url = "ws://127.0.0.1:4001" ``` -------------------------------- ### Webhook Sink Configuration Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/sinks/webhook.mdx Example TOML configuration for the Webhook sink, specifying the URL, authorization, timeout, error policy, and custom headers. ```toml [sink] type = "Webhook" url = "https://endpoint:5000/events" authorization = "user:pass" timeout = 30000 error_policy = "Continue" [sink.headers] extra_header_1 = "abc" extra_header_2 = "123" ``` -------------------------------- ### Redis Streams Sink Configuration (Single Stream) Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/sinks/redis_streams.mdx Example TOML configuration for sending all events to a single Redis stream named 'mystream'. This setup is useful for consolidating all event data into one log. ```toml [sink] type = "Redis" redis_server = "redis://localhost:6379" stream_name = "mystream" ``` -------------------------------- ### not Predicate Example Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/filters/selection.mdx Uses the 'not' predicate to invert the result of another predicate. This example allows all events except 'Transaction' variants. ```toml [[filters]] type = "Selection" [filters.check] predicate = "not" [filters.check.argument] predicate = "variant_in" argument = ["Transaction"] ``` -------------------------------- ### UtxoRPC Source Configuration Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/sources/utxorpc.mdx This snippet demonstrates the basic configuration for a UtxoRPC source, including its type, the Dolos gRPC URL, and the maximum number of items to fetch per page. ```toml [source] type = "UtxoRPC" url = "https://" max_items_per_page = 20 ``` -------------------------------- ### Oura Entry Point with Arguments Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/installation/docker.mdx Demonstrates how to pass command-line arguments to the Oura executable when running within a Docker container. This example shows how to watch a relay and specify the bearer protocol. ```sh docker run -it ghcr.io/txpipe/oura:latest \ watch relays-new.cardano-mainnet.iohk.io:3001 \ --bearer tcp ``` -------------------------------- ### Legacy V1 Filter Output Example Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/filters/legacy_v1.mdx An example of the data structure output by the Legacy V1 filter when all configuration settings are 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 }, ... } } ``` -------------------------------- ### N2C Source Configuration Example Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/sources/n2c.mdx Provides a TOML configuration snippet for setting up a typical Node-to-Client (N2C) source. It includes essential parameters like source type, address, network magic, and optional intersection and mapper strategies. ```toml [source] type = "N2C" address = ["Unix", ""] magic = [source.intersect] type = value = [source.mapper] include_block_end_events = include_transaction_details = include_transaction_end_events = include_block_cbor = ``` -------------------------------- ### Nested Filters Example Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/filters/selection.mdx An example demonstrating nested use of 'any_of' and 'all_of' predicates for complex filtering logic, including variant checks and policy matching. ```toml [[filters]] type = "Selection" [filters.check] predicate = "any_of" [[filters.check.argument]] predicate = "variant_in" argument = ["RollBack"] [[filters.check.argument]] predicate = "all_of" [[filters.check.argument.argument]] predicate = "variant_in" argument = ["CIP25Asset"] [[filters.check.argument.argument]] predicate = "any_of" [[filters.check.argument.argument.argument]] predicate = "policy_equals" argument = "" [[filters.check.argument.argument.argument]] predicate = "policy_equals" argument = "" [[filters.check.argument]] predicate = "all_of" [[filters.check.argument.argument]] predicate = "variant_in" argument = ["Transaction"] [[filters.check.argument.argument]] predicate = "v_key_witnesses_includes" argument = "" ``` -------------------------------- ### Create PostgreSQL Tables Source: https://github.com/jpg-store/comet-oura/blob/main/examples/postgresql/README.md Executes an SQL script to create the required tables in the PostgreSQL database. This script is essential for the sink to function correctly. ```bash psql -h localhost -p 5432 -U postgres -f init.sql ``` -------------------------------- ### ParsedBlock Output Example Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/filters/parse_cbor.mdx Example of the structured data format for a ParsedBlock record after being processed by the parse_cbor filter. This data is typically sent to the next stage or sink. ```json { "event": "apply", "point": { "slot": 0, "hash": "" }, "record": { "header": {}, "body": {} } } ``` -------------------------------- ### S3 Source Configuration Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/sources/s3.mdx Example TOML configuration for setting up an S3 source, specifying the bucket name and the number of items per batch. ```toml [source] type = "S3" bucket = "bucket-name" items_per_batch = 10 ``` -------------------------------- ### Oura Origin Intersect and Finalize Example Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/advanced/intersect_options.mdx Example configuration for Oura to sync the whole Byron era only. It sets the intersection type to 'Origin' and specifies a finalization block hash. ```toml [source.intersect] type = "Origin" [source.finalize] until_hash = "aa83acbf5904c0edfe4d79b3689d3d00fcfc553cf360fd2229b98d464c28e9de" ``` -------------------------------- ### Run Oura Daemon Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/guides/cardano_2_kafka.mdx This command starts the Oura daemon process with the specified configuration file and logging level. It enables Oura to begin streaming data from the Cardano node to Kafka. ```sh RUST_LOG=info oura daemon --config cardano2kafka.toml ``` -------------------------------- ### ParsedTx Output Example Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/filters/parse_cbor.mdx Example of the structured data format for a ParsedTx record after being processed by the parse_cbor filter. This format is generated when the input is a CborTx and requires prior enabling of the split_cbor filter. ```json { "event": "apply", "point": { "slot": 0, "hash": "" }, "record": { "inputs": [], "outputs": [], "..." } } ``` -------------------------------- ### SplitBlock Filter Output Example Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/filters/split_block.mdx Example of the data format sent to the sink after the SplitBlock filter processes a CBOR block. Each event represents a single transaction from the block, formatted as CborTx. ```json { "event": "apply", "point": { "slot": 0, "hash": "" }, "record": { "hex": "" } } ``` -------------------------------- ### Deno Bundle Command Source: https://github.com/jpg-store/comet-oura/blob/main/examples/_deprecated/deno_cip68/README.md Shell command to bundle TypeScript code into a single JavaScript file using Deno. This prepares the custom parser for use with Oura. ```shell deno bundle parser.ts parser.js ``` -------------------------------- ### Oura Watch Mode Usage Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v2/usage/watch.mdx Demonstrates the basic command structure for using Oura's watch mode, including the required socket argument and optional parameters. ```sh oura watch [OPTIONS] ``` -------------------------------- ### Oura Fallback Intersect Example Source: https://github.com/jpg-store/comet-oura/blob/main/docs/v1/advanced/intersect_options.mdx Example configuration for Oura to use a set of fallback intersection points. The chain sync process attempts to intersect at specified slots and block hashes, falling back to the next if a point is not found. ```toml [source.intersect] type = "Fallbacks" value = [ [4449598, "2c9ba2611c5d636ecdb3077fde754413c9d6141c6288109922790e53bbb938b5"], [43159, "f5d398d6f71a9578521b05c43a668b06b6103f94fcf8d844d4c0aa906704b7a6"], [0, "f0f7892b5c333cffc4b3c4344de48af4cc63f55e44936196f365a9ef2244134f"], ] ```