Ogmios is a lightweight bridge interface for cardano-node. It offers a WebSockets API that enables local clients to speak Ouroboros' mini-protocols via JSON/RPC. ogmios-python is an Ogmios client written in Python designed for ease of use.
Project description
ogmios-python
Ogmios is a lightweight bridge interface for cardano-node. It offers a WebSockets API that enables local clients to speak Ouroboros’ mini-protocols via JSON/RPC. ogmios-python is an Ogmios client written in Python designed for ease of use.
Table of Contents
Installation
- Install cardano-node and Ogmios server as described here. (Docker installation is recommended.)
- Install ogmios-python from PyPI using pip:
pip install ogmios
Quickstart
To see how easy it is to build on Cardano with ogmios-python, let's use the library to view new blocks as they are added to the blockchain:
import ogmios
with ogmios.Client() as client:
# Set chain pointer to origin
_, tip, _ = client.find_intersection.execute([ogmios.Origin()])
# Now set chain pointer to tip
_, _, _ = client.find_intersection.execute([tip.to_point()])
# Tail blockchain as new blocks come in beyond the current tip
while True:
direction, tip, point, _ = client.next_block.execute()
if direction == ogmios.Direction.forward:
print(f"New block: {point}")
For more examples, see the documentation and example scripts in the repo.
Documentation
Complete client documentation is available on Read the Docs.
License
ogmios-python
is distributed under the terms of the GPL-3.0-or-later license.
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 ogmios-1.2.0.tar.gz
.
File metadata
- Download URL: ogmios-1.2.0.tar.gz
- Upload date:
- Size: 114.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23dd8406e8b978462d0c967bc91aee0dff0396e2f8f233cc30377299aa9e44cf |
|
MD5 | eeb4a9b259ca399ae4dfce03eec336b7 |
|
BLAKE2b-256 | e4dfc5a6ab64d19897bddb4b299d2098247b91d6eb46a8e0e8b77db31c1c2be6 |
File details
Details for the file ogmios-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: ogmios-1.2.0-py3-none-any.whl
- Upload date:
- Size: 128.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 887a7dec97c60d0549e77d7c3505ddef16e9edef297e6d08d7e1fd221c1544f9 |
|
MD5 | 2c7aedaed4017373ae11b48c73e1cf65 |
|
BLAKE2b-256 | b29bec19b20594e160b1e046661c141ba699822889883703041661938b049f29 |