Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_chianode-0.1.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_chianode-0.1.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file python_chianode-0.1.0.tar.gz.

File metadata

  • Download URL: python_chianode-0.1.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0

File hashes

Hashes for python_chianode-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9caca2fd2fa9df1e50c2d20c0375a3a7b3e1034ee85600c424a487af89cf56fc
MD5 a5de576a3118fe34db296dc3e04f079b
BLAKE2b-256 c775784deca28b7ceeac67145ea096b8dfc5ec7a36e2b6d284dec55301ad28e7

See more details on using hashes here.

File details

Details for the file python_chianode-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: python_chianode-0.1.0-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

Hashes for python_chianode-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 469ba633665e6bcbba29b029b7252355dd97290eaf6ec7d2a7688a743edc84eb
MD5 b3aa8d46a12153462327eed652deea23
BLAKE2b-256 38a1cc9774bc30cb5368b8af6edf936668d9759ea0c6894dcc80ae2ba5b8a22f

See more details on using hashes here.

Supported by

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