Skip to content

Getting Started

Prerequisites

Docker with Compose, OpenSSL, and Python 3 for the checks.

1. Start the stack

cd src/relay
deploy/scripts/up.sh

2. Watch the cluster form

deploy/scripts/compose.sh logs hyper-0
curl -s http://127.0.0.1:7480/v1/status

The aggregator status lists every shard with its length, its signed length and its projected position.

3. Replicate an event

Publish on one relay and read it from another:

deploy/scripts/rn.sh event -kind 1 -content "hello swarm" -relay ws://hrelay-1:8080
deploy/scripts/rn.sh query -relay ws://hrelay-2:8080 -id <event id>
curl -s http://127.0.0.1:7462/v1/finality/<event id>

4. See a partition heal

deploy/scripts/compose.sh stop hyper-1 hyper-2 hrelay-1 hrelay-2
deploy/scripts/rn.sh event -kind 1 -content "minority" -relay ws://hrelay-0:8080
curl -s http://127.0.0.1:7460/v1/finality/<event id>
deploy/scripts/compose.sh up -d --wait
curl -s http://127.0.0.1:7461/v1/finality/<event id>

While two of three nodes are down, finalized stays false. After they return, the event is final and served everywhere.

5. Publish and search with proofs

mkdir repo && echo one > repo/main.txt
deploy/scripts/hn.sh author --repo /work/repo --id demo --title "Demo repo" --store http://assets-0:8080 --relay ws://l1-0:8080
deploy/scripts/hn.sh search "q=demo"

The result contains "verified":true and the keys of the attesting nodes.

6. Prove a deletion

deploy/scripts/hn.sh author --delete --id demo --relay ws://l1-0:8080
deploy/scripts/hn.sh state "addr/30500:<author>:demo"

The proven value is deleted.

7. Stop

deploy/scripts/down.sh