Node API
Table of Contents
Service
Storage Node
Method Name | Request Type | Response Type | Description |
---|---|---|---|
uploadSegment | - | This uploads segment to storage node | |
uploadSegments | - | This uploads multiple segments at the same time to the storage node | |
downloadSegment | DataRoot, usize, usize | This download the segment by locating the data with the merkle root, start&end index | |
downloadSegmentWithProof | DataRoot, usize | This downoads segment with the merkle proof | |
getFileInfo | This gets the file information given the data merkle root | ||
getFileInfoByTxSeq | u64 | This gets the file information by querying the correponsing sequence index |
Data Structure
SegmentWithProof
Field | Type | Label | Description |
---|---|---|---|
root | DataRoot | File merkle root | |
data | [u8] | file data | |
index | usize | segment index | |
proof | FileProof | Merkle proof whose leaf node is the segment root | |
file_size | usize | file size |
DataRoot
DataRoot = H256
Segment
Segment = [u8]
FileInfo
Field | Type | Label | Description |
---|---|---|---|
tx | file transaction | ||
finalized | bool | whether the file is finalized | |
is_cached | bool | whether the file is cached | |
uploaded_seg_num | usize | number of the segments |
Transaction
Field | Type | Label | Description |
---|---|---|---|
stream_ids | [u256] | file transaction | |
data | [u8] | transaction data | |
data_merkle_root | DataRoot | merkle root of the data | |
merkle_nodes | [(usize, DataRoot)] | [(subtree_depth, subtree_root)] | |
start_entry_index | u64 | index of the start entry | |
size | u64 | data size | |
seq | u64 | sequence number |
Last updated