________ ________ ________|\ __ \|\ __ \|\ ___ \\ \ \|\ \ \ \|\ \ \ \\ \ \\ \ \\\ \ \ __ \ \ \\ \ \\ \ \\\ \ \ \ \ \ \ \\ \ \\ \_____ \ \__\ \__\ \__\\ \__\\|___| \__\|__|\|__|\|__| \|__|\|__|
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 deliberately 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/
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 synchronous 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”.
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)
When all dependencies are present the demo can be built by:
git clone https://github.com/QANplatform/its_alive.gitcd its_alivecargo build
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.
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). The steps of running in order are:
cargo run --release if compiled with “--release” flag (
cargo run itself will compile the code if modifications are present since the last compiled version, or no compiled version is present.)
You can also use
-p to set http basic auth for the rpc. A
-n argument is also present to define NATS server location. (default NATS uri:
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.
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
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
in the repo root folder running:
docker build . -t poademo
running the NATS server locally, outside of docker (all nodes from docker will connect to it)
a) using the
compose.sh with an integer parameter to define instance count or using the following to create a single instance manually
docker run -i --net=subs --name="node" -h "node" -d --ip="220.127.116.11" poademo