Giter Site home page Giter Site logo

intersectmbo / ouroboros-network Goto Github PK

View Code? Open in Web Editor NEW
266.0 46.0 86.0 41.66 MB

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.

Home Page: https://ouroboros-network.cardano.intersectmbo.org

License: Apache License 2.0

Haskell 99.16% Nix 0.36% Shell 0.33% Lua 0.14% PowerShell 0.02%
ouroboros blockchain network haskell

ouroboros-network's Introduction

Haskell CI Nightly CI Haddocks Matrix

This repository contains the core components of the network code for the Cardano node. It is a dependency when building the node from the cardano-node repository.

The following graph shows the dependency tree. The top-level package is ouroboros-consensus-diffusion which is part of ouroboros-consensus

  flowchart TD
    A[network-mux]                   --> B[network / Win32-network]
    M[cardano-ping]                  --> A
    D[ouroboros-network-framework]   --> A
    D                                --> E[ouroboros-network-api]
    E                                --> H[typed-protocols]
    G                                --> H[typed-protocols]
    G                                --> E
    F[ouroboros-network]             --> D
    F                                --> G[ouroboros-network-protocols]
    I[ouroboros-consensus-diffusion] --> F
    J[cardano-client]                --> F
    K[ntp-client]                    --> B

   click A "https://ouroboros-network.cardano.intersectmbo.org/network-mux/" _blank
   click M "https://ouroboros-network.cardano.intersectmbo.org/cardano-ping/" _blank
   click D "https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network-framework/" _blank
   click E "https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network-api/" _blank
   click F "https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network/" _blank
   click G "https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network-protocols/" _blank
   click I "https://github.com/intersectmbo/ouroboros-consensus/" _blank
   click J "https://ouroboros-network.cardano.intersectmbo.org/cardano-client/" _blank
   click K "https://ouroboros-network.cardano.intersectmbo.org/ntp-client/" _blank
   click H "https://github.com/input-output-hk/typed-protocols/" _blank
  • network-mux - implementation of a general network multiplexer.
  • ouroboros-network-api - shared API between network and consensus components.
  • ouroboros-network-framework - low-level network components, e.g. snockets, connection manager, inbound governor, handshake mini-protocol, network simulator.
  • ouroboros-network-protocols - implementation of all /node-to-node/ & /node-to-client/ protocols. Also contains a testing library which is implementing various applications for testing purposes.
  • ouroboros-network- top-level integration of all network components also defines node-to-node and node-to-client API. It contains the implementation of the outbound governor.
  • ouroboros-network-mock & ouroboros-network-testing - shared testing code.
  • ntp-client - an ntp client (used by cardano-wallet).
  • cardano-ping - a library which implements the core functionality of cardano-cli ping command.
  • cardano-client - a subscription for node-to-client which wants to connect to a cardano-node.

Libraries:

  • monoidal-synchronisation - a small standalone package which contains synchronisation primitives.

Ouroboros-Network Documentation

We have two documents which describe various levels of the networking layer of the Cardano Shelley implementation:

Work progress

On a biweekly basis, we publish updates on cardano-updates. We are also tracking our current work in the Ouroboros Network Project. Our quarterly goals are published in the [Cardano Node Product Backlog][cardano-node-backlog].

For Contributors

The contributing guide is available here. The style guide is available here. The code of conduct is available here.

Ouroboros-Network API

The API consists of three layers:

• 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 & per message size limits).

• callback MiniProtocolCb. The callback is wrapped in OuroborosApplication GADT which allows to differentiate the initiator/responder (or client/server) callbacks.

• 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.

Demo applications

Instructions To run a demo type:
cabal run <DEMO_NAME> --

After -- you will need to pass arguments, when a demo is run without arguments it will specify what arguments it needs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.