Python SDK for the Ouroboros decentralized blockchain network
Project description
ouro-sdk
Python SDK for the Ouroboros decentralized blockchain network.
Install
pip install ouro-sdk
# For async support (AsyncOuroClient):
pip install ouro-sdk[async]
Quick Start (sync)
from ouro_sdk import OuroClient
client = OuroClient("http://localhost:8000", api_key="your-api-key")
# Check health
print(client.health()) # {'status': 'healthy', ...}
# Get consensus state
c = client.consensus()
print(f"View: {c['view']}, Leader: {c['leader']}")
# Get balance
bal = client.balance("ouro1myaddress")
print(f"Balance: {bal['balance']} nanoouro")
# Submit a transaction
result = client.submit_transaction({
"sender": "ouro1abc...",
"recipient": "ouro1xyz...",
"amount": 1_000_000_000, # 1 OURO
"signature": "hex-encoded-signature",
})
print(f"TX: {result['tx_id']}")
# Combined status snapshot
status = client.status()
print(f"Online: {status['online']}, Block: {status.get('metrics', {}).get('block_height')}")
Quick Start (async)
import asyncio
from ouro_sdk import AsyncOuroClient
async def main():
client = AsyncOuroClient("http://localhost:8000", api_key="your-api-key")
health = await client.health()
consensus = await client.consensus()
status = await client.status()
print(status)
asyncio.run(main())
API Reference
| Method | Endpoint | Auth | Description |
|---|---|---|---|
health() |
GET /health | No | Node liveness |
identity() |
GET /identity | No | Node ID, role, uptime |
consensus() |
GET /consensus | No | View, leader, last block |
peers() |
GET /peers | No | Connected peers |
balance(address) |
GET /ouro/balance/:addr | No | OURO balance |
nonce(address) |
GET /ouro/nonce/:addr | No | Account nonce |
metrics() |
GET /metrics/json | Yes | TPS, sync %, mempool |
resources() |
GET /resources | Yes | CPU, RAM, disk |
mempool() |
GET /mempool | Yes | Mempool contents |
network_stats() |
GET /network/stats | Yes | Network stats |
get_transaction(id) |
GET /tx/:id | Yes | Transaction lookup |
submit_transaction(tx) |
POST /tx/submit | Yes | Submit transaction |
transfer(from, to, amt) |
POST /ouro/transfer | Yes | Transfer OURO |
status() |
combined | - | Full snapshot |
Environment Variables
OURO_API_KEY— API key for protected endpoints
License
MIT
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
ouro_sdk-1.0.0.tar.gz
(4.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ouro_sdk-1.0.0.tar.gz.
File metadata
- Download URL: ouro_sdk-1.0.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21e33c7da7fa1ac1dd04301b443312d4bba783efba510710276d7470ea859f24
|
|
| MD5 |
2d5fc63ae4baf9668a626536959da48e
|
|
| BLAKE2b-256 |
f6ddfe21b787d9ac4cf2dc39320a1b1c4d98df6f4052eed21256af6f5f4caeb7
|
File details
Details for the file ouro_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ouro_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e0b54c34f1d01affe3fd11ca84c569b7813b193dc8a92f7f26523ea787da7ac
|
|
| MD5 |
9024fab7f2aed4a0e8039958df025faf
|
|
| BLAKE2b-256 |
520bf7bdc2475d9a800cc3850efef898797d5eba6d7ab9516630c8a035adebd3
|