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
Table of Contents
Installation
- Install cardano-node and Ogmios server as described here. (Docker installation is recommended.)
- Install ogmios-python 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
import time
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:
client.next_block.execute()
time.sleep(1)
For more examples, see the documentation and example scripts in the repo.
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
ogmios-0.1.2.tar.gz
(72.0 kB
view details)
Built Distribution
ogmios-0.1.2-py3-none-any.whl
(74.7 kB
view details)
File details
Details for the file ogmios-0.1.2.tar.gz
.
File metadata
- Download URL: ogmios-0.1.2.tar.gz
- Upload date:
- Size: 72.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.25.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23c051f47c4a134c1e3090433a4ceb211679bc384ec3a19430a9966254d0e62e |
|
MD5 | e0b80c6a842a52b214a3a040bdc7942a |
|
BLAKE2b-256 | 02bc8c09965f8f09e45e9ac91367fa85777e1a2d44ae3ee44d75faae42bf58b4 |
File details
Details for the file ogmios-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: ogmios-0.1.2-py3-none-any.whl
- Upload date:
- Size: 74.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.25.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fed1d8d8085154d39c283633836925524296aae12c29240a6b40fcc08b64b34 |
|
MD5 | d89237dd615055d4a677d6d157f69840 |
|
BLAKE2b-256 | e5f4dcfc8b0f75e0d1f8913fa1c756c54eacd8854be9652db6f34fdd968b6485 |