github.com/badrootd/celestia-core@v0.0.0-20240305091328-aa4207a4b25d/docs/tools/debugging.md (about) 1 --- 2 order: 1 3 --- 4 5 # Debugging 6 7 ## CometBFT debug kill 8 9 CometBFT comes with a `debug` sub-command that allows you to kill a live 10 CometBFT process while collecting useful information in a compressed archive. 11 The information includes the configuration used, consensus state, network 12 state, the node' status, the WAL, and even the stack trace of the process 13 before exit. These files can be useful to examine when debugging a faulty 14 CometBFT process. 15 16 ```bash 17 cometbft debug kill <pid> </path/to/out.zip> --home=</path/to/app.d> 18 ``` 19 20 will write debug info into a compressed archive. The archive will contain the 21 following: 22 23 ```sh 24 ├── config.toml 25 ├── consensus_state.json 26 ├── net_info.json 27 ├── stacktrace.out 28 ├── status.json 29 └── wal 30 ``` 31 32 Under the hood, `debug kill` fetches info from `/status`, `/net_info`, and 33 `/dump_consensus_state` HTTP endpoints, and kills the process with `-6`, which 34 catches the go-routine dump. 35 36 ## CometBFT debug dump 37 38 Also, the `debug dump` sub-command allows you to dump debugging data into 39 compressed archives at a regular interval. These archives contain the goroutine 40 and heap profiles in addition to the consensus state, network info, node 41 status, and even the WAL. 42 43 ```bash 44 cometbft debug dump </path/to/out> --home=</path/to/app.d> 45 ``` 46 47 will perform similarly to `kill` except it only polls the node and 48 dumps debugging data every frequency seconds to a compressed archive under a 49 given destination directory. Each archive will contain: 50 51 ```sh 52 ├── consensus_state.json 53 ├── goroutine.out 54 ├── heap.out 55 ├── net_info.json 56 ├── status.json 57 └── wal 58 ``` 59 60 Note: goroutine.out and heap.out will only be written if a profile address is 61 provided and is operational. This command is blocking and will log any error.