Ogmios

repository·master·Indexed 43 days ago

https://github.com/cardanosolutions/ogmios

A lightweight bridge interface for cardano-node that exposes an HTTP and WebSocket API using JSON+RPC-2.0. It enables developers to perform block synchronization, transaction submission, state querying, and Plutus script execution unit evaluation. Includes a TypeScript monorepo with the @cardano-ogmios/client, @cardano-ogmios/schema, and @cardano-ogmios/repl packages.

Tokens
45K
Snippets
118
Records
191
Agent score
56%

What's inside Ogmios

  1. What is Ogmios (Server)?

    master

    Ogmios is a webserver that acts as a proxy for communicating with a cardano-node. It establishes a node-to-client connection with a Cardano node upon request and forwards messages between the client application and the node.

    Key characteristics:

    • Protocol Translation: It translates the statically typed Cardano node protocols into JSON for client consumption.
    • Monitoring: It provides built-in monitoring capabilities.
    • Dual Interface: It embeds both an HTTP server and a WebSocket server.
  2. Overview of Ogmios features and capabilities

    master

    Ogmios acts as a lightweight bridge interface for cardano-node, providing an HTTP / WebSocket API via JSON+RPC-2.0.

    Key capabilities include:

    • Fast block synchronization from Cardano networks.
    • Transaction submission with enhanced error messages.
    • Plutus script execution unit evaluation.
    • Local mempool monitoring.
    • State queries for Network and Ledger information.
    • Dual WebSocket/HTTP support.
    • Structured JSON logging and Health monitoring with runtime/application statistics.
  3. What is Ogmios?

    master
    Ogmios is a lightweight bridge interface for cardano-node. It provides a WebSockets API that allows local clients to interact with Cardano's Ouroboros mini-protocols using JSON/RPC. This makes it easier for developers to build applications that need to communicate with the Cardano blockchain without implementing the complex Ouroboros protocols directly.
  4. Available Ogmios Clients by Language

    master

    Ogmios supports a variety of client implementations across different programming languages. While this documentation focuses on the official TypeScript client, community-maintained clients are available for the following languages:

    • JavaScript
    • TypeScript (Official/Primary)
    • Go (ogmigo)
    • Kotlin (kogmios)
    • Java (ogmios-java-client)
    • Python (ogmios-python)
    • Elixir (xogmios)
    • C++ (libogmios)
    • C# (OgmiosDotnet)
  5. Install and use Cardano Ogmios TypeScript Client Packages

    master

    The Cardano Ogmios TypeScript ecosystem is distributed as a Yarn Workspace containing three distinct npm packages. Depending on your needs, you can install and use the following:

    • @cardano-ogmios/client: The primary client for interacting with Ogmios.
    • @cardano-ogmios/schema: Contains the TypeScript schemas and type definitions used by the client and server.
    • @cardano-ogmios/repl: A REPL (Read-Eval-Print Loop) for interactive Ogmios command execution.

    To use these in your own project, install them via npm or yarn from the npm registry.

    npm install @cardano-ogmios/client @cardano-ogmios/schema @cardano-ogmios/repl
  6. What is Ogmios and how does it work?

    master

    Ogmios is a lightweight bridge interface for cardano-node. It provides a WebSockets API that allows local clients to interact with Cardano's Ouroboros mini-protocols using JSON/RPC.

    Essentially, Ogmios acts as a translator: it speaks the native communication methods required by a Cardano node (which are primarily implemented in Haskell) and translates them into WebSockets and JSON, which are more accessible to the majority of application developers. This allows you to build applications in languages other than Haskell while still maintaining a low-level, direct interface to the blockchain.

  7. What is the ouroboros-network-ogmios module?

    master

    The ouroboros-network-ogmios module is a utility layer designed to reduce boilerplate when interacting with the Ouroboros mini-protocols used by Cardano nodes.

    It is important to note that this module does not implement the protocol logic itself. Instead, it provides a structural foundation that allows application logic to focus on specific client implementations, such as:

    • chain-sync: For synchronizing with the blockchain state.
    • transaction submission: For broadcasting transactions to the network.
    • state query: For querying the current state of the node.

    Use this module when you want to decouple the repetitive setup required for Ouroboros protocols from your core application logic.

  8. What are contra-tracers?

    master
    contra-tracers is a logging library designed for structured, multi-component logging in real applications. It uses contravariant functors to provide an opinionated and simple way to manage different log types (e.g., HTTP logs vs. Database logs) within a single application context. This allows different parts of an application to use their own specific log data types while being managed by a unified tracing system.