Prerequisites
You need one of the following:- Docker (recommended for quickest start)
- Go 1.21+ installed
- curl or similar HTTP client
Running the Server
Start the Styx server
The server creates a new Oracle instance with ID 1 by default (see
source/cmd/styx-server/main.go:17).Submitting Witness Reports
Now let’s add some witness reports so the Oracle has data to work with.Register a witness (optional)
Witnesses are auto-registered when they submit reports, but you can register them explicitly:Response:
Add more witness reports
Let’s add reports from witnesses 11 and 12:
Witness 11 (agrees: node 42 is alive)
Witness 12 (neutral: uncertain)
Using the CLI
Styx includes a command-line client for easier interaction.Submit a report via CLI
Simulating a Partition
Let’s see Styx refuse to answer during a network partition.Add conflicting witness reports
Submit reports where some witnesses see node 99 as alive, others as dead:
Witnesses 20-22: See node 99 as ALIVE
Witnesses 30-32: See node 99 as DEAD
Understanding the Response
Let’s break down the query response fields:Environment Variables
The CLI supports custom server URLs:source/cmd/styx/main.go:20-23 for the default server configuration.
Next Steps
Installation Options
Learn about Docker, Go install, and building from source
API Reference
Explore all API endpoints and parameters
Concepts
Deep dive into beliefs, witnesses, and finality
Architecture
Understand how Styx components work together