Skip to content

Commit

Permalink
Add support for :conway to sync_from on ChainSync (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
caike authored Oct 1, 2024
1 parent f75902b commit 6c52c4c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
the underlying node is not yet ready or still syncinging with the network, it reports back status and
attempts a reconnection after 5 seconds.

- Adds support for `:conway` to the `sync_from` option on ChainSync (mainnet only). This allows ChainSync
clients to sync with the chain starting on the first block of the Conway era.

## [v0.5.1](https://github.com/wowica/xogmios/releases/tag/v0.5.1) (2024-09-04)

### Fixed
Expand Down
10 changes: 6 additions & 4 deletions lib/xogmios.ex
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ defmodule Xogmios do
This option accepts either:
a) An atom from the list: `:origin`, `:byron`,
`:shelley`, `:allegra`, `:mary`, `:alonzo`, `:babbage`.
a) An atom from the following list of existing eras: `:origin`, `:byron`,
`:shelley`, `:allegra`, `:mary`, `:alonzo`, `:babbage`, `:conway`.
For example:
Expand All @@ -61,7 +61,9 @@ defmodule Xogmios do
end
```
This will sync with the chain starting from the first block of the Babbage era.
This will sync with the chain starting from the first block of the Babbage era. Passing
an atom to `sync_from` only works when connecting with **mainnet**. For testnet, `sync_from`
must receive a specific point in the chain as described below.
b) A point in the chain, given its `slot` and `id`. For example:
Expand Down Expand Up @@ -104,7 +106,7 @@ defmodule Xogmios do
`opts` as keyword lists are passed to the underlying :websocket_client.
The `:include_details` flag can be used to determine the level of details
to be returned with each transaction as part of `c:Xogmios.Mempool.handle_transaction/2`.
to be returned with each transaction as part of `c:Xogmios.MempoolTxs.handle_transaction/2`.
Setting this option to `false` (default) means only transaction id is returned:
Expand Down
5 changes: 4 additions & 1 deletion lib/xogmios/chain_sync/messages.ex
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ defmodule Xogmios.ChainSync.Messages do
allegra: {16_588_737, "4e9bbbb67e3ae262133d94c3da5bffce7b1127fc436e7433b87668dba34c354a"},
mary: {23_068_793, "4e9bbbb67e3ae262133d94c3da5bffce7b1127fc436e7433b87668dba34c354a"},
alonzo: {39_916_796, "e72579ff89dc9ed325b723a33624b596c08141c7bd573ecfff56a1f7229e4d09"},
babbage: {72_316_796, "c58a24ba8203e7629422a24d9dc68ce2ed495420bf40d9dab124373655161a20"}
babbage: {72_316_796, "c58a24ba8203e7629422a24d9dc68ce2ed495420bf40d9dab124373655161a20"},
# Last babbage https://cardanoscan.io/block/10781330
# First conway https://cardanoscan.io/block/10781331
conway: {133_660_799, "e757d57eb8dc9500a61c60a39fadb63d9be6973ba96ae337fd24453d4d15c343"}
}

@doc """
Expand Down

0 comments on commit 6c52c4c

Please sign in to comment.