Skip to main content

A simulated Autonomi node for testing node management software

Project description

fakenode

A simulated Autonomi node for testing node management software.

What is fakenode?

fakenode provides a lightweight simulator that mimics the HTTP endpoints of an Autonomi node. It's designed for testing node management tools without running actual nodes, making development and testing faster and easier.

Features

  • Simulates /metadata and /metrics endpoints with realistic OpenMetrics format responses
  • Configurable node version, peer ID, and performance metrics
  • Creates node environment files (PID, peer-id, logs) for testing process management
  • Lightweight Flask-based server with minimal dependencies
  • Available as a Python package on PyPI

Installation

pip install fakenode

Quick Start

Running directly with Python

# Run a simulated node on port 9090 using the fakenode command
fakenode \
  --metrics-server-port 9090 \
  --show-version "v0.4.4" \
  --root-dir /tmp/test-node \
  --create-files

# Or run as a Python module
python3 -m fakenode.server \
  --metrics-server-port 9090 \
  --show-version "v0.4.4" \
  --root-dir /tmp/test-node \
  --create-files

Creating deployment scripts with fakeshell

For node management software that deploys nodes as executables, use fakeshell to generate shell script wrappers:

# Generate an executable script for a specific node version using the fakeshell command
fakeshell \
  --show-version "v0.4.4" \
  --output ./antnode

# Or run as a Python module
python3 -m fakenode.fakeshell \
  --show-version "v0.4.4" \
  --output ./antnode

# The generated script can now be used like a binary
./antnode \
  --metrics-server-port 9090 \
  --root-dir /tmp/test-node \
  --create-files

You can also customize the Python interpreter and enable file creation:

# Use a specific Python installation and enable file creation
fakeshell \
  --show-version "v0.5.0" \
  --python "/usr/local/bin/python3.11" \
  --create-files \
  --output ./antnode

# Or run as a Python module
python3 -m fakenode.fakeshell \
  --show-version "v0.5.0" \
  --python "/usr/local/bin/python3.11" \
  --create-files \
  --output ./antnode

The generated script contains editable variables for version, Python path, and file creation settings, allowing manual customization after generation.

Note: The --create-files option in fakeshell sets a variable in the generated script that controls whether the --create-files flag is passed to fakenode. This is a custom fakenode option not used by antctl or other node managers, so it must be configured either during script generation or by manually editing the CREATE_FILES variable in the generated script.

Use Cases

  • Testing node management software during development
  • Automated testing of monitoring systems
  • Simulating node behavior without resource overhead
  • Development environments where running real nodes isn't practical

Documentation

For detailed usage, API documentation, and all available command-line options, see FAKENODE.md.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fakenode-0.4.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fakenode-0.4.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file fakenode-0.4.0.tar.gz.

File metadata

  • Download URL: fakenode-0.4.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for fakenode-0.4.0.tar.gz
Algorithm Hash digest
SHA256 1b9504832b634b15aacd8823f8fa575ba27e16a80510ab3a0afcfbd19089ecff
MD5 aa5e6c2591acc6972752a63f32f71f2a
BLAKE2b-256 b445236377e0913c8378cd9076227868fa37fd892baa3f7f28380f32d788c8ae

See more details on using hashes here.

File details

Details for the file fakenode-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: fakenode-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for fakenode-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9da368c6a174ef4a80feca61e322421b361bde06d8cb266bccb0d65951ddd916
MD5 c0f29fe5280e4d030b4ab0db65df87ac
BLAKE2b-256 94b2d65385b67e99bc0dabbb5798d452a61b928b4049ca55fc4fbb496f17fcde

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page