-
Notifications
You must be signed in to change notification settings - Fork 228
Description
Context
We have:
- a ticking function (Ticking function to retrieve current tip and get next block (no handling of rollbacks) #3)
- a function to get blocks (Implement (part-of) http-bridge API (get network tip, get block) #12)
- a running
cardano-http-bridgesubprocess (Spawn http bridge and a wallet server from specified options #8 -- in progress)
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
- Must be able to catch up with blocks from chain producer.
- Must process (by logging to stdout) the blocks received.
Development Plan
- Implement
startBlockSyncer - Call
startBlockSyncer frommain` -
Addiohk-monitoring-frameworkand 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).