mirror of
https://github.com/logos-storage/bittorrent-codex-docs.git
synced 2026-01-02 13:03:08 +00:00
889 B
889 B
| tags | related | |||
|---|---|---|---|---|
|
|
#codex/blocks
| related | Codex Block Exchange Protocol, Uploading and downloading content in Codex |
|---|
In the Codex client, blocks are represented by the following data types (codex/blocktype.nim):
type
Block* = ref object of RootObj
cid*: Cid
data*: seq[byte]
BlockAddress* = object
case leaf*: bool
of true:
treeCid* {.serialize.}: Cid
index* {.serialize.}: Natural
else:
cid* {.serialize.}: Cid
And then we have also block metadata (codex/stores/repostore/types.nim):
BlockMetadata* {.serialize.} = object
expiry*: SecondsSince1970
size*: NBytes
refCount*: Natural