syntax = "proto3"; option go_package = "akave.ai/akave/private/pb"; import "google/protobuf/timestamp.proto"; package ipcnodeapi; service IPCNodeAPI { rpc ConnectionParams (ConnectionParamsRequest) returns (ConnectionParamsResponse) {} // Bucket APIs. rpc BucketView (IPCBucketViewRequest) returns (IPCBucketViewResponse) {} rpc BucketList (IPCBucketListRequest) returns (IPCBucketListResponse) {} // File APIs. rpc FileUploadChunkCreate (IPCFileUploadChunkCreateRequest) returns (IPCFileUploadChunkCreateResponse) {} rpc FileUploadBlock (stream IPCFileBlockData) returns (IPCFileUploadBlockResponse) {} rpc FileView (IPCFileViewRequest) returns (IPCFileViewResponse) {} rpc FileDownloadCreate (IPCFileDownloadCreateRequest) returns (IPCFileDownloadCreateResponse) {} rpc FileDownloadRangeCreate (IPCFileDownloadRangeCreateRequest) returns (IPCFileDownloadCreateResponse) {} rpc FileDownloadChunkCreate (IPCFileDownloadChunkCreateRequest) returns (IPCFileDownloadChunkCreateResponse) {} rpc FileDownloadBlock (IPCFileDownloadBlockRequest) returns (stream IPCFileBlockData) {} rpc FileList (IPCFileListRequest) returns (IPCFileListResponse) {} rpc FileUploadBlockUnary (IPCFileBlockData) returns (IPCFileUploadBlockResponse) {} } // IPCArchivalAPI defines archival API extension. service IPCArchivalAPI { rpc FileResolveBlock (IPCFileResolveBlockRequest) returns (IPCFileResolveBlockResponse); } message ConnectionParamsRequest {} message ConnectionParamsResponse { string dial_uri = 1; string storage_address = 2; string access_address = 3; } message IPCBucketViewRequest { string name = 1; string address = 2; } message IPCBucketViewResponse { string id = 1; string name = 2; google.protobuf.Timestamp created_at = 3; } message IPCBucketListRequest { string address = 1; int64 offset = 2; int64 limit = 3; } message IPCBucketListResponse { repeated IPCBucket buckets = 1; message IPCBucket { string name = 1; google.protobuf.Timestamp created_at = 2; } } message IPCChunk { string cid = 1; int64 index = 2; int64 size = 3; repeated Block blocks = 4; message Block { string cid = 1; int64 size = 2; } } message IPCFileUploadChunkCreateRequest{ IPCChunk chunk = 1; bytes bucket_id = 2; string file_name = 3; } message IPCFileUploadChunkCreateResponse { repeated BlockUpload blocks = 1; message BlockUpload { string cid = 1; string node_address = 2; string node_id = 3; string permit = 4; } } message IPCFileBlockDataRequest { repeated bytes transaction = 1; } message IPCFileBlockData { bytes data = 1; string cid = 2; // only present in first msg of request stream int64 index = 3; // only present in first msg of request stream IPCChunk chunk = 4; // only present in first msg of request stream bytes bucket_id = 5; string file_name = 6; bytes nonce = 7; bytes node_id = 8; string signature = 9; int64 deadline = 10; } message IPCFileUploadBlockResponse {} message IPCFileViewRequest { string bucket_name = 1; string file_name = 2; string address = 3; } message IPCFileViewResponse { string bucket_name = 1; string file_name = 2; string root_cid = 3; int64 encoded_size = 4; bool is_public = 5; google.protobuf.Timestamp created_at = 6; int64 actual_size = 7; } message IPCFileDownloadCreateRequest { string bucket_name = 1; string file_name = 2; string address = 3; } message IPCFileDownloadCreateResponse { string bucket_name = 1; repeated Chunk chunks = 3; message Chunk { string cid = 1; int64 encoded_size = 2; int64 size = 3; } } message IPCFileDownloadRangeCreateRequest { string bucket_name = 1; string file_name = 2; string address = 3; int64 start_index = 4; int64 end_index = 5; } message IPCFileDownloadChunkCreateRequest { string bucket_name = 1; string file_name = 2; string chunk_cid = 3; int64 chunk_index = 4; string address = 5; } message IPCFileDownloadChunkCreateResponse { repeated BlockDownload blocks = 1; message BlockDownload { string cid = 1; int64 size = 2; string node_id = 3; string node_address = 4; string permit = 5; } } message IPCFileDownloadBlockRequest { string chunk_cid = 1; int64 chunk_index = 2; string block_cid = 3; int64 block_index = 4; string bucket_name = 5; string file_name = 6; string address = 7; } message IPCFileListRequest { string bucket_name = 1; string address = 2; int64 offset = 3; int64 limit = 4; } message IPCFileListResponse { repeated IPCFile list = 1; message IPCFile { string root_cid = 1; string name = 2; int64 encoded_size = 3; google.protobuf.Timestamp created_at = 4; int64 actual_size = 5; } } message IPCFileResolveBlockRequest { string block_cid = 1; } message IPCFileResolveBlockResponse { message PDP { string url = 1; int64 offset = 2; int64 size = 3; uint64 data_set_id = 4; } PDP block = 1; }