A collection of applications based on the MANY protocol and MANY libraries
Features
- A ledger client/server
- A key-value store client/server
- An application blockchain interface (ABCI)
- A http proxy
- A 4-nodes end-to-end Docker demo
- CLI developer's tools
- Concise Binary Object Representation (CBOR): RFC 8949
- CBOR Object Signing and Encryption (COSE): RFC 8152
- Platform-independent API to cryptographic tokens: PKCS #11
- Blockchain application platform: Tendermint
- Persistent key-value store: RocksDB
- CBOR playground: CBOR.me
- CBOR diagnostic utilities: cbor-diag
- Software Hardware Security Module (HSM): SoftHSM2
- Bash automated testing system: bats-core
- Container engine: Docker
- The MANY libraries: many-rs
- (macOS) Install
brew
# Follow the instructions on screen
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Update your package database
# Ubuntu
$ sudo apt update
# CentOS
$ sudo yum update
# Archlinux
$ sudo pacman -Syu
# macOS
$ brew update
- Install Rust using rustup
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$ source $HOME/.cargo/env
- Install build dependencies
# Ubuntu
$ sudo apt install build-essential pkg-config clang libssl-dev libsofthsm2 tmux
# CentOS
$ sudo yum install clang gcc softhsm git pkgconf tmux
# Archlinux
$ sudo pacman -S clang gcc softhsm git pkgconf tmux
# macOS
$ brew install tmux
- Build
many-framework
$ git clone https://github.com/liftedinit/many-framework.git
$ cd many-framework
$ cargo build
- Run tests
$ cargo test
Below are some examples of how to use the different CLI.
- Install
tendermint
- Download
tendermint
v0.35.4 from https://github.com/tendermint/tendermint/releases/tag/v0.35.4 - Extract the archive
- Put the path to the
tendermint
executable in your$PATH
- Download
- Install the
many
CLI
$ cargo install --git https://github.com/liftedinit/many-rs many-cli
- Generate a new key and get its MANY ID
# Generate a new Ed25519 key
$ ssh-keygen -a 100 -q -P "" -m pkcs8 -t ecdsa -f id1.pem
# Get the MANY ID of the key
$ many id id1.pem
maeguvtgcrgXXXXXXXXXXXXXXXXXXXXXXXXwqg6ibizbmflicz
- Assign some tokens to your MANY ID by adding it to the
initial
section of thestaging/ledger_state.json5
file
"maeguvtgcrgXXXXXXXXXXXXXXXXXXXXXXXXwqg6ibizbmflicz": {
"MFX": 123456789
}
- (Dev) Comment the
hash
entry from thestaging/ledger_state.json5
file
// hash: "fc0041ca4f7d959fe9e5a337e175bd8a68942cad76745711a3daf820a159f7eb"
# The script will start a `tmux` instance containing 7 panes
# 0: Tendermint ledger
# 1: Tendermint key-value store
# 2: ledger server
# 3: ledger application blockchain interface (port 8000)
# 4: key-value store server
# 5: key-value store application blockchain interface (port 8011)
# 6: http proxy
$ ./scripts/run.sh
# Follow the instructions from the `Requirements` section above before running this example.
# Run the ledger server using the provided initial state and key.
# Create a clean persistent storage.
$ ./target/debug/many-ledger --pem id1.pem --state ./staging/ledger_state.json5 --persistent ledger.db --clean
2022-07-05T18:21:45.598272Z INFO many_ledger: address="maeguvtgcrgXXXXXXXXXXXXXXXXXXXXXXXXwqg6ibizbmflicz"
2022-07-05T18:21:45.625108Z INFO many_ledger::module: height=0 hash="fc0041ca4f7d959fe9e5a337e175bd8a68942cad76745711a3daf820a159f7eb"
# Follow the instructions from the `Requirements` section above before running this example.
# You must have a running ledger server before running this example.
# See section `Run a non-blockchain ledger server` above.
# See section `Run a blockchain key-value store and ledger` above.
$ ./target/debug/ledger --pem id1.pem balance
123456789 MFX (mqbfbahksdwaqeenayy2gxke32hgb7aq4ao4wt745lsfs6wiaaaaqnz)
# Follow the instructions from the `Requirements` section above before running this example.
# You must have a running ledger server before running this example.
# See section `Run a non-blockchain ledger server` above.
# See section `Run a blockchain key-value store and ledger` above.
# Generate a random key and get its MANY ID
$ ssh-keygen -a 100 -q -P "" -m pkcs8 -t ecdsa -f tmp.pem
$ many id tmp.pem
maf4byfbrz7dcc72tgb5zbof75cs52wg2fwbc2fdf467qj2qcx
# Send tokens from id1.pem to tmp.pem
$ ./target/debug/ledger --pem id1.pem send maf4byfbrz7dcc72tgb5zbof75cs52wg2fwbc2fdf467qj2qcx 10000 MFX
# Check the balance of the new ID
$ ./target/debug/ledger --pem tmp.pem balance
10000 MFX (mqbfbahksdwaqeenayy2gxke32hgb7aq4ao4wt745lsfs6wiaaaaqnz)
- Read our Contributing Guidelines
- Fork the project (https://github.com/liftedinit/many-framework/fork)
- Create a feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request (https://github.com/liftedinit/many-framework/pull/new)