BACK TO PRODUCTS

Ogmios

By

By CardanoSolutions

About Ogmios Sync

Ogmios is a lightweight bridge interface for cardano-node. It provides an HTTP / WebSocket API that enables applications to interact with a local cardano-node via JSON+RPC-2.0. Examples and documentation can be found in the GitHub repository.

Demeter Implementation

Demeter is serverless, you don't need to provision any infrastructure.

It provides highly-available, multi-tenant instances of Cardano Ogmios. Connections to these instances are load balanced, ensuring both performance and resilience. Projects can connect to the service and receive events from Ogmios, using your private credentials. Demeter eliminates the need for manual infrastructure management by handling monitoring, security, and version upgrades.

Demeter Pricing

Demeter price scales to zero, you only pay for what you use.

Usage is measured by aggregated time of open connections to Ogmios. If no connections are made, you incur no charges, except for minimum fees in Tiers with reserved throughput. Demeter offers different Tiers for Ogmios Ports, allowing you to reserve throughput and scale your usage to meet the specific demands of your project. Service is limited by concurrent open connections. Leverage Demeter Free Tier to get started.

TierFreeFlexPro IPro II
Minimum fee$0$0$100$200
Price per 24hs of connection$0$0.43$0.22$0.14
Max concurrent open connections1550150

Getting Started

Once created, your Cardano Ogmios Port resource will present you with the required information to access the Ogmios instance:

  • HTTP Endpoint URL: the publicly accessible hostname of the Ogmios instance by network (eg: NETWORK-VERSION.ogmios-v1.demeter.run)
  • HTTP Authenticated Endpoint URL: the publicly accessible hostname of the Ogmios instance, but with the key set on the hostname without necessary to set it on the header. (eg: KEY.NETWORK-VERSION.ogmios-v1.demeter.run)
  • Api Key: the key to authenticating, will needs to be set on the header (eg: dmtr-api-key: dmtr_ogmios63j21khsjx)

The above value will change for each project depending on your configuration.

  • Python
  • NodeJS
  • Go

You can use a library like websockets to connect to a Ogmios instance in Python. Here's a basic example:

The key on the host not working with python, please set the key on the header(dmtr-api-key).

import asyncio
import websockets
import json

async def connect_to_websocket():
    host = "wss://mainnet-v5.ogmios-m1.demeter.run"
    headers = {
        'dmtr-api-key': 'dmtr_ogmiosXXX',
    }

    async with websockets.connect(host, extra_headers=headers) as websocket:
        print(f"Connected to {host}")

        event = {
                'jsonrpc': '2.0',
                'method': 'queryLedgerState/utxo',
                'params': {
                    'addresses': ['addrXXXX']
                }
        }

        await websocket.send(json.dumps(event))
        response = await websocket.recv()
        print(f"Received from server: {response}")

    print("WebSocket connection closed.")

asyncio.get_event_loop().run_until_complete(connect_to_websocket())

In this code, replace host, and dmtr-api-key if is necessary

This will connect and send an event to get utxos from an address

1. Select type

2. Select project