{"id":13472429,"url":"https://github.com/IntersectMBO/ouroboros-network","last_synced_at":"2025-03-26T15:32:19.231Z","repository":{"id":37250685,"uuid":"149481615","full_name":"IntersectMBO/ouroboros-network","owner":"IntersectMBO","description":"Specifications of network protocols and implementations of components running these protocols which support a family of Ouroboros Consesus protocols; the diffusion layer of the Cardano Node.","archived":false,"fork":false,"pushed_at":"2024-10-29T15:38:17.000Z","size":44196,"stargazers_count":275,"open_issues_count":351,"forks_count":87,"subscribers_count":50,"default_branch":"main","last_synced_at":"2024-10-29T15:56:36.190Z","etag":null,"topics":["blockchain","haskell","network","ouroboros"],"latest_commit_sha":null,"homepage":"https://ouroboros-network.cardano.intersectmbo.org","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IntersectMBO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-09-19T16:38:43.000Z","updated_at":"2024-10-29T10:32:23.000Z","dependencies_parsed_at":"2023-12-21T19:31:42.094Z","dependency_job_id":"d25f11a1-562a-4fd5-9ef5-fa25561ad402","html_url":"https://github.com/IntersectMBO/ouroboros-network","commit_stats":null,"previous_names":["intersectmbo/ouroboros-network","input-output-hk/ouroboros-network"],"tags_count":126,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fouroboros-network","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fouroboros-network/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fouroboros-network/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fouroboros-network/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IntersectMBO","download_url":"https://codeload.github.com/IntersectMBO/ouroboros-network/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222151632,"owners_count":16939423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","haskell","network","ouroboros"],"created_at":"2024-07-31T16:00:54.553Z","updated_at":"2025-03-26T15:32:19.225Z","avatar_url":"https://github.com/IntersectMBO.png","language":"Haskell","funding_links":[],"categories":["Haskell","Smart Contract Platforms"],"sub_categories":[],"readme":"# Ouroboros Network\n\n[![x86\\_64-linux](https://img.shields.io/endpoint?url=https://ci.iog.io/job/IntersectMBO-ouroboros-network/master/x86_64-linux.required/shield\u0026style=for-the-badge\u0026label=x86_64-linux)](https://ci.iog.io/job/IntersectMBO-ouroboros-network/main/x86_64-linux.required)\n[![x86\\_64-darwin](https://img.shields.io/endpoint?url=https://ci.iog.io/job/IntersectMBO-ouroboros-network/master/x86_64-darwin.required/shield\u0026style=for-the-badge\u0026label=x86_64-darwin)](https://ci.iog.io/job/IntersectMBO-ouroboros-network/main/x86_64-darwin.required)\n[![aarch64-darwin](https://img.shields.io/endpoint?url=https://ci.iog.io/job/IntersectMBO-ouroboros-network/master/aarch64-darwin.required/shield\u0026style=for-the-badge\u0026label=aarch64-linux)](https://ci.iog.io/job/IntersectMBO-ouroboros-network/main/aarch64-darwin.required)\n[![mingw64](https://img.shields.io/github/actions/workflow/status/intersectmbo/ouroboros-network/build.yml?event=merge_group\u0026label=mingw64\u0026style=for-the-badge)](https://github.com/intersectmbo/ouroboros-network/actions/workflows/build.yml)\n[![Nightly CI](https://img.shields.io/github/actions/workflow/status/intersectmbo/ouroboros-network/nightly.yml?branch=main\u0026label=Nightly\u0026style=for-the-badge)](https://github.com/intersectmbo/ouroboros-network/actions/workflows/nightly.yml)\n[![Haddocks](https://img.shields.io/github/actions/workflow/status/intersectmbo/ouroboros-network/github-page.yml?branch=main\u0026label=Haddocks\u0026style=for-the-badge)](https://ouroboros-network.cardano.intersectmbo.org/)\n[![Discord](https://img.shields.io/discord/1136727663583698984?style=for-the-badge\u0026color=blue)](https://discord.gg/8ncb7fgG)\n\nThis repository contains specification and implementation of the network\nprotocols and applications for Ouroboros family of protocols, primiarly used by\n[cardano-node], [cardano-cli], [cardano-db-sync] or [cardano-wallet].\n\nThe following graph shows the dependency tree.  The top-level package is\n`ouroboros-consensus-diffusion` which is part of [ouroboros-consensus]. Note\nthat we abbreviate `ouroboros-{consensus,network}` to `o-{c,n}` in the labels.\n\n```mermaid\nflowchart TB\n  subgraph ourobors-consensus\n    I[o-c-diffusion]\n    L[o-c]\n    click I \"https://github.com/intersectmbo/ouroboros-consensus/\" _blank\n    click L \"https://github.com/intersectmbo/ouroboros-consensus/\" _blank\n  end\n\n  subgraph ouroboros-network\n    M[cardano-ping]      --\u003e A[network-mux]\n    D[o-n-framework]     --\u003e A\n    D                    --\u003e E[o-n-api]\n    F[ouroboros-network] --\u003e D\n    F                    --\u003e G[o-n-protocols]\n    J[cardano-client]    --\u003e F\n    I                    --\u003e F\n    L                    --\u003e E\n    G                    --\u003e E\n    K[ntp-client]\n\n    click A \"https://ouroboros-network.cardano.intersectmbo.org/network-mux/\" _blank\n    click M \"https://ouroboros-network.cardano.intersectmbo.org/cardano-ping/\" _blank\n    click D \"https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network-framework/\" _blank\n    click E \"https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network-api/\" _blank\n    click F \"https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network/\" _blank\n    click G \"https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network-protocols/\" _blank\n    click J \"https://ouroboros-network.cardano.intersectmbo.org/cardano-client/\" _blank\n    click K \"https://ouroboros-network.cardano.intersectmbo.org/ntp-client/\" _blank\n  end\n\n  subgraph network\n    B[network]     \n    N[Win32-network]\n\n    click B \"https://hackage.haskell.org/package/network\" _blank\n    click N \"https://input-output-hk.github.io/typed-protocols\" _blank\n  end\n\n  subgraph typed-protocols\n    H[typed-protocols]\n\n    click H \"https://github.com/input-output-hk/typed-protocols/\" _blank\n  end\n\n  A --\u003e network\n  K --\u003e network\n\n  E --\u003e typed-protocols\n  G --\u003e typed-protocols\n```\n\n* `network-mux` - implementation of a general network multiplexer.\n* `ouroboros-network-api` - shared API between `network` and `consensus` components.\n* `ouroboros-network-framework` - low-level network components, e.g. snockets,\n  connection manager, inbound governor, handshake mini-protocol, network\n  simulator. \n* `ouroboros-network-protocols` - implementation of all /node-to-node/\n  \u0026 /node-to-client/ protocols.  Also contains a testing library which is\n  implementing various applications for testing purposes.\n* `ouroboros-network`- top-level integration of all network components also\n  defines `node-to-node` and `node-to-client` API.  It contains the implementation\n  of the outbound governor.\n* `ouroboros-network-mock` \u0026 `ouroboros-network-testing` - shared testing code.\n* `ntp-client` - an `ntp` client (used by `cardano-wallet`).\n* `cardano-ping` - a library which implements the core functionality of\n  `cardano-cli ping` command.\n* `cardano-client` - a subscription for `node-to-client` which wants to connect\n  to a `cardano-node`.\n\nLibraries:\n\n* `monoidal-synchronisation` - a small standalone package which contains\n  synchronisation primitives.\n\n\n## Documentation\n\nWe have two documents which describe various levels of the networking layer of\nthe Cardano Shelley implementation:\n\n* [Introduction to the Design of Data Diffusion and Networking of Cardano Shelley](https://ouroboros-network.cardano.intersectmbo.org/pdfs/network-design)\n\n  This document explains the technical requirements and key constraints for the networking\n  layer of the _Cardano Shelley_ implementation of _Ouroboros Praos_.  This is\n  a design document.\n\n* [The Shelley Networking Protocol](https://ouroboros-network.cardano.intersectmbo.org/pdfs/network-spec)\n\n  This document is a technical specification of the networking protocol.  It\n  includes serialisation formats, necessary details of the multiplexer and\n  technical specifications of mini-protocols used by either _node-to-node_ and\n  _node-to-client_ flavours of the protocol.\n\n* [Haddock documentation][ouroboros-network]\n\n- [Official Cardano Documentation](https://docs.cardano.org/en/latest/)\n\n  Specifically the section \"Explore Cardano\" is helpful, since it talks about the [Cardano Architecture](https://docs.cardano.org/explore-cardano/cardano-architecture), [Cardano Design Rationale](https://docs.cardano.org/explore-cardano/cardano-design-rationale), the [Cardano Network](https://docs.cardano.org/explore-cardano/cardano-network/about-the-cardano-network), etc.\n  Although the Cardano documentation is less detailed, it is a good place to start and refresh some more basic concepts about Cardano.\n\n### Work progress\n\nOn a biweekly basis, we publish updates on [cardano-updates].\nWe are also tracking our current work in the [Ouroboros Network Project][ouroboros-network-project].\n\n### Contributing\n\nThe contributing guide is available [here][contributing-guide].\nThe style guide is available [here][style-guide].\nThe code of conduct is available [here][code-of-conduct].\n\n## Ouroboros Network API\n\nThe API consists of three layers:\n\n• mini-protocol APIs, which are GADTs for each mini-protocol under `Ouroboros.Network.Protocol` (defined in `ouroboros-network-protocols` package); this hides heavy type machinery of session types.  One only needs the [`Peer`] or [`PeerPipelined`] type  when one is using [`runPeer`] or [`runPeerPipelined`] function and each protocol exposes a function to create it (e.g. [`chainSyncClientPeer`].  There is also API which allows to run a [`Peer`] or [`PipelinedPeer`] with limits (i.e. per state timeouts \u0026 per message size limits).\n\n• callback [`MiniProtocolCb`].  The callback is wrapped in `OuroborosApplication` GADT which allows to differentiate the initiator/responder (or client/server) callbacks.\n\n• versioning which is a map from version numbers to the above callbacks and version data (the tricky part here is that version data type can be different between different versions; there is a simple way of building this map using a semigroup). You can use [`simpleSingletonVersion`] if your application does not depend on negotiated version data.  However, [`Ouroboros.Network.NodeToNode`] and [`Ouroboros.Network.NodeToClient`] expose API which hides versioning from the caller.\n\n\n## Demo applications\n\n* [demo-chain-sync](https://github.com/intersectmbo/ouroboros-network/wiki/Ouroboros-Network-Demo)\n* [cardano-ping](https://github.com/intersectmbo/ouroboros-network/wiki/cardano-ping)\n* [mux-demo](https://github.com/intersectmbo/ouroboros-network/blob/master/network-mux/demo/mux-demo.hs)\n* [demo-ping-pong](https://github.com/intersectmbo/ouroboros-network/blob/master/ouroboros-network-framework/demo/ping-pong.hs)\n* [demo-ntp-client](https://github.com/intersectmbo/ouroboros-network/blob/master/ntp-client/demo/Main.hs)\n\n\u003cdetails\u003e\n\u003csummary\u003eInstructions\u003c/summary\u003e\nTo run a demo type:\n\n```\ncabal run \u003cDEMO_NAME\u003e --\n```\n\nAfter `--` you will need to pass arguments, when a demo is run without\narguments it will specify what arguments it needs.\n\u003c/details\u003e\n\n[cardano-cli]:  https://github.com/intersectmbo/cardano-cli\n[cardano-db-sync]:  https://github.com/intersectmbo/cardano-db-sync\n[cardano-node]:  https://github.com/intersectmbo/cardano-node\n[cardano-wallet]:  https://github.com/cardano-foundation/cardano-wallet\n[ouroboros-consensus]: https://github.com/intersectmbo/ouroboros-consensus\n[ouroboros-network]: https://ouroboros-network.cardano.intersectmbo.org\n[cardano-updates]: https://updates.cardano.intersectmbo.org/tags/network\n[ouroboros-network-project]: https://github.com/orgs/IntersectMBO/projects/5/views/1\n[contributing-guide]: ./CONTRIBUTING.md\n[code-of-conduct]: ./CODE_OF_CONDUCT.md\n[style-guide]: ./docs/StyleGuide.md\n[`MiniProtocolCb`]: https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network-framework/Ouroboros-Network-Mux.html#t:MiniProtocolCb\n[`Peer`]: https://input-output-hk.github.io/typed-protocols/typed-protocols/Network-TypedProtocol-Core.html#t:Peer\n[`PeerPipelines`]: https://input-output-hk.github.io/typed-protocols/typed-protocols/Network-TypedProtocol-Pipelined.html#t:PeerPipelined\n[`runPeer`]: https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network-framework/Ouroboros-Network-Driver.html#v:runPeer\n[`runPipelinedPeer`]: https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network-framework/Ouroboros-Network-Driver.html#v:runPipelinedPeer\n[`chainSyncClientPeer`]: https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network-protocols/Ouroboros-Network-Protocol-ChainSync-Client.html#v:chainSyncClientPeer\n[`OuroborosApplication`]: https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network-framework/Ouroboros-Network-Mux.html#t:OuroborosApplication\n[`simpleSingletonVersion`]: https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network-framework/Ouroboros-Network-Protocol-Handshake-Version.html#v:simpleSingletonVersions\n[`Ouroboros.Network.NodeToNode`]: https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network/Ouroboros-Network-NodeToNode.html\n[`Ouroboros.Network.NodeToClient`]: https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network/Ouroboros-Network-NodeToClient.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIntersectMBO%2Fouroboros-network","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIntersectMBO%2Fouroboros-network","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIntersectMBO%2Fouroboros-network/lists"}