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 blockchain:
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
Built Distribution
File details
Details for the file ogmios-0.1.3.tar.gz
.
File metadata
- Download URL: ogmios-0.1.3.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 | 7ebdd700d72431a1c85bcfabf4fb61eb9c21b2ef6df6a44e20b87b3223b11980 |
|
MD5 | 7326f7a7f701e358b23cf99aa676d672 |
|
BLAKE2b-256 | f1da6db3944585482c4c22fda35d7167d1e20ea84fff2eaa06b77b568d590447 |
File details
Details for the file ogmios-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: ogmios-0.1.3-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 | 71300e57c991b5e934ecf0f0d42b88279359897286082caf48b35931f4b83621 |
|
MD5 | 75fb5399134868d83dab44a693bcc784 |
|
BLAKE2b-256 | 66ec496783f6cbc8bb1d892594506ac27054bc55155340ad498a782024903241 |