about summary refs log tree commit diff
path: root/tvix/store/protos
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2022-10-29T11·27+0200
committerflokli <flokli@flokli.de>2022-12-15T19·10+0000
commit5f9796cf9411028451ffc39ffe2c7ab52fd4d337 (patch)
tree1d2c15222124174fbe7c707f9d2fc1bd9cd37c59 /tvix/store/protos
parent64f812b2f0ecd1b6759d8f2e4a9f05905f52e99d (diff)
feat(tvix/proto): add rpc_blobstore r/5422
This defines a service that can be used to get and put content-addressed
chunks of data.

Change-Id: I36cf2278ed1daf71848c04fdfd14450b2268c5de
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7135
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/store/protos')
-rw-r--r--tvix/store/protos/rpc_blobstore.proto32
1 files changed, 32 insertions, 0 deletions
diff --git a/tvix/store/protos/rpc_blobstore.proto b/tvix/store/protos/rpc_blobstore.proto
new file mode 100644
index 0000000000..49a6b974f0
--- /dev/null
+++ b/tvix/store/protos/rpc_blobstore.proto
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: MIT
+// Copyright © 2022 The Tvix Authors
+syntax = "proto3";
+
+package tvix.store.v1;
+
+service BlobService {
+    rpc Get(GetBlobRequest) returns (GetBlobResponse);
+    rpc Put(PutBlobRequest) 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 GetBlobResponse {
+    bytes data = 1;
+}
+
+message PutBlobRequest {
+    bytes data = 1;
+}
+
+message PutBlobResponse {
+    // The blake3 digest of the data that was sent.
+    bytes digest = 1;
+}