/iota-channels-lite

A narrow high level API for IOTA streams with Tangle as transport

Primary LanguageRust

About

This repository contains sample code for you to get started with the Channels application in IOTA Streams.

You can find documentation for these examples on the IOTA documentation portal.

Goal

The goal is to build a narrow high-level API that can reduce development complexity when working with IOTA-Streams. The two classes channel_author and channel_subscriber fix the Tangle as transport medium for the stream, removing the need for the developer to interact or even understand the complexities of IOTA and the IOTA Streams.

How It Works

Use channel_author.open() to open the channel and get the announcement verifier
Use channel_author.add_subscriber() to add a subscriber to the channel
Use channel_author.write_signed() to write a signed message(public or masked) into the channel
Use channel_author.write_tagged() to write a tagged message(public or masked) into the channel
Use channel_author.change_key() to change the session key of the channel
Use channel_author.remove_subscriber() to remove a subscriber from the channel

Use channel_subscriber.connect() to connect to a channel
Use channel_subscriber.update_keyload() to update the session key
Use channel_subscriber.read_signed() to read a signed message from the channel
Use channel_subscriber.read_tagged() to read a tagged message from the channel
Use channel_subscriber.disconnect() to disconnect from a channel

Try it yourself

Clone the repo:
git clone https://github.com/AleBuser/iota-channels-lite
Enter into the folder:
cd iota-channels-lite
Run the example code:
cargo run --example example

Use it yourself

Add the dependency to the Cargo.toml file:
channels_lite = { git= "https://github.com/AleBuser/iota-channels-lite"}
Import the channels into you code:
use channels_lite::channels::channel_author;
use channels_lite::channels::channel_subscriber;