nixie

Crates.ionixie
lib.rsnixie
version0.1.0
created_at2025-09-12 12:07:47.217053+00
updated_at2025-09-12 12:07:47.217053+00
descriptionCLI tool for managing Hydration blockchain forks and Docker containers
homepagehttps://github.com/enthusiastmartin/nixie
repositoryhttps://github.com/enthusiastmartin/nixie
max_upload_size
id1835637
size23,902
Martin Hloska (enthusiastmartin)

documentation

README

Nixie

A CLI tool for managing Hydration blockchain forks and Docker containers.

Overview

Nixie is a Rust-based command-line tool that simplifies the management of Hydration blockchain forks using Docker containers. It provides an easy-to-use interface for scraping chainstate, managing Docker containers, and controlling zombienet instances.

Installation

From Source

# Clone the repository
git clone https://github.com/enthusiastmartin/nixie.git
cd nixie

# Install locally
cargo install --path .

Prerequisites

  • Rust (latest stable version)
  • Docker
  • Access to the galacticcouncil/fork Docker image

Usage

nixie <COMMAND> [OPTIONS]

Commands

scrape - Scrape Chainstate

Scrapes chainstate from a WebSocket URI for a specific block.

nixie scrape --uri <WEBSOCKET_URI> [--at <BLOCK_HASH>]

Example:

nixie scrape --uri wss://1.lark.hydration.cloud --at 0x15c573eaeea039341f6e1df1ecfd70708efa85dced07ad059d58a6234ada5fd7

Options:

  • --uri <URI> - WebSocket URI to scrape from (required)
  • --at <BLOCK_HASH> - Specific block hash to scrape at (optional)

create - Create Docker Image

Creates a new Docker container with the hydration-fork image.

nixie create

This command:

  • Removes any existing hydration-fork container
  • Creates a new container with port 9999 exposed
  • Mounts the local ./data/ directory to the container

start - Start Zombienet

Starts or restarts the zombienet without resetting chainstate.

nixie start

This command:

  • Stops any running hydration-fork container
  • Starts the container in interactive mode

stop - Stop Zombienet

Stops the running zombienet container.

nixie stop

reset - Reset and Start

Resets zombienet's state and starts from the last scraped state.

nixie reset

This command:

  • Stops the running container
  • Backs up the current state
  • Clears all data
  • Restores the backed-up state
  • Restarts the container

Directory Structure

.
├── data/           # Chainstate data directory
│   └── state.json  # Current blockchain state
├── src/
│   └── main.rs     # Main application code
├── Cargo.toml      # Rust project configuration
└── README.md       # This file

Docker Integration

Nixie manages a Docker container named hydration-fork that:

  • Uses the galacticcouncil/fork image
  • Exposes port 9999 for blockchain RPC
  • Mounts ./data/ for persistent storage
  • Runs npm run start:raw by default

Error Handling

The tool includes comprehensive error handling for:

  • Docker command failures
  • File system operations
  • Network connectivity issues
  • Invalid command arguments

Development

Building

cargo build

Running Tests

cargo test

Running in Development

cargo run -- <command> [options]

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

This project is licensed under the MIT OR Apache-2.0 license.

Support

For issues and questions, please open an issue on the GitHub repository.

Commit count: 0

cargo fmt