Skip to content

Commit 9d08d83

Browse files
committed
README: update development section
1 parent 1c5e316 commit 9d08d83

File tree

1 file changed

+58
-2
lines changed

1 file changed

+58
-2
lines changed

README.rst

+58-2
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,63 @@ Byron vote submission:
416416
Development
417417
****
418418

419-
Development tooling
419+
Overview
420+
====
421+
422+
The ``cardano-node`` development is primarily based on the Nix infrastructure (https://nixos.org/ ), which enables packaging, CI, development environments and deployments.
423+
424+
On how to set up Nix for ``cardano-node`` development, please see `Building Cardano Node with nix <https://github.com/input-output-hk/cardano-node/tree/master/doc/getting-started/building-the-node-using-nix.md>`_.
425+
426+
Workbench: a local cluster playground
427+
====
428+
429+
You can quickly spin up a local cluster, based on any of a wide variety of configurations, and put it under a transaction generation workload -- using the ``workbench`` environment:
430+
431+
1. Optional: choose a workbench profile:
432+
- ``default`` stands for a light-state, 6-node cluster, under saturation workload, indefinite runtime
433+
- ``ci-test`` is the profile run in the node CI -- very light, just two nodes and short runtime
434+
- ``devops`` is an unloaded profile (no transaction generation) with short slots -- ``0.2`` s.
435+
- ..and many more -- which can be either:
436+
- listed, by ``make ps``
437+
- observed at their point of definition: `nix/workbench/profiles/prof1-variants.jq <https://github.com/input-output-hk/cardano-node/tree/master/nix/workbench/profiles/prof1-variants.jq#L333-L526>`_.
438+
2. Optional: select mode of operation, by optionally providing a suffix:
439+
- default -- no suffix -- just enter the workbench shell, allowing you to run ``start-cluster`` at any time. Binaries will be built locally, by ``cabal``.
440+
- ``autostay`` suffix -- enter the workbench shell, start the cluster, and stay in the shell afterwards. Binaries will be built locally, by ``cabal``.
441+
- ``autonix`` suffix -- enter the workbench shell, start the cluster. All binaries will be provided by the Nix CI.
442+
- ..there are other modes, as per `lib.mk <https://github.com/input-output-hk/cardano-node/tree/master/lib.mk>`_.
443+
3. Enter the workbench shell for the chosen profile & mode:
444+
``make <PROFILE-NAME>`` or ``make <PROFILE-NAME>-<SUFFIX>`` (when there is a suffix).
445+
4. Optional: start cluster:
446+
Depending on the chosen mode, your cluster might already start, or you are expected to start it yourself, using ``start-cluster``.
447+
448+
The workbench services are available only inside the workbench shell.
449+
450+
Using Cabal
451+
----
452+
453+
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 though Nix and have been built/tested on CI.
454+
455+
Hoogle
456+
----
457+
458+
The workbench shell provides ``hoogle``, with a local database for the full set of dependencies:
459+
460+
.. code-block:: console
461+
462+
[nix-shell:~/cardano-node]$ hoogle search TxId
463+
Byron.Spec.Ledger.UTxO newtype TxId
464+
Byron.Spec.Ledger.UTxO TxId :: Hash -> TxId
465+
Cardano.Chain.UTxO type TxId = Hash Tx
466+
Cardano.Ledger.TxIn newtype TxId crypto
467+
Cardano.Ledger.TxIn TxId :: SafeHash crypto EraIndependentTxBody -> TxId crypto
468+
Cardano.Ledger.Shelley.API.Types newtype TxId crypto
469+
Cardano.Ledger.Shelley.API.Types TxId :: SafeHash crypto EraIndependentTxBody -> TxId crypto
470+
Cardano.Ledger.Shelley.Tx newtype TxId crypto
471+
Cardano.Ledger.Shelley.Tx TxId :: SafeHash crypto EraIndependentTxBody -> TxId crypto
472+
Ouroboros.Consensus.HardFork.Combinator data family TxId tx :: Type
473+
-- plus more results not shown, pass --count=20 to see more
474+
475+
Supplementary tooling
420476
====
421477

422478
GHCID
@@ -428,7 +484,7 @@ Haskell Language Server
428484
----
429485

430486
When using Haskell Language Server with Visual Studio Code, you may find that
431-
`HLINT annotations are ignored<https://github.com/haskell/haskell-language-server/issues/638>`.
487+
`HLINT annotations are ignored <https://github.com/haskell/haskell-language-server/issues/638>`_.
432488

433489
To work around this, you may run the script ``./scripts/reconfigure-hlint.sh`` to generate a ``.hlint.yaml``
434490
file with HLINT ignore rules derived from the source code.

0 commit comments

Comments
 (0)