Prerequisites:
- Docker with docker-compose (Podman with podman-compose should work too)
- grpcurl
- pumba for the network resilience example
- When downloading the
pumba
binary from releases, ensure that the "pumba" command is accessible in your system's PATH.
- When downloading the
-
Witnessing events:
We have set up a demonstration of a private chain comprised of four nodes (hence, the minimum number of nodes required to witness an event is 3 nodes) and a client that sends random events to them. Running the example:
- Build the docker image of a validated streams node (this might take a while the first time)
docker build -t comradecoop/validated-streams .
- Start the example network:
(pass --podman to use podman-compose)
./run-example.sh start
- Start an example trusted client witnessing a few thousand events to the example network:
./run-example.sh witness
- (in another shell) Listen for validated events:
./run-example.sh validated
- To stop the network:
./run-example.sh stop
Alternatively, use the combined run command directly instead of steps 2-5:
./run-example.sh build ./run-example.sh run
- Build the docker image of a validated streams node (this might take a while the first time)
-
Network resilience testing:
The following example applies packet loss, frequent crash-recovery, and delayed packets to emulate challenging and poor network conditions. It tests the behavior and resilience of validators within the network under these adverse scenarios.
./run-example.sh disturb
In the basic example, events are witnessed directly from the test script. The script acts as a trusted client and connects to all nodes simultaneously. As such, this example doubles as a demonstration of the danger of exposing the trusted client endpoint to the public - it allows third parties to validate any event they might wish. That's why in a more realistic scenario (e.g. one of the other samples), each validator would run it's own trusted client.