Skip to main content

Module task

Module task 

Source
Expand description

Segment archiving task.

Implements archiving process in that converts blockchain history (blocks) into archived history (segments and pieces).

The main entry point here is create_segment_archiver_task that will create a task, which while driven will perform the archiving itself.

Archiving itself will also wait for acknowledgement by various subscribers before proceeding, which includes farmer subscription, in case of reference implementation via RPC.

All segment headers of the archived segments are available to other parts of the protocol that need to know what the correct archival history of the blockchain looks like through [ChainInfo]. For example, it is used during node sync and farmer plotting to verify pieces of archival history received from other network participants. Future segment header might also be already known in the case of syncing from DSN.

encode_block and decode_block are symmetric encoding/decoding functions turning Blocks into bytes and back.

Structs§

ArchivedSegmentNotification
Notification with a new archived segment that was just archived

Enums§

SegmentArchiverTaskError
Segment archiver task error

Functions§

create_segment_archiver_task
Create a segment archiver task.
decode_block
Symmetrical to encode_block(), used to decode previously encoded blocks
encode_block
Encode block for archiving purposes