Cardano => Kafka
This guide walks through streaming data from a Cardano node into a Kafka topic with Oura — a typical setup for feeding chain data into an existing stream-processing platform.
Kafka needs a custom build
The Kafka sink isn’t in the default binary. Build Oura with the kafka feature first — see
Install from source.
Prerequisites
- A running Cardano node, reachable locally via a unix socket.
- A Kafka cluster reachable over the network, with the destination topic already created.
- Oura installed with the
kafkafeature enabled.
Instructions
-
Create a config file named
cardano2kafka.toml:cardano2kafka.toml [source]type = "N2C"socket_path = "/opt/cardano/cnode/sockets/node0.socket"[sink]type = "Kafka"brokers = ["kafka-broker-0:9092"]topic = "cardano-events"What this configures:
[source]pulls chain data from your node.N2Creads from the node over Node-to-Client mini-protocols (chain-sync in full-blocks mode).socket_pathis the path to your local node’s unix socket.
[sink]sends the data on.Kafkauses a Kafka producer client as the output.brokerslists the Kafka brokers; add severalhostname:portpairs for a cluster.topicis the topic to publish messages to.
-
Run Oura in
daemonmode against the config:Terminal window RUST_LOG=info oura daemon --config cardano2kafka.toml