{"id":28600675,"url":"https://github.com/xian-network/xian-node","last_synced_at":"2025-06-11T14:33:02.159Z","repository":{"id":280196731,"uuid":"941260247","full_name":"xian-network/xian-node","owner":"xian-network","description":"Xian Network node implementation based on CometBFT","archived":false,"fork":false,"pushed_at":"2025-04-19T02:15:33.000Z","size":2987,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T11:05:25.772Z","etag":null,"topics":["blockchain","cometbft","python","smart-contracts","xian"],"latest_commit_sha":null,"homepage":"https://xian.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xian-network.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-01T21:34:27.000Z","updated_at":"2025-04-19T02:14:11.000Z","dependencies_parsed_at":"2025-03-01T22:36:50.630Z","dependency_job_id":null,"html_url":"https://github.com/xian-network/xian-node","commit_stats":null,"previous_names":["xian-network/xian-node"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xian-network%2Fxian-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xian-network%2Fxian-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xian-network%2Fxian-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xian-network%2Fxian-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xian-network","download_url":"https://codeload.github.com/xian-network/xian-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xian-network%2Fxian-node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259280658,"owners_count":22833432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","cometbft","python","smart-contracts","xian"],"created_at":"2025-06-11T14:30:47.822Z","updated_at":"2025-06-11T14:33:02.144Z","avatar_url":"https://github.com/xian-network.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./logo.png\" alt=\"Logo\" width=\"400\"\u003e\n  \u003ch1 align=\"center\"\u003eXian Network Node\u003c/h1\u003e\n\u003c/div\u003e\n\n[![CI](https://github.com/xian-network/xian-node/actions/workflows/main.yml/badge.svg)](https://github.com/xian-network/xian-node/actions/workflows/main.yml)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nPython-based ABCI (Application Blockchain Interface) server designed for CometBFT 0.38. This component serves as the core application layer for the Xian blockchain network.\n\n## Requirements\n\n- [Python 3.11.11](https://www.python.org/downloads/release/python-31111) (other versions are not officially supported)\n- [CometBFT 0.38](https://docs.cometbft.com/v0.38) (specifically 0.38.x, not 0.37.x or 1.0.x)\n- [PostgreSQL](https://www.postgresql.org) (for Blockchain Data Service)\n- [PM2](https://pm2.keymetrics.io) (for process management)\n\n## Dependencies Installation\n\n### Python Installation\n\nXian Node requires Python 3.11.11 specifically. We recommend using [pyenv](https://github.com/pyenv/pyenv) to manage Python versions.\n\n### Installing pyenv\n\n- **macOS/Linux**: Follow the installation instructions at [https://github.com/pyenv/pyenv#installation](https://github.com/pyenv/pyenv#installation)\n- **Windows**: Use [pyenv-win](https://github.com/pyenv-win/pyenv-win#installation) with instructions at [https://github.com/pyenv-win/pyenv-win#installation](https://github.com/pyenv-win/pyenv-win#installation)\n\n### Installing Python 3.11.11 with pyenv\n\nOnce pyenv is installed, you can install and set up Python 3.11.11:\n\n```bash\n# Install Python 3.11.11\npyenv install 3.11.11\n\n# Set it as your global Python version (optional)\npyenv global 3.11.11\n\n# Verify the installation\npython --version  # Should output Python 3.11.11\n```\n\n### Installing CometBFT 0.38\n\nXian Node requires [CometBFT 0.38.x](https://docs.cometbft.com/v0.38) specifically (not 0.37.x or 1.0.x). Follow these steps to install it:\n\n1. Download the appropriate binary for your platform from the [CometBFT releases page](https://github.com/cometbft/cometbft/releases)\n   - Make sure to select a release with version 0.38.x (e.g., v0.38.0, v0.38.1, etc.)\n\n2. For Linux/macOS:\n   ```bash\n   # Example for Linux amd64, adjust the version number and OS/arch as needed\n   wget https://github.com/cometbft/cometbft/releases/download/v0.38.0/cometbft_0.38.0_linux_amd64.tar.gz\n   \n   # Extract the tarball\n   tar -xzf cometbft_0.38.0_linux_amd64.tar.gz\n   \n   # Move the binary to your PATH\n   sudo mv cometbft /usr/local/bin/\n   \n   # Verify the installation\n   cometbft version  # Should output v0.38.x\n   ```\n\n3. For Windows:\n   - Download the appropriate Windows zip file\n   - Extract the contents\n   - Add the extracted directory to your PATH environment variable\n   - Verify installation by running `cometbft version` in Command Prompt or PowerShell\n   \nRemember, it's crucial to use CometBFT 0.38.x as other versions are not compatible with Xian Node.\n\n## Installation and Usage\n\nThere are multiple ways to set up and run Xian Node:\n\n### Method 1: Production Installation (via PyPI)\n\n```bash\n# Ensure you're using Python 3.11.11\npyenv local 3.11.11\n\n# Create and activate a virtual environment\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n\n# Install the package\npip install xian-node\n\n# Initialize the node\nxian-node init\n\n# Start the node (standard mode)\nxian-node up\n\n# Start the node with Blockchain Data Service (BDS)\nxian-node up --bds\n\n# View logs\nxian-node logs\n\n# Stop the node\nxian-node down\n```\n\nAdditional commands:\n```bash\nxian-node node-id  # Get node ID\nxian-node wipe     # Wipe blockchain data\nxian-node help     # Show all available commands\n```\n\n### Method 2: Installation with Poetry\n\n[Poetry](https://python-poetry.org) is a dependency management and packaging tool for Python. To install Poetry, follow the instructions at [https://python-poetry.org/docs/#installation](https://python-poetry.org/docs/#installation).\n\n```bash\n# Ensure pyenv is set to Python 3.11.11\npyenv local 3.11.11\n\n# Clone the repository\ngit clone https://github.com/xian-network/xian-node.git\ncd xian-node\n\n# Configure Poetry to use Python 3.11.11\npoetry env use $(pyenv which python)\n\n# Install dependencies with Poetry\npoetry install\n\n# Use Poetry to run commands\npoetry run xian-node init\npoetry run xian-node up\n\n# Or activate the Poetry virtual environment and run directly\npoetry shell\nxian-node init\nxian-node up\n```\n\n### Method 3: Development Installation (from source)\n\n```bash\n# Ensure you're using Python 3.11.11\npyenv local 3.11.11\n\n# Clone the repository\ngit clone https://github.com/xian-network/xian-node.git\ncd xian-node\n\n# Create and activate a virtual environment\npython -m venv xian-venv\nsource xian-venv/bin/activate  # On Windows: xian-venv\\Scripts\\activate\ncd xian-node\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-node up --bds\n\n# In development mode\nmake up-bds\n```\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## 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-stack](https://github.com/xian-network/xian-stack): Complete blockchain stack deployment packaged as a Docker container\n- [xian-contracting](https://github.com/xian-network/xian-contracting): Smart contract engine used by xian-node\n- [xian-js](https://github.com/xian-network/xian-py): JavaScript SDK for xian-node\n- [xian-py](https://github.com/xian-network/xian-js): Python SDK for xian-node\n\n## Repository Stats\n\n![Alt](https://repobeats.axiom.co/api/embed/24d5a438ef0cf14c5f02c7286d04f83148bb192f.svg \"Repobeats analytics image\")","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxian-network%2Fxian-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxian-network%2Fxian-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxian-network%2Fxian-node/lists"}