evrmore-rpc


Nameevrmore-rpc JSON
Version 3.3.0 PyPI version JSON
download
home_pagehttps://manticore.technology
SummaryA high-performance Python wrapper for Evrmore blockchain RPC commands with a seamless API
upload_time2025-03-08 09:39:17
maintainerNone
docs_urlNone
authorManticore Technologies
requires_python>=3.8
licenseNone
keywords evrmore blockchain cryptocurrency rpc json-rpc async seamless-api
VCS
bugtrack_url
requirements aiohttp requests pydantic rich pytest pytest-asyncio
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Evrmore RPC Client

[![PyPI version](https://img.shields.io/pypi/v/evrmore-rpc.svg)](https://pypi.org/project/evrmore-rpc/)
[![Python versions](https://img.shields.io/pypi/pyversions/evrmore-rpc.svg)](https://pypi.org/project/evrmore-rpc/)
[![License](https://img.shields.io/github/license/manticoretechnologies/evrmore-rpc.svg)](https://github.com/manticoretechnologies/evrmore-rpc/blob/main/LICENSE)
[![Tests](https://github.com/manticoretechnologies/evrmore-rpc/workflows/Python%20Package/badge.svg)](https://github.com/manticoretechnologies/evrmore-rpc/actions)

A Python client for interacting with the Evrmore blockchain via RPC, featuring a seamless API that works in both synchronous and asynchronous contexts.

## Key Features

- **Seamless API**: Use the same API in both synchronous and asynchronous code
- **Automatic Context Detection**: Client automatically adapts to sync or async usage
- **Comprehensive Type Hints**: Better IDE integration and code completion
- **Support for All Evrmore RPC Commands**: Complete coverage of the Evrmore API
- **ZMQ Support**: Real-time blockchain notifications via ZMQ
- **Resource Management**: Proper cleanup without requiring context managers
- **High Performance**: Optimized for speed and efficiency

## Installation

```bash
pip3 install evrmore-rpc
```

## Basic Usage

```python
from evrmore_rpc import EvrmoreClient

# Create a client
client = EvrmoreClient()

# Use synchronously
info = client.getblockchaininfo()
print(f"Chain: {info['chain']}, Blocks: {info['blocks']}")

# Use asynchronously
import asyncio

async def main():
    info = await client.getblockchaininfo()
    print(f"Chain: {info['chain']}, Blocks: {info['blocks']}")
    
    # Clean up when done
    await client.close()

asyncio.run(main())
```

## Running Examples

The repository includes several examples demonstrating different aspects of the library. You can run them using the `run_examples.py` script:

```bash
# List available examples
python3 scripts/run_examples.py --list

# Run a basic example
python3 scripts/run_examples.py super_simple.py

# Run an advanced example
python3 scripts/run_examples.py asset_monitor/monitor.py
```

### Basic Examples

- `super_simple.py`: The simplest example showing the core functionality of the seamless API.
- `seamless_api.py`: A more comprehensive example demonstrating the seamless API in various scenarios.
- `simple_auto_detect.py`: Shows how the client automatically detects whether it's being used in a synchronous or asynchronous context.

### Advanced Examples

- `asset_monitor/monitor.py`: Real-time monitoring of asset creation and transfers.
- `blockchain_explorer/explorer.py`: Simple blockchain explorer implementation.
- `network_monitor/monitor.py`: Monitor network health and peer connections.
- `wallet_tracker/tracker.py`: Track wallet balances and transactions.
- `asset_swap/simple_swap.py`: Simple asset swap platform.

## Configuration

The client can be configured in several ways:

```python
# Using constructor parameters
client = EvrmoreClient(
    rpcuser="your_username",
    rpcpassword="your_password",
    rpchost="localhost",
    rpcport=8819,
)

# Using environment variables
# EVRMORE_RPC_USER, EVRMORE_RPC_PASSWORD, EVRMORE_RPC_HOST, EVRMORE_RPC_PORT

# Using evrmore.conf
# The client will automatically look for evrmore.conf in the default location
```

## ZMQ Support

The library includes support for ZMQ notifications from the Evrmore node:

```python
from evrmore_rpc.zmq import EvrmoreZMQClient, ZMQTopic

# Create a ZMQ client
zmq_client = EvrmoreZMQClient()

# Register handlers for different topics
@zmq_client.on(ZMQTopic.HASH_BLOCK)
async def handle_block(notification):
    print(f"New block: {notification.hex}")

@zmq_client.on(ZMQTopic.HASH_TX)
async def handle_transaction(notification):
    print(f"New transaction: {notification.hex}")

# Start the client
await zmq_client.start()

# Stop the client when done
await zmq_client.stop()
```

## Documentation

Full documentation is available at [https://manticoretechnologies.github.io/evrmore-rpc/](https://manticoretechnologies.github.io/evrmore-rpc/).

## Contributing

We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute.

## License

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

## Changelog

See [CHANGELOG.md](CHANGELOG.md) for a list of changes in each release.


            

Raw data

            {
    "_id": null,
    "home_page": "https://manticore.technology",
    "name": "evrmore-rpc",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "evrmore blockchain cryptocurrency rpc json-rpc async seamless-api",
    "author": "Manticore Technologies",
    "author_email": "dev@manticore.technology",
    "download_url": null,
    "platform": null,
    "description": "# Evrmore RPC Client\n\n[![PyPI version](https://img.shields.io/pypi/v/evrmore-rpc.svg)](https://pypi.org/project/evrmore-rpc/)\n[![Python versions](https://img.shields.io/pypi/pyversions/evrmore-rpc.svg)](https://pypi.org/project/evrmore-rpc/)\n[![License](https://img.shields.io/github/license/manticoretechnologies/evrmore-rpc.svg)](https://github.com/manticoretechnologies/evrmore-rpc/blob/main/LICENSE)\n[![Tests](https://github.com/manticoretechnologies/evrmore-rpc/workflows/Python%20Package/badge.svg)](https://github.com/manticoretechnologies/evrmore-rpc/actions)\n\nA Python client for interacting with the Evrmore blockchain via RPC, featuring a seamless API that works in both synchronous and asynchronous contexts.\n\n## Key Features\n\n- **Seamless API**: Use the same API in both synchronous and asynchronous code\n- **Automatic Context Detection**: Client automatically adapts to sync or async usage\n- **Comprehensive Type Hints**: Better IDE integration and code completion\n- **Support for All Evrmore RPC Commands**: Complete coverage of the Evrmore API\n- **ZMQ Support**: Real-time blockchain notifications via ZMQ\n- **Resource Management**: Proper cleanup without requiring context managers\n- **High Performance**: Optimized for speed and efficiency\n\n## Installation\n\n```bash\npip3 install evrmore-rpc\n```\n\n## Basic Usage\n\n```python\nfrom evrmore_rpc import EvrmoreClient\n\n# Create a client\nclient = EvrmoreClient()\n\n# Use synchronously\ninfo = client.getblockchaininfo()\nprint(f\"Chain: {info['chain']}, Blocks: {info['blocks']}\")\n\n# Use asynchronously\nimport asyncio\n\nasync def main():\n    info = await client.getblockchaininfo()\n    print(f\"Chain: {info['chain']}, Blocks: {info['blocks']}\")\n    \n    # Clean up when done\n    await client.close()\n\nasyncio.run(main())\n```\n\n## Running Examples\n\nThe repository includes several examples demonstrating different aspects of the library. You can run them using the `run_examples.py` script:\n\n```bash\n# List available examples\npython3 scripts/run_examples.py --list\n\n# Run a basic example\npython3 scripts/run_examples.py super_simple.py\n\n# Run an advanced example\npython3 scripts/run_examples.py asset_monitor/monitor.py\n```\n\n### Basic Examples\n\n- `super_simple.py`: The simplest example showing the core functionality of the seamless API.\n- `seamless_api.py`: A more comprehensive example demonstrating the seamless API in various scenarios.\n- `simple_auto_detect.py`: Shows how the client automatically detects whether it's being used in a synchronous or asynchronous context.\n\n### Advanced Examples\n\n- `asset_monitor/monitor.py`: Real-time monitoring of asset creation and transfers.\n- `blockchain_explorer/explorer.py`: Simple blockchain explorer implementation.\n- `network_monitor/monitor.py`: Monitor network health and peer connections.\n- `wallet_tracker/tracker.py`: Track wallet balances and transactions.\n- `asset_swap/simple_swap.py`: Simple asset swap platform.\n\n## Configuration\n\nThe client can be configured in several ways:\n\n```python\n# Using constructor parameters\nclient = EvrmoreClient(\n    rpcuser=\"your_username\",\n    rpcpassword=\"your_password\",\n    rpchost=\"localhost\",\n    rpcport=8819,\n)\n\n# Using environment variables\n# EVRMORE_RPC_USER, EVRMORE_RPC_PASSWORD, EVRMORE_RPC_HOST, EVRMORE_RPC_PORT\n\n# Using evrmore.conf\n# The client will automatically look for evrmore.conf in the default location\n```\n\n## ZMQ Support\n\nThe library includes support for ZMQ notifications from the Evrmore node:\n\n```python\nfrom evrmore_rpc.zmq import EvrmoreZMQClient, ZMQTopic\n\n# Create a ZMQ client\nzmq_client = EvrmoreZMQClient()\n\n# Register handlers for different topics\n@zmq_client.on(ZMQTopic.HASH_BLOCK)\nasync def handle_block(notification):\n    print(f\"New block: {notification.hex}\")\n\n@zmq_client.on(ZMQTopic.HASH_TX)\nasync def handle_transaction(notification):\n    print(f\"New transaction: {notification.hex}\")\n\n# Start the client\nawait zmq_client.start()\n\n# Stop the client when done\nawait zmq_client.stop()\n```\n\n## Documentation\n\nFull documentation is available at [https://manticoretechnologies.github.io/evrmore-rpc/](https://manticoretechnologies.github.io/evrmore-rpc/).\n\n## Contributing\n\nWe welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for a list of changes in each release.\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A high-performance Python wrapper for Evrmore blockchain RPC commands with a seamless API",
    "version": "3.3.0",
    "project_urls": {
        "Bug Reports": "https://github.com/manticoretechnologies/evrmore-rpc/issues",
        "Documentation": "https://manticoretechnologies.github.io/evrmore-rpc/",
        "Homepage": "https://manticore.technology",
        "Source": "https://github.com/manticoretechnologies/evrmore-rpc"
    },
    "split_keywords": [
        "evrmore",
        "blockchain",
        "cryptocurrency",
        "rpc",
        "json-rpc",
        "async",
        "seamless-api"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9eba880b13a071d6592f706090c2d18d8f22c6f02746c3e24fca23019d509bf3",
                "md5": "ba95a8f93d46d7adbee71656e89eac55",
                "sha256": "4829ac3ba48563a49fd1864f55d62259a7271477480caeec67935bc848a45fc3"
            },
            "downloads": -1,
            "filename": "evrmore_rpc-3.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ba95a8f93d46d7adbee71656e89eac55",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 37084,
            "upload_time": "2025-03-08T09:39:17",
            "upload_time_iso_8601": "2025-03-08T09:39:17.608064Z",
            "url": "https://files.pythonhosted.org/packages/9e/ba/880b13a071d6592f706090c2d18d8f22c6f02746c3e24fca23019d509bf3/evrmore_rpc-3.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-03-08 09:39:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "manticoretechnologies",
    "github_project": "evrmore-rpc",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "aiohttp",
            "specs": [
                [
                    ">=",
                    "3.8.0"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.28.0"
                ]
            ]
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "rich",
            "specs": [
                [
                    ">=",
                    "12.0.0"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    ">=",
                    "7.0.0"
                ]
            ]
        },
        {
            "name": "pytest-asyncio",
            "specs": [
                [
                    ">=",
                    "0.18.0"
                ]
            ]
        }
    ],
    "lcname": "evrmore-rpc"
}
        
Elapsed time: 0.41357s