diff --git a/README.md b/README.md index 9850a96..782d088 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,15 @@ An Elixir client for [Ogmios](https://github.com/CardanoSolutions/ogmios). > Ogmios is a lightweight bridge interface for a Cardano node. It offers a WebSockets API that enables local clients to speak Ouroboros' mini-protocols via JSON/RPC. - https://ogmios.dev/ -It currently only partially supports the **Chain Synchronization** and **State Query** mini-protocols. See [Examples](#examples) section below for information on how to use it. +Mini-Protocols supported by this library: + +- [x] Chain Synchronization +- [ ] State Query (partially supported) +- [ ] Mempool Monitoring +- [ ] Tx Submission + + +See [Examples](#examples) section below for information on how to use. ## Installing diff --git a/lib/xogmios/chain_sync.ex b/lib/xogmios/chain_sync.ex index 3a9b826..5601907 100644 --- a/lib/xogmios/chain_sync.ex +++ b/lib/xogmios/chain_sync.ex @@ -8,10 +8,14 @@ defmodule Xogmios.ChainSync do @callback handle_block(map(), any()) :: {:ok, :next_block, map()} | {:ok, map()} | {:ok, :close, map()} + # The keepalive option is used to maintain the connection active. + # This is important because proxies might close idle connections after a few seconds. + @keepalive_in_ms 5_000 + def start_link(client, opts) do {url, opts} = Keyword.pop(opts, :url) initial_state = Keyword.merge(opts, handler: client) - :websocket_client.start_link(url, client, initial_state) + :websocket_client.start_link(url, client, initial_state, keepalive: @keepalive_in_ms) end defmacro __using__(_opts) do