Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChainObserver supports retrieving the Chain Point of the tip of the chain #1589

Closed
4 tasks done
Tracked by #1457 ...
jpraynaud opened this issue Mar 26, 2024 · 2 comments · Fixed by #1674
Closed
4 tasks done
Tracked by #1457 ...

ChainObserver supports retrieving the Chain Point of the tip of the chain #1589

jpraynaud opened this issue Mar 26, 2024 · 2 comments · Fixed by #1674
Assignees
Labels
feature 🚀 New implemented feature good first issue 👋 Good for newcomers

Comments

@jpraynaud
Copy link
Member

jpraynaud commented Mar 26, 2024

Why

We need to retrieve the block number of the tip of the Cardano chain with the Chain observer to use it to create new types of beacons.

What

Add a new function in the ChainObserver trait:

async fn get_current_chain_point(&self) -> Result<Option<ChainPoint>, ChainObserverError>;

And a new entity type:

struct ChainPoint {
    slot_number: u64,
    block_number: u64,
    block_hash: String //hex encoded bytes Vec<u8>
}

And implement this function for the:

  • PallasChainObserver by using n2c mini-protocol to get access to it
  • CardanoCLIChainObserver by using the query tip command (already used for implementing get_current_epoch)

See

How

  • Adapt ChainObserver trait (@jpraynaud)
  • Implement trait function for FakeChainObserver (@jpraynaud)
  • Implement trait function for CardanoCliChainObserver (@jpraynaud)
  • Implement trait function for PallasChainObserver (@falcucci )
@jpraynaud jpraynaud added good first issue 👋 Good for newcomers feature 🚀 New implemented feature labels Mar 26, 2024
@jpraynaud jpraynaud changed the title ChainObserver supports retrieving the Block number of the tip of the chain ChainObserver supports retrieving the Chain Point of the tip of the chain Mar 26, 2024
@jpraynaud jpraynaud self-assigned this Apr 9, 2024
@jpraynaud
Copy link
Member Author

Hi @falcucci, the PR #1623 has been merged 👍
You can work on the implementation of the new function in the ChainObserver trait in the PallasChainObserver:

async fn get_current_chain_point(&self) -> Result<Option<ChainPoint>, ChainObserverError> {

@falcucci
Copy link
Collaborator

thank you! @jpraynaud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🚀 New implemented feature good first issue 👋 Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants