hemictl

command
v1.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 42 Imported by: 0

README

hemictl

The hemictl command is a generic tool to script commands to various daemons.

Usage

hemictl <daemon> <action> [json parameters]

Components

  • daemon: Determines the default URI hemictl connects to (e.g., bss connects to ws://localhost:8081/v1/ws)
  • action: Specifies which command will be called (e.g., ping)
  • parameters: JSON encoded parameters for the action (e.g., {"timestamp":1})

Environment Variables

  • LOGLEVEL: Sets the logging level (e.g., INFO, DEBUG)
  • PGURI: Override database connection URI for database operations
  • HEMI_URI: Override default daemon URI (format: ws://host:port/v1/ws)

Examples

Basic Ping Command
hemictl bss ping '{"timestamp":1}'

Response:

{
    "origintimestamp": 1,
    "timestamp": 1701091119
}
Error Handling Example
hemictl bss l1tick '{"l1_height":0}'

Response:

{
    "error": {
        "timestamp": 1701091156,
        "trace": "804d952f893e686c",
        "error": "L1 tick notification with height zero"
    }
}

Database Operations

hemictl provides direct access to the storage layer, currently supporting PostgreSQL.

Check Database Version
hemictl bfgdb version

Response:

{"bfgdb_version":1}
Custom Database Connection
LOGLEVEL=INFO PGURI="user=username password=secretpassword database=bfgdb" hemictl bfgdb version

Error Handling

The tool provides detailed error messages with:

  • Timestamp of the error
  • Trace ID for debugging
  • Human-readable error message

Notes

  • Always ensure proper JSON formatting in parameters
  • Use appropriate environment variables for production deployments
  • Check logs when troubleshooting failed commands

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL