Ockam logo
Open Source SDKsOckam RegistryOckam HubKafka Add-onInfluxData Add-onAzure HSM Add-onMicrochip Add-ons

Have questions? Let us help!

We are here to help. See the Guides And Demos in GitHub Discussions.

Get Started with the Ockam Rust SDK

This guide walks you through the steps necessary to use the Ockam Rust SDK.

Development Environment

The Ockam Rust SDK supports the rust stable branch.

  1. Install rust and cargo using your preferred method, such as rustup.
  2. Our examples build an "echo service", so echo_service may be a good name for your project. Create a new cargo application project: cargo new echo_service

Adding Ockam to a Rust Project

Add the Ockam dependency to your Cargo.toml:

2ockam = { version = "0", features = ["ockam_transport_tcp"] }

The ockam_transport_tcp feature provides the optional TCP transport add-on for Ockam.

Working with multiple binaries

Some of the Ockam examples need two programs. There are several ways you can configure your project to have multiple binaries. The easiest way, and the way that we will use in this guide is to use the examples directory.

For example:

  1. Create an examples directory.
  2. Create client.rs and server.rs source files in the examples directory.
  3. The programs can be executed using cargo: cargo run --example server and cargo run --example client.

Now we are ready to Start building the Echo Service


Rust Guide



On this page
  • Development Environment
  • Adding Ockam to a Rust Project
  • Working with multiple binaries
Edit this page
Star Ockam repo