Python wrapper for Chia blockchain node APIs
Project description
About
Python-chianode is a Python wrapper for Chia blockchain full node APIs.
The package supports the official RPC API for Chia nodes running on localhost, as well as the Mojonode API. Calls are made asynchronously, and it is possible to receive streaming responses.
Mojonode provides advanced REST calls not available via the official RPC interface, blockchain data via SQL query, and an event stream for blockchain and mempool events. Note that Mojonode does not implement all official RPCs. The get_routes
endpoint returns a list of available endpoints.
Installation
To install python-chianode, run
pip install python-chianode
Quick start
Import and instantiate the Chia node client in your Python file as follows
from chianode.mojoclient import MojoClient
node = MojoClient()
By default, both MojoClient and RpcClient connect to Mojonode. To connect to a local node only, do
from chianode.rpcclient import RpcClient
from chianode.constants import LOCALHOST
node = RpcClient(base_url=LOCALHOST)
To use Mojonode in conjunction with a local node, do
from chianode.mojoclient import MojoClient
from chianode.constants import LOCALHOST
node = MojoClient(base_url=LOCALHOST)
More detailed examples on how to use the wrapper can be found in example_rpc.py
and example_events.py
files.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python_chianode-0.1.1.tar.gz
.
File metadata
- Download URL: python_chianode-0.1.1.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1861099a4ed025e9bc4f7ba17d9124783ead7a50e9da5014a40b628ede2da7f |
|
MD5 | 9ea1c8350fa5cf4550dd2829a59133ce |
|
BLAKE2b-256 | 723d08c6c7426c2545d0ad8458b102f283b8d6caf7f6edeba5cc313f9583778b |
File details
Details for the file python_chianode-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: python_chianode-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1a2cd4e0bd315541cfd8555d645e7fec993ecff735a12ee448d5df1407d66d0 |
|
MD5 | f0359e97317fcd9740c6c6c42ed80eac |
|
BLAKE2b-256 | 27504be30f02fa84d831c27e365ca564d586779a1a140de7d8b8f35028008c45 |