tvl-depot/tvix/store/protos/rpc_blobstore.proto
Florian Klink 1c15154b83 feat(tvix/store): make blobstore stream chunks
This changes the RPC methods to return/consume a stream of chunks, instead of a
very big message containing the whole blob, to keep message sizes in manageable
sizes (less than 4MiB).

Change-Id: I2a3a50f07b059d8a2f5196860254adff98c8a352
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7651
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
2022-12-28 13:55:18 +00:00

33 lines
880 B
Protocol Buffer

// SPDX-License-Identifier: MIT
// Copyright © 2022 The Tvix Authors
syntax = "proto3";
package tvix.store.v1;
option go_package = "code.tvl.fyi/tvix/store/protos;storev1";
service BlobService {
rpc Get(GetBlobRequest) returns (stream BlobChunk);
rpc Put(stream BlobChunk) returns (PutBlobResponse);
// TODO(flokli): We can get fancy here, and add methods to retrieve
// [Bao](https://github.com/oconnor663/bao/blob/master/docs/spec.md), and
// then support range requests, but that's left for later.
}
message GetBlobRequest {
// The blake3 digest of the blob requested
bytes digest = 1;
}
message PutBlobResponse {
// The blake3 digest of the data that was sent.
bytes digest = 1;
}
// This represents a part of a chunk.
// Blobs are sent in smaller chunks to keep message sizes manageable.
message BlobChunk {
bytes data = 1;
}