Skip to content

twenty-eighty/reticulum_ex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReticulumEx

Elixir wrapper for the Rust reticulum crate via Rustler, with a lightweight transport runtime and CLI tools.

Installation

Add to mix.exs:

def deps do
  [
    {:reticulum_ex, "~> 0.1"}
  ]
end

Docs: https://hexdocs.pm/reticulum_ex

Quick start

Create an identity and compute a destination name hash:

{:ok, id} = ReticulumEx.Identity.new_from_name("alice")
{:ok, priv_hex} = ReticulumEx.Identity.to_hex(id)
{:ok, pub_hex} = ReticulumEx.Identity.public_hex(id)

{:ok, name_hash_hex} = ReticulumEx.Destination.name_hash("example", "chat")

Build an announce packet and HDLC-encode for wire transport:

{:ok, packet_bin} = ReticulumEx.Packet.announce(id)
{:ok, frame} = ReticulumEx.HDLC.encode(packet_bin)

Runtime and CLIs

Start a transport and watch announces:

mix reticulum.watch --tcp reticulum.betweentheborders.com:4242

Subscribe to link events or send data:

mix reticulum.link --tcp 127.0.0.1:4242
mix reticulum.send --tcp 127.0.0.1:4242 --dest <dest_hex> --data "hello"

Run a simple node from a config (MeshChat/Sideband style):

mix reticulum.node_from_config --file ~/.reticulum/config

Crypto helpers

{:ok, sig} = ReticulumEx.Crypto.sign(id, "data")
:ok = ReticulumEx.Crypto.verify(pub_hex, "data", sig)
{:ok, ct} = ReticulumEx.Crypto.encrypt_to(pub_hex, "secret")
{:ok, pt} = ReticulumEx.Crypto.decrypt_from_identity(id, ct)

Notes

  • Requires Rust toolchain and protoc during build (Reticulum-rs uses tonic-build).
  • Set RUST_LOG=info|debug to enable more runtime logs from the NIF.

About

Elixir wrapper for the Rust `reticulum` crate via Rustler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors