Skip to content

Commit 09491b1

Browse files
carbolymerDamian Nadalesolgahryniuk
authored
Add debugging cardano-cli on testnet instructions (#22)
* Add debugging cardano-cli on testnet instructions * Fix broken link in plutus-spending-script-example.md * Minor edits --------- Co-authored-by: Damian Nadales <[email protected]> Co-authored-by: olgahryniuk <[email protected]>
1 parent 5bd1f54 commit 09491b1

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Debugging cardano-cli errors on testnet
2+
3+
This document is intended for Cardano node and `cardano-cli` (CLI) users, as well as Cardano developers that wish to investigate CLI problems.
4+
5+
We recommend making sure the `cardano-node` tests pass before starting to debug a problem. Additionally, take a look at the [Consensus sanity checklist](https://input-output-hk.github.io/ouroboros-consensus/docs/for-developers/SanityChecks).
6+
7+
Once the node tests successfully pass, and you've read through the Consensus checklist, collect node logs to speed up the process of finding the cause of a problem. Below, we describe the steps to run a node that connects to a given testnet and get access to a `cardano-cli` that can be used to communicate with the node. These instructions work on a Unix environment with `nix` installed.
8+
9+
Clone [cardano-world](https://github.com/input-output-hk/cardano-world) and check out the testnet branch (eg `sanchonet`).
10+
11+
Once inside the `cardano-world` directory, enter a `nix` shell which has `cardano-node` in its path:
12+
13+
```sh
14+
nix shell github:input-output-hk/cardano-node\?ref=8.1.1\#cardano-node
15+
```
16+
17+
where `8.1.1` should be replaced with the version intended to be tested. Once inside the `nix` shell, we can check whether the `cardano-node` executable is in our `PATH`:
18+
19+
```sh
20+
which cardano-node
21+
```
22+
23+
```text
24+
/nix/store/scmkvbvx1355nwmclmrfd2snwvsgsn30-cardano-node-exe-cardano-node-8.1.1/bin/cardano-node
25+
```
26+
27+
The configuration files for the node can be found inside the `docs/environment/testnet_name`. You can copy these files to a new directory to edit them and have the node use the configuration inside said directory. For instance, after we copy the configuration files to a director named `node-custom-config`, the node can be readily run:
28+
29+
```sh
30+
cardano-node run \
31+
--config node-custom-config/config.json \
32+
--database-path my-node-db \
33+
--socket-path node.socket \
34+
--topology custom-node-config/topology.json | tee -a node.log
35+
```
36+
37+
In particular, make sure to enable the relevant tracers in the node configuration file. In the example above this file is `node-custom-config/config.json`.
38+
39+
Once the node is running, we need a CLI to communicate with it. To enter a shell that has `cardano-cli` in its `PATH` you can run:
40+
41+
```sh
42+
nix develop .#x86_64-linux.automation.devshells.dev
43+
which cardano-cli
44+
```
45+
46+
```text
47+
/nix/store/cbr6kgfsq7pqjwdirvm75lwzaibxvyfm-devshell-dir/bin/cardano-cli
48+
```
49+
50+
## Debugging options
51+
52+
It might be a good idea to adjust the `mapSeverity` attribute for the `LocalTxSubmissionProtocol` to `Debug` in the node configuration file.
53+
54+
```json
55+
...
56+
"mapSeverity": {
57+
"cardano.node.LocalTxSubmissionProtocol": "Debug"
58+
}
59+
...
60+
61+
```

docs/reference/plutus/plutus-spending-script-example.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,5 @@ cardano-cli transaction sign \
115115

116116
If there is ADA at `$dummyaddress` then the Plutus script was successfully executed.
117117

118-
You can use the [example-txin-locking-plutus-script.sh](https://github.com/input-output-hk/cardano-node/blob/master/scripts/plutus/example-txin-locking-plutus-script.sh) in conjunction with [mkfiles.sh alonzo](https://github.com/input-output-hk/cardano-node/blob/master/scripts/scripts/byron-to-alonzo/mkfiles.sh) script to automagically run the `AlwaysSucceeds` script.
118+
You can use the [example-txin-locking-plutus-script.sh](https://github.com/input-output-hk/cardano-node/blob/master/scripts/plutus/example-txin-locking-plutus-script.sh) in conjunction with [mkfiles.sh alonzo](https://github.com/input-output-hk/cardano-node/blob/master/scripts/byron-to-alonzo/mkfiles.sh) script to automagically run the `AlwaysSucceeds` script.
119119

0 commit comments

Comments
 (0)