Introduction
The Ubu-Block CLI is a command-line tool for managing blockchain operations, including initialization, validation, querying, and submitting election results. Built with Rust, it provides a fast and reliable interface for interacting with the Ubu-Block blockchain.Installation
From Source
Clone the repository and build the CLI:target/release/ubu-block.
Using Pre-built Binaries
- Download the latest binary from the releases page
- Make it executable:
chmod +x ubu-block - Move it to your PATH:
sudo mv ubu-block /usr/local/bin/
Configuration
All CLI commands require a configuration file that specifies database locations. Use the-c or --config flag to specify the config file:
Config File Format
The configuration file is in TOML format:Initial Setup
Before using the CLI, create the necessary directories and database files:Available Commands
The Ubu-Block CLI provides the following commands:init
Initialize a new blockchain with genesis block
submit
Submit polling station results to a submission node
query
Execute SQL queries on the blockchain data
validate
Verify blockchain integrity and validity
import
Import an existing SQLite blockchain database
Command Structure
All commands follow this general structure:Global Options
Path to the configuration file containing database connection strings
Display the CLI version
Display help information
Usage Examples
Initialize a blockchain
Submit results
Query data
Validate blockchain
Getting Help
For help with any command:Next Steps
Initialize Blockchain
Learn how to create a new blockchain
Query Data
Explore querying blockchain data
Submit Results
Submit election results to nodes
Validate Chain
Verify blockchain integrity