Ouroboros Network implements network protocols and applications for the Cardano blockchain:
- network-mux: Multiplexing library
- ouroboros-network: Networking layer for the Ouroboros blockchain protocol
- cardano-diffusion: Networking layer for the Cardano blockchain protocol
- cardano-ping: Utility for pinging Cardano nodes
- ntp-client: NTP client
- monoidal-synchronisation: Monoidal synchronisation primitives
- acts-generic: Generic instances for the
Acttype class - quickcheck-monoids: QuickCheck utilities for monoids
See CONTRIBUTING.md for build setup, coding standards, style guides, and contribution workflow.
cabal build allNote: cabal build (without all) fails at the repo root since there is no package there.
See CONTRIBUTING.md for test commands and patterns. Example:
cabal run ouroboros-network:ouroboros-network-sim-tests -- -p "TxSubmission"The script runs stylish-haskell in-place and then shows a git diff of what changed. Only run it on files relevant to your current work — reformatting unrelated files creates noise in your diff.
./scripts/ci/run-stylish-haskell.sh -u # uncommitted changes only
./scripts/ci/run-stylish-haskell.sh -c # files in HEAD onlyDo not run the script without flags — that reformats all .hs files in the repo.
Config: .stylish-haskell-network.yaml. Requires fd/fdfind and stylish-haskell.
- When using si-timers from io-classes;
threadDelay,timeout,registerDelaytakeDiffTime(seconds), not microseconds. Using3_000_000means three months, not three seconds.
This codebase uses typed-protocols for protocol state machines. When modifying protocols:
- Update the protocol type definition first
- Ensure all state transitions are covered
- Update
Codec.hsfor CBOR serialization - Add tests in the corresponding test module
Heavy use of StrictTVar from Control.Concurrent.Class.MonadSTM.Strict. When modifying shared state:
- Keep critical sections minimal
All components use Control.Tracer. When adding new trace events:
- Add constructor to the relevant
Trace*type - Consider performance impact (avoid expensive operations in hot paths)