Skip to main content

A library for Commune network focused on simplicity

Project description

CommuneX

License: MIT Discord Chat PyPI version

Why CommuneX

CommuneX serves as an alternative library/SDK to the original Commune Ai codebase, offering a streamlined and user-friendly experience. It is designed for simplicity and scalable development. To learn more visit docs

Installation with pip

Requirements: Python 3.10+

Install the communex Python package directly with pip:

pip install communex

Or add it to your Poetry project with:

poetry add communex

Installation with Nix

To install communex the communex cli with Nix

nix profile install .

Features

  • Commands
    • Key management
    • Transfering and staking tokens
    • Module management
    • Client to interact with served modules
    • Module class and server
    • Governance participation

Planned

  • Module API extraction and documentation generator

CLI Usage

The CLI commands are structured as follows:

comx [OPTIONS] COMMAND [ARGS]

There are six top-level subcommands:

  • balance: transfer, stake, unstake and showing balance operations
  • key: creating, saving (AKA regenerating), listing and showing balance operations
  • module: info, list, register, serve, update
  • network: block, parameters, proposals / proposing, voting operations
  • subnet: info, list, update
  • misc: apr, circulating supply
comx subcommand [OPTIONS] COMMAND [ARGS]...

Examples

Retrieving Balance

# Show staked, free and total balance.
comx balance show 5FgfC2DY4yreEWEughz46RZYQ8oBhHVqD9fVq6gV89E6z4Ea 

Creating a Key

comx key create key_name

Retrieving Key Info

comx key show key_name

# Add the `--show-private` flag to show sentitive fields like private key.
comx key show key_name --show-private

Listing Keys

# Lists the names and addresses of keys stored on disk.
comx key list 

List Keys With Balances

# Lists keys stored on disk with their balance (free, staked and total).
comx key balances

Retrieving Module Information

# Note that the module has to be registered on the network.
comx module info vali::calc [--balance] 

Retrieving Global Parameters

comx network params

Retrieving Subnet Parameters

comx subnet list

Retrieving Circulating Supply

# Gets all tokens then were ever emitted minus burned tokens.
comx misc circulating-supply 

Completions

You can enable completions for your shell by running:

# On bash
comx --install-completion bash
# On zsh
comx --install-completion zsh

Contributing

Bug reports and pull requests and other forms of contribution are welcomed and encouraged! :)

To report a bug or request a feature, please open an issue on GitHub.

If you have any questions, feel free to ask on the CommuneX Discord channel or post on our GitHub discussions page.

To contribute to the codebase, using Poetry you can install the development dependencies with:

poetry install --with dev

it can require some enviroment-specific binaries to be installed

Commune compatibility

Yes, communex is compatible with the commune library/CLI. However, there are important considerations to note. communex verifies the integrity of your keys, which means that mixing certain types of keys is not permissible. Specifically, if you possess node keys or other similar types that are not designed to receive tokens, you to relocate them outside of the key directory.


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

communex-0.1.35.tar.gz (68.2 kB view details)

Uploaded Source

Built Distribution

communex-0.1.35-py3-none-any.whl (81.4 kB view details)

Uploaded Python 3

File details

Details for the file communex-0.1.35.tar.gz.

File metadata

  • Download URL: communex-0.1.35.tar.gz
  • Upload date:
  • Size: 68.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Linux/6.6.47-1-MANJARO

File hashes

Hashes for communex-0.1.35.tar.gz
Algorithm Hash digest
SHA256 aedd573e1aaf406a42e44409412b4a0ecf99e99e7e3148d897c1a0e4010690c6
MD5 ff1f522d0cebeff6d1d3a0b38400ce39
BLAKE2b-256 d9097a7a524d484ac687e5e460e7edd437e3249d35142eb67d34130b38a8c070

See more details on using hashes here.

File details

Details for the file communex-0.1.35-py3-none-any.whl.

File metadata

  • Download URL: communex-0.1.35-py3-none-any.whl
  • Upload date:
  • Size: 81.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Linux/6.6.47-1-MANJARO

File hashes

Hashes for communex-0.1.35-py3-none-any.whl
Algorithm Hash digest
SHA256 cc1e844f809866ae4c94ea573bcfae21e0702a459ed334708b05c0b65da8e3d8
MD5 044993949fe05b3d598ee348f20b103f
BLAKE2b-256 27e77282b5d1a47566af6ba318835d0a7b39206c6bf1b61c9080e5883815460f

See more details on using hashes here.

Supported by

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