This file has been truncated. show original
!> Ensure the [Pre-Requisites](basics.md#pre-requisites) are in place before you proceed.
`cncli.sh` is a script to download and deploy [CNCLI](https://github.com/AndrewWestberg/cncli) created and maintained by Andrew Westberg. It's a community-based CLI tool written in RUST for low-level cardano-node communication. Usage is **optional** and no script is dependent on it. The main features include:
- **PING** - Validates that the remote server is on the given network and returns its response time. Utilized by gLiveView for peer analysis if available.
- **SYNC** - Connects to a node(local or remote) and synchronizes blocks to a local sqlite database.
- **VALIDATE** - Validates that a block hash or partial block hash is on-chain.
- **LEADERLOG** - Calculates a stakepool's expected slot list. On MainNet and the official TestNet, leader schedule is available 1.5 days before the end of the epoch (`firstSlotOfNextEpoch - (3 * k / f)`).
- **SENDTIP** - Send node tip to PoolTool for network analysis and to show that your node is alive and well with a green badge.
- **SENDSLOTS** - Securely sends PoolTool the number of slots you have assigned for an epoch and validates the correctness of your past epochs.
`cncli.sh` script's main functions, sync, leaderlog, validate and PoolTool sendslots/sendtip are not meant to be run manually, but instead deployed as systemd services that run in the background to do the block scraping and validation automatically. Additional commands exist for manual execution to initiate db, filling the blocklog DB with all blocks created by the pool known to the blockchain. Migration of old cntoolsBlockCollector JSON blocklog, re-validation of blocks and leaderlogs are other manual commands possible to execute. See usage output below for a complete list of available commands.
The script work in tandem with [Log Monitor](Scripts/logmonitor.md) to provide faster adopted status but mainly to catch slots node is leader for but are unable to create a block for. These are marked as invalid. Blocklog will however work fine without logmonitor service and CNCLI is able to handle everything except catching invalid blocks.
1. Run the latest version of prereqs.sh with `prereqs.sh -c` to download and install RUST and CNCLI. IOG fork of libsodium required by CNCLI is automatically compiled by CNCLI build process. If a previous installation is found, RUST and CNCLI will be updated to the latest version.
2. Run `deploy-as-systemd.sh` to deploy the systemd services that handle all the work in the background. Six systemd services in total are deployed whereof four are related to CNCLI. See above for the different purposes they serve.
3. If you want to disable some of the deployed services, run `sudo systemctl disable <service>`