Concordium / concordium-node

The main concordium node implementation.
GNU Affero General Public License v3.0
45 stars 21 forks source link
blockchain blockchain-node concordium haskell rust

concordium-node

This repository contains the implementation of the concordium p2p node with its dependencies and auxiliaries. The node is split into two parts

The auxiliary packages are the

Submodules

The concordium-base is a a direct dependency of both concordium-consensus/ and concordium-node. Because concordium-base is also used by other components it is a separate repository brought in as a submodule.

The concordium-grpc-api is a simple repository that defines the external GRPC API of the node. This is in term of the .proto file. Because this is used by other components it is also a small separate repository brought in as a submodule.

Do remember to clone recursively or use git submodule update --init --recursive after cloning this repository, or after changing branches.

Configurations and scripts

Building the node

See concordium-node/README.md.

Contributing

To contribute start a new branch starting from main, make changes, and make a merge request. A person familiar with the codebase should be asked to review the changes before they are merged.

Haskell workflow

We typically use stack to build, run, and test the code. In order to build the haskell libraries the rust dependencies must be pre-build, which is done automatically by the cabal setup script.

Code should be formatted using fourmolu version 0.13.1.0 and using the config fourmolu.yaml found in the project root. The CI is setup to ensure the code follows this style.

To check the formatting locally run the following command from the project root:

On unix-like systems:

$ fourmolu --mode check $(git ls-files '*.hs')

To format run the following command from the project root:

On unix-like systems:

$ fourmolu --mode inplace $(git ls-files '*.hs')

Lines should strive to be at most 100 characters, naming and code style should follow the scheme that already exists.

We do not use any linting tool on the CI. Running hlint might uncover common issues.

Rust workflow

We use stable version of rust, 1.73, to compile the code.

The CI is configured to check two things