You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.rst
+29-30
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ On how to set up Nix for ``cardano-node`` development, please see `Building Card
8
8
9
9
10
10
Roles and Responsibilities
11
-
====
11
+
==========================
12
12
13
13
We maintain a [CODEOWNERS file][CODEOWNERS] which provides information who
14
14
should review a contributing PR. Note that you might need to get approvals
@@ -18,43 +18,43 @@ from all code owners (even though GitHub doesn't give a way to enforce it).
18
18
19
19
20
20
Supplementary tooling
21
-
====
21
+
=====================
22
22
23
23
GHCID
24
-
----
24
+
-----
25
25
26
26
run *ghcid* with: ``ghcid -c "cabal repl exe:cardano-node --reorder-goals"``
27
27
28
28
Testing
29
-
====
29
+
=======
30
30
31
31
``cardano-node`` is essentially a container which implements several components such networking, consensus, and storage. These components have individual test coverage. The node goes through integration and release testing by Devops/QA while automated CLI tests are ongoing alongside development.
32
32
33
33
Developers on ``cardano-node`` can `launch their own testnets <https://github.com/input-output-hk/cardano-node-wiki/wiki/launching-a-testnet>`_ or `run the chairman tests <https://github.com/input-output-hk/cardano-node-wiki/wiki/running-chairman-tests>`_ locally.
34
34
35
35
Debugging
36
-
====
36
+
=========
37
37
38
38
Pretty printing CBOR encoded files
39
-
----
39
+
----------------------------------
40
40
41
41
It may be useful to print the on chain representations of blocks, delegation certificates, txs and update proposals. There are two commands that do this (for any cbor encoded file):
Updating package dependencies from Hackage should work like normal in a Haskell project.
60
60
The most important thing to note is that we pin the ``index-state`` of the Hackage package index in ``cabal.project``.
@@ -65,14 +65,14 @@ Because of how we use Nix to manage our Haskell build, whenever you do this you
65
65
You can do this by running ``nix flake lock --update-input hackageNix``.
66
66
67
67
... from the Cardano package repository
68
-
----
68
+
---------------------------------------
69
69
70
70
Many Cardano packages are not on Hackage and are instead in the `Cardano package repository <https://github.com/input-output-hk/cardano-haskell-packages>`__, see the README for (lots) more information.
71
71
Getting new packages from there works much like getting them from Hackage.
72
72
The differences are that it has an independent ``index-state``, and that there is a different Nix command you need to run afterwards: ``nix flake lock --update-input CHaP``.
73
73
74
74
Using unreleased versions of dependencies
75
-
~~~~
75
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76
76
77
77
Sometimes we need to use an unreleased version of one of our dependencies, either to fix an issue in a package that is not under our control, or to experiment with a pre-release version of one of our own packages.
78
78
You can use a ``source-repository-package`` stanza to pull in the unreleased version.
@@ -83,34 +83,34 @@ In that case, release a patched version to the `Cardano package repository <http
83
83
See the README for instructions.
84
84
85
85
Releasing a version of the node
86
-
====
86
+
===============================
87
87
88
88
(There is much more to say here, this is just a small fragment)
89
89
90
90
... to the Cardano package repository
91
-
----
91
+
-------------------------------------
92
92
93
93
When releasing a new version of the node, it and the other packages in this repository should be released to the `Cardano package repository <https://github.com/input-output-hk/cardano-haskell-packages>`__.
94
94
See the README for instructions, including a script to automate most of the process.
95
95
Please note that libraries need bounds on the version of their dependencies to avoid bitrot and be effectively reusable.
96
96
97
-
Workbench: a local cluster playground
98
-
====
97
+
Workbench: running a cluster
98
+
============================
99
99
100
100
You can quickly spin up a local cluster (on Linux and Darwin), based on any of a wide variety of configurations, and put it under a transaction generation workload -- using the ``workbench`` environment:
101
101
102
102
1. Optional: choose a workbench profile:
103
-
- ``default`` stands for a light-state, 6-node cluster, under saturation workload, indefinite runtime
104
-
- ``ci-test`` is the profile run in the node CI -- very light, just two nodes and short runtime
105
-
- ``devops`` is an unloaded profile (no transaction generation) with short slots -- ``0.2`` sec.
106
-
- ..and many more -- which can be either:
107
-
- listed, by ``make ps``
108
-
- observed at their point of definition: `nix/workbench/profiles/prof1-variants.jq <https://github.com/intersectmbo/cardano-node/tree/master/nix/workbench/profiles/prof1-variants.jq#L333-L526>`_
103
+
- ``default`` stands for a light-state, 6-node cluster, under transaction saturation workload, ~30min runtime.
104
+
- ``ci-test-hydra`` is the profile run in the node CI -- very light, just two nodes, Plutus transaction worklooad, =< 3min runtime.
105
+
- ``devops`` is an unloaded profile (no transaction workload) with short slots -- ``0.2`` sec.
106
+
- ...and many more -- which can be:
107
+
- listed by name with ``make ps``
108
+
- inspected with e.g. ``cabal run cardano-profile -- by-name-pretty default-coay`` (default profile with Conway era suffix)
109
109
2. Optional: select mode of operation, by optionally providing a suffix:
110
-
- default -- no suffix -- just enter the workbench shell, allowing you to run ``start-cluster`` at any time. Binaries will be built locally, by ``cabal``.
111
-
- ``autostay`` suffix -- enter the workbench shell, start the cluster, and stay in the shell afterwards. Binaries will be built locally, by ``cabal``.
112
-
- ``autonix`` suffix -- enter the workbench shell, start the cluster. All binaries will be provided by the Nix CI.
113
-
- ..there are other modes, as per `lib.mk <https://github.com/intersectmbo/cardano-node/tree/master/lib.mk>`_
110
+
- no suffix (default) -- just enter the workbench shell, allowing you to run ``start-cluster`` at any time. Binaries will be built locally, by ``cabal``.
111
+
- ``-nix`` suffix -- same as before, but all binaries will be built by Nix or downloaded from Hydra CI cache directly.
112
+
- ``-prof`` and ``-profnix`` suffixes -- same as both before, but all binaries will be built such that GHC profiling is enabled.
113
+
- ...there are other modes as per `lib.mk <https://github.com/intersectmbo/cardano-node/tree/master/lib.mk#L31-L42>`_
114
114
3. Enter the workbench shell for the chosen profile & mode:
115
115
``make <PROFILE-NAME>`` or ``make <PROFILE-NAME>-<SUFFIX>`` (when there is a suffix).
116
116
4. Optional: start cluster:
@@ -119,12 +119,12 @@ You can quickly spin up a local cluster (on Linux and Darwin), based on any of a
119
119
The workbench services are available only inside the workbench shell.
120
120
121
121
Using Cabal
122
-
----
122
+
-----------
123
123
124
124
By default, all binaries originating in the ``cardano-node`` repository are available to ``cabal build`` and ``cabal run``, unless the workbench was entered using one of the pure ``*nix`` modes. Note that in all cases, the dependencies for the workbench are supplied through Nix and have been built/tested on CI.
125
125
126
126
**Dependency localisation** -or- *Cabal&Nix for painless cross-repository work*
The Cabal workflow described above only extends to the repository-local packages. Therefore, ordinarily, to work on ``cardano-node`` dependencies in the context of the node itself, one needs to go through an expensive multi-step process -- with committing, pushing and re-pinning of the dependency changes.
130
130
@@ -168,9 +168,9 @@ Without further ado (**NOTE**: *the order of steps is important!*):
168
168
7. The two packages have now become **local** -- when you try ``cabal build exe:cardano-node`` now, you'll see that Cabal starts to build these dependencies you just localised. Hacking time!
169
169
170
170
Hoogle
171
-
----
171
+
------
172
172
173
-
The workbench shell provides ``hoogle``, with a local database for the full set of dependencies:
173
+
The workbench shell provides ``hoogle``, with a local database for the full **non-local** set of package dependencies:
174
174
175
175
.. code-block:: console
176
176
@@ -186,4 +186,3 @@ The workbench shell provides ``hoogle``, with a local database for the full set
0 commit comments