Skip to content

v1.0.0

Latest
Compare
Choose a tag to compare
@edridudi edridudi released this 11 Aug 19:14
· 59 commits to master since this release

Ogmios v1.0.0

What is Ogmios?

Ogmios Java Client Library is based on Ogmios JSON/RPC lightweight bridge interface for Cardano Node by Matthias Benkort.

It offers a WebSocket API that enables local clients to speak Ouroboros' mini-protocols via JSON/RPC.

Overview

Ogmios Java Client is a java library that can be used to convert Java Objects into their Ogmios Requests JSON/RPC representation. It can also be used to convert Ogmios JSON/RPC Responses to their equivalent Java objects.

The Java library allows synchronous communication with Ogmios Server by interacting with a Websocket client connection using a timeout parameter.

Features

  • Synchronous messaging using java objects
  • Transaction submission with enhanced error messages
  • Transaction Evaluation
  • Structured Java Objects logging
  • Full ledger state query support:
    • blockHeight
    • chainTip
    • currentEpoch
    • currentProtocolParameters
    • delegationsAndRewards
    • eraStart
    • eraSummaries
    • genesisConfig
    • ledgerTip
    • nonMyopicMemberRewards
    • poolIds
    • poolParameters
    • poolsRanking
    • proposedProtocolParameters
    • rewardsProvenance
    • stakeDistribution
    • systemStart
    • utxoByAddress

Getting Started

Dependency management tool

Below is a brief guide to using dependency management tools like maven or gradle.

Maven

To use maven add this dependency to your pom.xml:

<dependency>
    <groupId>io.adabox</groupId>
    <artifactId>ogmios-java-client</artifactId>
    <version>1.0.0</version>
</dependency>

Gradle

To use Gradle add the maven central repository to your repositories list:

mavenCentral()

Then you can just add the latest version to your build.

compile "io.adabox:ogmios-java-client:1.0.0"

Or this option if you use gradle 7.0 and above.

implementation io.adabox:ogmios-java-client:1.0.0'

Hosted Dandelion's instances, by Gimbalabs.

wss://ogmios-api.mainnet.dandelion.link/ - Mainnet

wss:/ogmios-api.testnet.dandelion.link/ - Testnet

Initialize Secured Ogmios Websocket Client

ogmiosWSClient = new OgmiosWSClient(new URI("wss://ogmios-api.testnet.dandelion.link/"));
ogmiosWSClient.setSocketFactory(SSLSocketFactory.getDefault());
ogmiosWSClient.connectBlocking(60, TimeUnit.SECONDS);

Basic Current Protocol Parameters Query Example

CurrentProtocolParameters currentProtocolParameters = ogmiosWSClient.currentProtocolParameters();
log.info(currentProtocolParameters.toString());

Clone & Build with Maven

git clone https://github.com/adabox-aio/ogmios-java-client.git
cd ogmios-java-client
mvn clean install