about summary refs log tree commit diff
path: root/tvix/store/protos/rpc_blobstore.proto
blob: cca195c3d975c90a6ea21ebcfd50087336230f41 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// 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;
}