First iteration of gluing our modules together into a PoA private network

Overview

PoA RAFT stack test

 ________  ________  ________
|\   __  \|\   __  \|\   ___  \
\ \  \|\  \ \  \|\  \ \  \\ \  \
 \ \  \\\  \ \   __  \ \  \\ \  \
  \ \  \\\  \ \  \ \  \ \  \\ \  \
   \ \_____  \ \__\ \__\ \__\\ \__\
    \|___| \__\|__|\|__|\|__| \|__|
          \|__|

This repository is a premature effort to glue together our individual modules which includes:

  • NATS-based synchronous network
  • DB layer and serialization
  • Naive transaction validation

Note that our Quantum Cryptographic stack dependency fence is deliberatly missing from the repository, as it's currently only used in private investor demos and setups during the QAN IEO.

Have fun playing with QAN poa-0.0.1 daemon \o/

Usage

DISCLAIMER

This demo is a proof of concept, it does not represent the final product. Thus far only linux distros have been tested. The demo is built in a syncronous way. Since rocksdb is used it does not allow the code to run multiple times from the same root folder. Two alternatives are presented at "Running multiple instances".

Dependencies

To run the demo some dependencies are needed beside the repo itself. These dependencies can be read out of the Dockerfile, but for convinience sake these are:

  • rust 1.40 or newer
  • clang, llvm and libclang-dev: apt-get install -y libclang-dev llvm clang (or equivalent, depending on distro)
  • NATS server (working binary provided in the repo)
  • rocksdb https://github.com/facebook/rocksdb.git

Building

When all dependencies are present the demo can be built by: cargo build or: cargo build --release for a smaller binary. Using the "quantum" feature flag is not possible as not all sources are presented as of yet. The flagged code pieces are present to provide the actual working glue examples.

Running

The first running must be the NATS server as the node uses it. In case the NATS server is not running the demo itself will panic and exit. A working NATS server binary is present at (from the repos root folder).

  • ./nats-server-v2.1.2-linux-386/nats-server
  • cargo run or cargo run --release

Alternatively:

  • cargo build
  • target/debug/poa_demo

You can also use -u and -p to set http basic auth for the rpc. A -n argument is also present to define NATS server location. (default NATS uri: nats://127.0.0.1:4222)

The demo takes data from terminal and uses them to create transactions, that the whole network receives.

The demo is also reachable by JSON-RPC on port 8000. Working jsons are presented in a separate JSON_API.md file as curl commands.

Running multiple instances

RocksDB prevents us from having multiple instances use the same database. One possibility to circumvent this is placing the compiled binary in multiple folders, thus each instance creating and managing its own database.

The other is using docker. The repo itself contains the Dockerfile needed, as well as a compose.sh.

Using the docker path has the following steps in order:

  • systemctl start docker
  • docker network create subs (the subs docker network is used in our compose.sh)
  • docker build . -t poademo
  • start NATS server on the host machine: ./nats-server-v2.1.2-linux-386/nats-server
  • ./compose.sh or
  • docker run -i --net=subs --name="node" -h "node" -d --ip="172.33.0.2" poademo
You might also like...
A Rust library for parsing the SOME/IP network protocol (without payload interpretation).

someip_parse A Rust library for parsing the SOME/IP network protocol (without payload interpretation). Usage Add the following to your Cargo.toml: [de

Computational Component of Polkadot Network
Computational Component of Polkadot Network

Gear is a new Polkadot/Kusama parachain and most advanced L2 smart-contract engine allowing anyone to launch any dApp for networks with untrusted code.

Fullstack development framework for UTXO-based dapps on Nervos Network

Trampoline-rs The framework for building powerful dApps on the number one UTXO chain, Nervos Network CKB. This is an early-stage, currently very incom

Official Implementation of Findora Network.

Findora Platform Wiki Contribution Guide Licensing The primary license for Platform is the Business Source License 1.1 (BUSL-1.1), see LICENSE. Except

Simple in-network file transfer with barely any overhead.

fftp fftp is the "Fast File Transport Protocol". It transfers files quickly between computers on a network with low overhead. Motivation FTP uses two

netavark: A container network stack

netavark: A container network stack Netavark is a rust based network stack for containers. It is being designed to work with Podman but is also applic

A cross-platform, user-space WireGuard port-forwarder that requires no system network configurations.

Cross-platform, user-space WireGuard port-forwarder that requires no system network configurations.

An implementation of the CESS network supported by CESS LAB.
An implementation of the CESS network supported by CESS LAB.

--------- 🌌 ---------An infrastructure of decentralized cloud data network built with Substrate-------- 🌌 -------- ---------------- 🌌 -------------

A small utility to wake computers up or put them to sleep over the local network

WKSL - a wake and sleep utility An experiment in writing a small CLI utility in Rust. The program lets you wake a machine on your local network up fro

Owner
null
A private network system that uses WireGuard under the hood.

innernet A private network system that uses WireGuard under the hood. See the announcement blog post for a longer-winded explanation. innernet is simi

Tonari, Inc 4.1k Dec 29, 2022
Docker containers on a synthetic network. Run applications in a context that lets you manipulate their network conditions.

Synthetic Network Docker containers on a synthetic network. Run applications in a context that lets you manipulate their network conditions. Dependenc

Daily 58 Dec 15, 2022
Grow Rust is a Growtopia Private Server made in Rust

Grow Rust is a Growtopia Private Server made in Rust

null 14 Dec 7, 2022
Acts as an IRC server and a nostr client. Connect with your IRC client using your nostr private key as the password.

nostr-irc Acts as an IRC server and a nostr client. Connect with your IRC client using your nostr private key as the password. Experimental code, use

null 11 Dec 26, 2022
Library + CLI-Tool to measure the TTFB (time to first byte) of HTTP requests. Additionally, this crate measures the times of DNS lookup, TCP connect and TLS handshake.

TTFB: CLI + Lib to Measure the TTFB of HTTP/1.1 Requests Similar to the network tab in Google Chrome or Mozilla Firefox, this crate helps you find the

Philipp Schuster 24 Dec 1, 2022
A library-first, lightweight, high-performance, cloud-native supported API gatewayπŸͺ by RUST

Preview version, will not guarantee the stability of the API! Do NOT use in production environment! A library-first, lightweight, high-performance, cl

Ideal World 4 May 7, 2023
πŸ” Fully-featured metrics collection agent for First Tech Challenge competitions. Supports Prometheus.

Scout Scout is a fully-featured free and open source metrics collector for FTC competitions. The project is licensed under the GNU LGPLv3 license. Fea

hivemind 3 Oct 24, 2023
Network simulation in Rust

netsim - A Rust library for network simulation and testing (currently linux-only). netsim is a crate for simulating networks for the sake of testing n

Andrew Cann 115 Dec 15, 2022
A Curve-like AMM for Secret Network

A Curve-like AMM for Secret Network. Supports a varibale number of tokens with the same underlying value.

Enigma 16 Dec 11, 2022
A multi-protocol network relay

A multi-protocol network relay

zephyr 43 Dec 13, 2022