diff --git a/README.rst b/README.rst index 07d212cb5a5..fe58e7c07ea 100644 --- a/README.rst +++ b/README.rst @@ -416,7 +416,63 @@ Byron vote submission: Development **** -Development tooling +Overview +==== + +The ``cardano-node`` development is primarily based on the Nix infrastructure (https://nixos.org/ ), which enables packaging, CI, development environments and deployments. + +On how to set up Nix for ``cardano-node`` development, please see `Building Cardano Node with nix `_. + +Workbench: a local cluster playground +==== + +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: + +1. Optional: choose a workbench profile: + - ``default`` stands for a light-state, 6-node cluster, under saturation workload, indefinite runtime + - ``ci-test`` is the profile run in the node CI -- very light, just two nodes and short runtime + - ``devops`` is an unloaded profile (no transaction generation) with short slots -- ``0.2``s + - ..and many more -- which can be either: + - listed, by ``make ps`` + - observed at their point of definition: `nix/workbench/profiles/prof1-variants.jq `_ +2. Optional: select mode of operation, by optionally providing a suffix: + - default -- no suffix -- just enter the workbench shell, allowing you to run ``start-cluster`` at any time. Binaries will be built locally, by ``cabal``. + - ``autostay`` suffix -- enter the workbench shell, start the cluster, and stay in the shell afterwards. Binaries will be built locally, by ``cabal``. + - ``autonix`` suffix -- enter the workbench shell, start the cluster. All binaries will be provided by the Nix CI. + - ..there are other modes, as per `lib.mk `_ +3. Enter the workbench shell for the chosen profile & mode: + ``make `` or ``make -`` (when there is a suffix). +4. Optional: start cluster: + Depending on the chosen mode, your cluster might already start, or you are expected to start it yourself, using ``start-cluster``. + +The workbench services are available only inside the workbench shell. + +Using Cabal +---- + +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. + +Hoogle +---- + +The workbench shell provides ``hoogle``, with a local database for the full set of dependencies: + +.. code-block:: console + + [nix-shell:~/cardano-node]$ hoogle search TxId + Byron.Spec.Ledger.UTxO newtype TxId + Byron.Spec.Ledger.UTxO TxId :: Hash -> TxId + Cardano.Chain.UTxO type TxId = Hash Tx + Cardano.Ledger.TxIn newtype TxId crypto + Cardano.Ledger.TxIn TxId :: SafeHash crypto EraIndependentTxBody -> TxId crypto + Cardano.Ledger.Shelley.API.Types newtype TxId crypto + Cardano.Ledger.Shelley.API.Types TxId :: SafeHash crypto EraIndependentTxBody -> TxId crypto + Cardano.Ledger.Shelley.Tx newtype TxId crypto + Cardano.Ledger.Shelley.Tx TxId :: SafeHash crypto EraIndependentTxBody -> TxId crypto + Ouroboros.Consensus.HardFork.Combinator data family TxId tx :: Type + -- plus more results not shown, pass --count=20 to see more + +Supplementary tooling ==== GHCID @@ -428,7 +484,7 @@ Haskell Language Server ---- When using Haskell Language Server with Visual Studio Code, you may find that -`HLINT annotations are ignored`. +`HLINT annotations are ignored `_. To work around this, you may run the script ``./scripts/reconfigure-hlint.sh`` to generate a ``.hlint.yaml`` file with HLINT ignore rules derived from the source code.