Skip to content

Use ticking function to get blocks #52

@rvl

Description

@rvl

Context

We have:

The ticking function should call the function to get blocks.

Decision

Add a function to get blocks every tick and log them.

startBlockSyncer
    :: MonadChainProducer m
    => NetworkName
    -> Port
    -> m ()

This function will be called from main and won't normally return.

Acceptance Criteria

  1. Must be able to catch up with blocks from chain producer.
  2. Must process (by logging to stdout) the blocks received.

Development Plan

  • Implement startBlockSyncer
  • Call startBlockSyncer from main`
  • Add iohk-monitoring-framework and use the basic set up which they have documented. (Maybe not yet -- haven't decided)
  • Log new blocks at "info" level
  • Rely on an externally launched cardano-http-bridge
  • Reflect upon design of the receive and process blocks feature, and propose then implement changes.

PR

Number Base
#54 master
#63 master
#52 master
#71 master

QA

  • Okay, we do now connect and receives blocks from the http bridge, pretty much epoch per epoch. Note that this is very very rudimentary for now and we are missing quite a few features coming soon:

    • Ability to persist the progression (ideally, we do want to process blocks as we fetch them, and store the latest tip we've processed).
    • Handling rollbacks and duplicates
  • Still, this can be manually tested by starting the current "wallet server" alongside the http bridge. Provided you've installed in cardano-http-bridge (cargo install https://github.com/input-output-hk/cardano-http-bridge.git):

cardano-http-bridge start --port 1337 & 
stack exec -- cardano-wallet-server --http-bridge-port 1337

This should print all blocks received from the http bridge, until the tip block is reached, whereupon a network block should be printed every 20 seconds.

  • Also, check what happens if the node backend crashes (or gets killed).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions