runtara-protocol

Crates.ioruntara-protocol
lib.rsruntara-protocol
version1.4.1
created_at2025-12-17 14:06:23.92961+00
updated_at2026-01-10 20:11:57.974886+00
descriptionWire protocol layer for runtara (QUIC transport and Protobuf messages)
homepage
repositoryhttps://github.com/runtara/runtara
max_upload_size
id1990304
size160,459
Volodymyr Rudyi (volodymyrrudyi)

documentation

README

runtara-protocol

Crates.io Documentation License

Wire protocol layer for the Runtara durable execution platform. Provides QUIC transport and Protobuf message definitions for communication between workflow instances and the execution engine.

Overview

This crate is the foundation layer used by all other Runtara crates. It provides:

  • QUIC Transport: Fast, secure communication using the Quinn library
  • Protobuf Messages: Type-safe message definitions generated by prost
  • TLS Support: Built-in certificate generation and verification
  • Connection Management: Client and server connection utilities

Installation

Add to your Cargo.toml:

[dependencies]
runtara-protocol = "1.0"

Usage

Creating a QUIC Client

use runtara_protocol::quic::{QuicClient, ClientConfig};

// Configure the client
let config = ClientConfig {
    server_addr: "127.0.0.1:8001".parse()?,
    server_name: "localhost".to_string(),
    skip_cert_verification: false,
};

// Create and connect
let client = QuicClient::new(config)?;
let connection = client.connect().await?;

Sending Protocol Messages

use runtara_protocol::instance::{RegisterRequest, RegisterResponse};
use runtara_protocol::send_request;

// Create a register request
let request = RegisterRequest {
    instance_id: "my-instance".to_string(),
    tenant_id: "tenant-123".to_string(),
    ..Default::default()
};

// Send and receive response
let response: RegisterResponse = send_request(&connection, request).await?;

Creating a QUIC Server

use runtara_protocol::quic::{QuicServer, ServerConfig};

let config = ServerConfig {
    bind_addr: "0.0.0.0:8001".parse()?,
    ..Default::default()
};

let server = QuicServer::new(config)?;

while let Some(connection) = server.accept().await {
    tokio::spawn(async move {
        // Handle connection
    });
}

Protocol Definitions

The crate includes Protobuf definitions for:

  • Instance Protocol (instance.proto): Communication between workflow instances and runtara-core
    • Register, checkpoint, signal polling, completion
  • Environment Protocol (environment.proto): Management SDK to runtara-environment
    • Image registration, instance lifecycle, status queries
  • Management Protocol (management.proto): Internal communication between environment and core
    • Health, signals, instance status, checkpoint listing/fetch
    • Instance lifecycle and image registration are not exposed here; they live in environment.proto

Related Crates

License

This project is licensed under AGPL-3.0-or-later.

Commit count: 0

cargo fmt