Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

input-output-hk/cardano-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cardano-shell

Coverage Status

"master" Build status

This is the cardano-shell project. This project uses Github issues for tracking the project progress.

About

This "node shell" is a thin layer of functionality surrounding the node. It's a thin layer which brings all the other modules working together and makes sure that they have the required resources (configuration, exception handling, monitoring, logging, ...).

cardano-shell

From the top level, the "node shell" contains some of the following:

  • startup initialization
  • configuration loading
  • process monitoring

Some of it responsibilities are the cross-cutting concerns like:

  • logging
  • monitoring
  • configuration
  • exception handling
  • launcher (it's related to startup, but we need to simplify it if possible)

cardano-shell-responsibilities

For example, we can see some of the modules cardano-shell integrates with:

  • network layer
  • blockchain layer
  • ledger layer
  • logging layer
  • monitoring layer
  • wallet (backend) layer

cardano-shell-integration

Any module that requires a substantial amount of logging or monitoring, should provide such resources iself. For example, 1 thread per module should be enough from the point of view of cardano-shell. If, for example, network module requires 5 threads, it should provide such resources itself.

For serving the module functionality, we can use withAsync for top-level calls which is resource/exception safe. The option left for discussion is whether we should have a need for a restart on a module/process.

For more info about the architecture, please take a look at here. For more info about the launcher, please take a look at here.

Example

For example, we can get a chain generator to try to integrate with logging output and cardano-shell should be a piece of code that glues them together, providing a very simple (random) chain generation and it's output. We need to remove a lot of things that are there in the old version. For example, the Servant API.

People

Core seems to be split into:

  • blockchain
  • ledger

Currently, the (relevant) team structure seems to be:

  • networking - Duncan
  • core - Eric
  • logging & monitoring - Alexander

Building

You can build the project using Stack or Nix.

Stack

stack build --fast

Stack + Nix

stack build --fast --nix

Or enable the option for nix building in your local configuration for Stack.

Cabal + Nix

There is an option of using just Cabal + Nix as well - use a small utility script (watch out, it's a dot before the cabal!) and work as you would usually if you develop with cabal:

./cabal new-build

Adding new dependencies can be easy with, for example:

cabal2nix https://github.com/input-output-hk/cardano-prelude --revision "2d6624af423d0a5c7ced6f3ae465eaaeb4ec739e" > cardano-prelude.nix

Tools

You can install multiple tools that can help you, there are configs for these tools in the project repo:

stack install hindent
stack install stylish-haskell
stack install hsimport
stack install hdevtools

Coverage

You can generate a coverage report for the entire project like so:

nix-build -A cardanoShellHaskellPackages.projectCoverageReport --arg config "{ haskellNix = { coverage = true; }; }"

or for each package like this:

nix-build -A cardanoShellHaskellPackages.cardano-shell.coverageReport --arg config "{ haskellNix = { coverage = true; }; }"
nix-build -A cardanoShellHaskellPackages.cardano-launcher.coverageReport --arg config "{ haskellNix = { coverage = true; }; }"

The CI is currently configured to upload a project coverage report to a coverage web service. It does this using the script provided by:

$(nix-build -A uploadCoverallsScript --arg config "{ haskellNix = { coverage = true; }; }")/bin/uploadCoveralls.sh