/many-rs

Rust libraries for the Many Protocol

Primary LanguageRustApache License 2.0Apache-2.0

many-rs

ci license

Rust libraries for the MANY protocol.

Features

  • MANY module interfaces
  • MANY common types
  • MANY message and transport layers
  • MANY client and server
  • Hardware Security Module
  • CLI developer's tools

References

  • Concise Binary Object Representation (CBOR): RFC 8949
  • CBOR Object Signing and Encryption (COSE): RFC 8152
  • Platform-independent API to cryptographic tokens: PKCS #11

Developer tools

Installation

  1. Update your package database
# Ubuntu
$ sudo apt update

# CentOS
$ sudo yum update

# Archlinux
$ sudo pacman -Syu
  1. Install Rust using rustup
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$ source $HOME/.cargo/env
  1. Install build dependencies
# Ubuntu
$ sudo apt install build-essential pkg-config clang libssl-dev libsofthsm2

# CentOS
$ sudo yum install clang gcc softhsm git pkgconf

# Archlinux
$ sudo pacman -S clang gcc softhsm git pkgconf

# macOS
$ git # and follow the instructions
  1. Build many-rs
$ git clone https://github.com/liftedinit/many-rs.git
$ cd many-rs
$ cargo build
  1. Run tests
$ cargo test

Usage example

Below are some examples of how to use the many CLI.

Retrieve the MANY ID of a key

# Generate a new Ed25519 key
$ openssl genpkey -algorithm Ed25519 -out id1.pem

# Print the MANY ID of the key
$ ./target/debug/many id id1.pem
mafdzlw6ktmpncikho6wwswzej7rpja7fgtbn33xzwkfngdygc

Retrieve the status of a running MANY server

$ ./target/debug/many message --server https://alberto.app/api 'status' '{}'
{_
    0: 1,
    1: "AbciModule(many-ledger)",
    2: h'a5010103270481022006215820e5cd546d5292af5d9f0ffd54b57ff555c51b91a249b9cf544010a3c01cfa75a2',
    3: 10000_1(h'01378dd9916915fb276116ff4bc13c04a4e413f663e04b710199c46021'),
    4: [0, 1, 2, 4, 6, 8, 9, 1002_1],
    5: "0.1.0",
    7: 300_1,
}

Contributing

  1. Read our Contributing Guidelines
  2. Fork the project (https://github.com/liftedinit/many-rs/fork)
  3. Create a feature branch (git checkout -b feature/fooBar)
  4. Commit your changes (git commit -am 'Add some fooBar')
  5. Push to the branch (git push origin feature/fooBar)
  6. Create a new Pull Request (https://github.com/liftedinit/many-rs/pull/new)