xian-core


Namexian-core JSON
Version 1.0.4 PyPI version JSON
download
home_pagehttps://github.com/XianChain/xian
SummaryXian Network Python ABCI Server for CometBFT
upload_time2025-01-30 01:14:22
maintainerNone
docs_urlNone
authorXian Network
requires_python<3.12.0,>=3.11.0
licenseApache-2.0
keywords blockchain xian cometbft abci python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Xian Core

[![CI](https://github.com/xian-network/xian-core/actions/workflows/main.yml/badge.svg)](https://github.com/xian-network/xian-core/actions/workflows/main.yml)

Python-based ABCI (Application Blockchain Interface) server designed for CometBFT 0.38.12. This component serves as the core application layer for the Xian blockchain network.

## Requirements

- Python 3.11 (other versions are not supported)
- CometBFT 0.38.12
- PostgreSQL (for Blockchain Data Service)
- PM2 (for process management)

## Installation and Usage

There are two ways to set up and run Xian Core:

### Method 1: Production Installation (via PyPI)

```bash
# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate

# Install the package
pip install xian-core

# Initialize the node
xian init

# Start the node (standard mode)
xian up

# Start the node with Blockchain Data Service (BDS)
xian up --bds

# View logs
xian logs

# Stop the node
xian down
```

Additional commands:
```bash
xian node-id  # Get node ID
xian wipe     # Wipe blockchain data
xian help     # Show all available commands
```

### Method 2: Development Installation (from source)

```bash
# Clone the repository
git clone https://github.com/xian-network/xian-core.git
cd xian-core

# Create and activate a virtual environment
python3.11 -m venv xian-venv
source xian-venv/bin/activate
cd xian-core

# Install in development mode
pip install -e .

# Initialize CometBFT
make init

# Start the node (standard mode)
make up

# Start the node with Blockchain Data Service (BDS)
make up-bds

# View logs
make logs

# Stop all services
make down
```

Additional Makefile commands:
```bash
make dwu       # Down, wipe, init, up sequence
make node-id   # Show node ID
make ex-state  # Export state
```

## Key Features

- **ABCI Server**: Full implementation of CometBFT's ABCI protocol
- **Smart Contract Support**: Execution environment for Python-based smart contracts
- **State Management**: Advanced state handling with Hash and Variable storage types
- **Transaction Processing**: Comprehensive transaction validation and execution
- **Event System**: Rich event logging system for tracking contract and state changes
- **Blockchain Data Service (BDS)**: PostgreSQL-based service for storing and querying blockchain data
- **Validator Management**: Flexible validator set management
- **Rewards System**: Built-in system for handling transaction fees and rewards

## Blockchain Data Service (BDS)

The Blockchain Data Service provides additional data storage and querying capabilities:
- Store blockchain data in a PostgreSQL database
- Enable advanced querying and indexing of blockchain state
- Enhance performance for complex data retrieval

### Starting with BDS

To start the node with the Blockchain Data Service enabled, use:
```bash
# In PyPI installation
xian up --bds

# In development mode
make up-bds
```

## Architecture Components

- **ABCI Server**: Handles communication with CometBFT
- **Transaction Processor**: Manages transaction execution and state updates
- **Validator Handler**: Manages validator set changes
- **Rewards Handler**: Processes transaction fees and rewards
- **Nonce Manager**: Handles transaction ordering
- **Event System**: Tracks and logs blockchain events
- **Blockchain Data Service**: Provides advanced data storage and querying

## Configuration

The node uses several configuration files:

- CometBFT configuration: `~/.cometbft/config/config.toml`
- Genesis file: `~/.cometbft/config/genesis.json`
- BDS configuration: Located in the BDS service directory

## Query Interface

Examples of querying the node:

```bash
# Get contract state
curl "http://localhost:26657/abci_query?path=\"/get/currency.balances:ADDRESS\""

# Get node health
curl "http://localhost:26657/abci_query?path=\"/health\""

# Get next nonce
curl "http://localhost:26657/abci_query?path=\"/get_next_nonce/ADDRESS\""
```

## Development

### Testing
```bash
# Run tests
python -m pytest tests/
```

### Creating a Release
```bash
# Install required tools
pip install poetry

# Create a new release
./release.sh patch  # For bug fixes (0.1.0 -> 0.1.1)
./release.sh minor  # For new features (0.1.0 -> 0.2.0)
./release.sh major  # For breaking changes (0.1.0 -> 2.0.0)
```

## License

This project is licensed under the Apache License Version 2.0 - see the [LICENSE](LICENSE) file for details.

## Related Projects

- [xian-contracting](https://github.com/xian-network/xian-contracting): Smart contract engine
- [xian-stack](https://github.com/xian-network/xian-stack): Complete blockchain stack deployment
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/XianChain/xian",
    "name": "xian-core",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.12.0,>=3.11.0",
    "maintainer_email": null,
    "keywords": "blockchain, xian, cometbft, abci, python",
    "author": "Xian Network",
    "author_email": "info@xian.org",
    "download_url": "https://files.pythonhosted.org/packages/d9/60/a5c73cab553c12bc6ea455b09f8eb7955df9531b66d059bdf73894d59e5c/xian_core-1.0.4.tar.gz",
    "platform": null,
    "description": "# Xian Core\n\n[![CI](https://github.com/xian-network/xian-core/actions/workflows/main.yml/badge.svg)](https://github.com/xian-network/xian-core/actions/workflows/main.yml)\n\nPython-based ABCI (Application Blockchain Interface) server designed for CometBFT 0.38.12. This component serves as the core application layer for the Xian blockchain network.\n\n## Requirements\n\n- Python 3.11 (other versions are not supported)\n- CometBFT 0.38.12\n- PostgreSQL (for Blockchain Data Service)\n- PM2 (for process management)\n\n## Installation and Usage\n\nThere are two ways to set up and run Xian Core:\n\n### Method 1: Production Installation (via PyPI)\n\n```bash\n# Create and activate a virtual environment\npython -m venv venv\nsource venv/bin/activate\n\n# Install the package\npip install xian-core\n\n# Initialize the node\nxian init\n\n# Start the node (standard mode)\nxian up\n\n# Start the node with Blockchain Data Service (BDS)\nxian up --bds\n\n# View logs\nxian logs\n\n# Stop the node\nxian down\n```\n\nAdditional commands:\n```bash\nxian node-id  # Get node ID\nxian wipe     # Wipe blockchain data\nxian help     # Show all available commands\n```\n\n### Method 2: Development Installation (from source)\n\n```bash\n# Clone the repository\ngit clone https://github.com/xian-network/xian-core.git\ncd xian-core\n\n# Create and activate a virtual environment\npython3.11 -m venv xian-venv\nsource xian-venv/bin/activate\ncd xian-core\n\n# Install in development mode\npip install -e .\n\n# Initialize CometBFT\nmake init\n\n# Start the node (standard mode)\nmake up\n\n# Start the node with Blockchain Data Service (BDS)\nmake up-bds\n\n# View logs\nmake logs\n\n# Stop all services\nmake down\n```\n\nAdditional Makefile commands:\n```bash\nmake dwu       # Down, wipe, init, up sequence\nmake node-id   # Show node ID\nmake ex-state  # Export state\n```\n\n## Key Features\n\n- **ABCI Server**: Full implementation of CometBFT's ABCI protocol\n- **Smart Contract Support**: Execution environment for Python-based smart contracts\n- **State Management**: Advanced state handling with Hash and Variable storage types\n- **Transaction Processing**: Comprehensive transaction validation and execution\n- **Event System**: Rich event logging system for tracking contract and state changes\n- **Blockchain Data Service (BDS)**: PostgreSQL-based service for storing and querying blockchain data\n- **Validator Management**: Flexible validator set management\n- **Rewards System**: Built-in system for handling transaction fees and rewards\n\n## Blockchain Data Service (BDS)\n\nThe Blockchain Data Service provides additional data storage and querying capabilities:\n- Store blockchain data in a PostgreSQL database\n- Enable advanced querying and indexing of blockchain state\n- Enhance performance for complex data retrieval\n\n### Starting with BDS\n\nTo start the node with the Blockchain Data Service enabled, use:\n```bash\n# In PyPI installation\nxian up --bds\n\n# In development mode\nmake up-bds\n```\n\n## Architecture Components\n\n- **ABCI Server**: Handles communication with CometBFT\n- **Transaction Processor**: Manages transaction execution and state updates\n- **Validator Handler**: Manages validator set changes\n- **Rewards Handler**: Processes transaction fees and rewards\n- **Nonce Manager**: Handles transaction ordering\n- **Event System**: Tracks and logs blockchain events\n- **Blockchain Data Service**: Provides advanced data storage and querying\n\n## Configuration\n\nThe node uses several configuration files:\n\n- CometBFT configuration: `~/.cometbft/config/config.toml`\n- Genesis file: `~/.cometbft/config/genesis.json`\n- BDS configuration: Located in the BDS service directory\n\n## Query Interface\n\nExamples of querying the node:\n\n```bash\n# Get contract state\ncurl \"http://localhost:26657/abci_query?path=\\\"/get/currency.balances:ADDRESS\\\"\"\n\n# Get node health\ncurl \"http://localhost:26657/abci_query?path=\\\"/health\\\"\"\n\n# Get next nonce\ncurl \"http://localhost:26657/abci_query?path=\\\"/get_next_nonce/ADDRESS\\\"\"\n```\n\n## Development\n\n### Testing\n```bash\n# Run tests\npython -m pytest tests/\n```\n\n### Creating a Release\n```bash\n# Install required tools\npip install poetry\n\n# Create a new release\n./release.sh patch  # For bug fixes (0.1.0 -> 0.1.1)\n./release.sh minor  # For new features (0.1.0 -> 0.2.0)\n./release.sh major  # For breaking changes (0.1.0 -> 2.0.0)\n```\n\n## License\n\nThis project is licensed under the Apache License Version 2.0 - see the [LICENSE](LICENSE) file for details.\n\n## Related Projects\n\n- [xian-contracting](https://github.com/xian-network/xian-contracting): Smart contract engine\n- [xian-stack](https://github.com/xian-network/xian-stack): Complete blockchain stack deployment",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Xian Network Python ABCI Server for CometBFT",
    "version": "1.0.4",
    "project_urls": {
        "Documentation": "https://github.com/XianChain/xian",
        "Homepage": "https://github.com/XianChain/xian",
        "Repository": "https://github.com/XianChain/xian"
    },
    "split_keywords": [
        "blockchain",
        " xian",
        " cometbft",
        " abci",
        " python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "947c615424f94beca4cc18801a1f25f9d06b7623ab16ff108b73626811492f3d",
                "md5": "fe4f78c075dddc0273a52cc1faeae550",
                "sha256": "6fa21d60c612cdb7104a06e702dcb3a8274693a53efd9f5e22f6ea6780012aee"
            },
            "downloads": -1,
            "filename": "xian_core-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fe4f78c075dddc0273a52cc1faeae550",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.12.0,>=3.11.0",
            "size": 411297,
            "upload_time": "2025-01-30T01:14:20",
            "upload_time_iso_8601": "2025-01-30T01:14:20.371507Z",
            "url": "https://files.pythonhosted.org/packages/94/7c/615424f94beca4cc18801a1f25f9d06b7623ab16ff108b73626811492f3d/xian_core-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d960a5c73cab553c12bc6ea455b09f8eb7955df9531b66d059bdf73894d59e5c",
                "md5": "93fce5add9d21f07f7e17029142d1efd",
                "sha256": "beeb41f6c8d14b62203334233a2b3da1481fc93e43adbd3f36945954b3badbdd"
            },
            "downloads": -1,
            "filename": "xian_core-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "93fce5add9d21f07f7e17029142d1efd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.12.0,>=3.11.0",
            "size": 280978,
            "upload_time": "2025-01-30T01:14:22",
            "upload_time_iso_8601": "2025-01-30T01:14:22.822929Z",
            "url": "https://files.pythonhosted.org/packages/d9/60/a5c73cab553c12bc6ea455b09f8eb7955df9531b66d059bdf73894d59e5c/xian_core-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-30 01:14:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "XianChain",
    "github_project": "xian",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "xian-core"
}
        
Elapsed time: 2.56751s