Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Releases: iotaledger/streams

v2.0.0: User overhaul

31 Oct 20:33
Compare
Choose a tag to compare

Changelog

All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.

[2.0.0] - 2022-10-28

This version is not reverse compatible with v1.2.0

Large changes to the API to make the streams Library easier to use.
The previous version can be found under branch V1

This release is not compatible with stardust.

Effort towards this will be made in the branch named stardust, but as of yet is not functional. (See #284)

Added

- Generalized Author and Subscriber into User
- Created a User builder pattern for convenient creation
- Created a Message builder for sending messages
- User permission (Read/Write/Admin)
- Branch topics (Set a name for your stream and sub branches)
- Usage of DID Identifier using fragments
- A smaller Tangle client called uTangle (Nano-tangle)

Removed

- Old API

Changed

- Concrete Error types for each Streams crate
- Documentation on all public methods
- Merged crates into a more manageable layout
- Split Identifier into Identity and Identifier

Other

Bindings

  • Bindings temporarily removed. Once Rust API is stable, effort will be put into getting them back.

Protocol

  • The message index with the binary digest of the blake2b256 hash of the Message's Address has been slightly decreased in size again. This change was needed in order to have correct hex format whilst fitting in the 64 character limit. This results in indexes from a seed beeing different from their 1.2.0 counterpart

Quick start example

This example shows how to Create a User and send a message in the new system. For further use for now we would like to refer to our scenarios

Cargo.toml:

streams = { git = "https://github.com/iotaledger/streams", branch = "main" }
anyhow = {version = "1.0", default-features = false}
tokio = {version = "1.5", features = ["rt-multi-thread", "macros"]}
hex = {version = "0.4", default-features = false}
use streams::{
    transport::utangle::Client,
    id::Ed25519, User,
};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let seed = std::env::var("SEED")?;
    let node_url = "https://api.lb-0.h.chrysalis-devnet.iota.cafe";
    let transport: Client = Client::new(node_url);
    let mut author = User::builder()
        .with_transport(transport)
        .with_identity(Ed25519::from_seed(seed))
        .build();

    let base_branch = "BASE_BRANCH";
    let _announcement = author.create_stream(base_branch).await?;

    let payload = b"PUBLICPAYLOAD";
    // Create and send public message with payload (unencrypted)
    let message = author.message().public().with_payload(*payload).send().await?;
    // You can look this index up on the explorer: https://explorer.iota.org/devnet
    println!("message index: {}", hex::encode(message.address().to_msg_index()));
    Ok(())
}

v1.2.0

06 Oct 19:39
b94da49
Compare
Choose a tag to compare

Changelog

All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.

[1.2.0] - 2021-10-06

This version is not reverse compatible with v1.1.0

Added

- Added fetch_prev_msg and fetch_prev_msgs
- State reset available
- Allow transport to be clonable
- Added single depth channel implementation and example
- Added manual subscription/unsubscription for Authors
- Reintroduce unsubscribe message 
- Added guards against adding existing users 
- Added reset_state to author api
- Added announcement_link function 
- New workflows and actions for PR's, including compiling c and wasm bindings
- Select transport in .env in examples

Removed

- Removed encoding and payload length, replaced with implementation type enum
- All core functions converted to async (removing double api)
- Removed Subscriber::recover (it is unnecessary now without internal sync)
- Remove all cargo.locks from git state

Changed

- Unified state storage for pk's and psk's
- Refactored Client to allow for use of existing iota.rs client features including authentication and permanode support
- Corrected error message discrepancy for missing links
- Updated Author::recover to not conduct internal sync
- Fixed a panic in fetch_prev_msgs if a user tries to walk too far back 

Other

Bindings

- Add all new functions and bring to feature parity
- Cleanup and channels.h updates
- Exposed Address::toMsgIndex 
- WASM api refactor for getters/setters/copy

Development

- General linting fixes, performance refactoring
- Doc migration to Docusaurus, all docs available in IOTA wiki 
- Began setting up testing procedure for WASM

Breaking Changes

Protocol

  • Messages are now indexed with the binary digest of the blake2b256 hash of the Message's Address . Messages from previous versions were indexed with the hexadecimal encoding of this digest, resulting in indexes twice as large. This change implies that messages sent with prior versions of Streams won't be found when using Streams v1.2.0 or newer.

Rust

  • Author::new and Subscriber::new signatures has changed
  • sync client has been removed, Streams is now async only. Use block_on() of your preferred runtime to make it sync
  • Address::from_str now takes a single string (the whole string returned by Address::to_string(). It requires importing FromStr trait.
  • Address::to_string() now requires importing ToString
  • Display for Address now outputs the String "<channel-address>:<msgid>" in hexadecimal (the reciprocal of Address::from_str. The hash used for indexing the messages can be obtained with Address::to_msg_index()
  • Author::send_keyload(..) now takes an iterable of &Identifier as parameter, which can be either Identifier::edPubKey or Identifier::PskId

Wasm

  • patching global with node-fetch is no longer needed (but adding node-fetch in the dependencies is still required)
  • SendOptions constructor signature has changed
  • Author constructor signature has changed
  • Address#to_string() has been renamed to Address#toString()
  • Address.from_str has been renamed to Address.parse and takes 1 single string now (that outputted by Address#toString()
  • UserResponse#get_link() method has been removed in favour of accessing to the attribute UserResponse#linkdirectly
  • UserResponse#get_seq_link() method has been removed in favour of accessing to the attribute UserResponse#seqLinkdirectly
  • UserResponse#get_message() method has been removed in favour of accessing to the attribute UserResponse#messagedirectly
  • Message#get_pk() has been renamed Message#get_identifier()
  • Client has been renamed StreamsClient, to make room for iota.rs Client which can now be instantiated from @iota/streams either directly of with a ClientBuilder

v1.1.0

09 Jul 22:13
ca07547
Compare
Choose a tag to compare

Changelog

All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.

[1.1.0] - 2021-07-09

Added

  • Chrysalis-2 client support.
  • User state serialization.
  • Documentation: getting started, API reference, examples for rust, c and wasm.
  • State recovery without state.
  • Fetching of link details per transport
  • Adding of PSKs to author and subscriber
  • Updated C Bindings api and error management
  • Improved WASM interfaces

Removed

  • Old trinary tangle client support.

Other

v1.0.1

09 Dec 01:58
Compare
Choose a tag to compare

This release provides improved error handling with a centralised message location, as well as fixes the message limit bug with the client requests, and additional functions for c bindings.

core: Error handling and messages consolidated
bindings/c: Additional functionality and updated example
cargo: Re-export modules from core, use updated iota.rs to fix request bug

1.0.0: Binary Streams

15 Oct 15:41
762142e
Compare
Choose a tag to compare
  • core: improved spongos automaton and prng, fixed transform and join command;
  • transport: improved transport traits and implementations, better support for async, upgraded iota_client dependency version;
  • app: introduced cursor for sequencing state, cleaned up link generator trait, introduced generic message type;
  • channels: encapsulated transport into Author/Subscriber tangle API, only synchronous transport is supported, fixed message handling issues;
  • bindings/c: added cmake support, cleaned up bindings implementation;
  • cargo: improved crate features.

1.0.0-alpha1: Binary Streams

18 Sep 15:13
6373e9b
Compare
Choose a tag to compare
Pre-release
  • The Rust based core library is now complete
  • C Bindings have been provided for easier compatibility with other languages
  • The codebase has been completely converted to binary resulting in an impressive size reduction.
  • The Merkle Tree Signature Scheme (MSS) has been replaced with Ed25519 signature scheme and NTRU key encapsulation has been replaced with X25519 key exchange. The MSS was much too wasteful and inefficient in some use cases. With binary, Ed25519 is much more lightweight for embedded applications resulting in a drastic improvement in performance and a considerable memory reduction.
  • Single Branch and Multi-Branch Sequencing has been implemented in this release. This functionality should allow for existing MAM implementations to migrate over to Streams much easier due to full compatibility with previous MAM capabilities.
  • Core functionality for no-std has been implemented, and should be completed after this release candidate is finalized later this month.
  • An incompatibility issue with Hornet Nodes has been addressed allowing ease of integration for Streams with Hornet Nodes.