Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,271 changes: 731 additions & 540 deletions code/go/0chain.net/blobbercore/blobbergrpc/blobber.pb.go

Large diffs are not rendered by default.

115 changes: 115 additions & 0 deletions code/go/0chain.net/blobbercore/blobbergrpc/blobber.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions code/go/0chain.net/blobbercore/blobbergrpc/blobber_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions code/go/0chain.net/blobbercore/blobbergrpc/proto/blobber.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ service Blobber {
};
}

rpc Commit(CommitRequest) returns (CommitResponse) {
option (google.api.http) = {
post: "/v2/connection/commit/{allocation}"
body: "*"
};
}

rpc CalculateHash(CalculateHashRequest) returns (CalculateHashResponse) {
option (google.api.http) = {
post: "/v2/file/calculatehash/{allocation}"
Expand All @@ -61,6 +68,20 @@ message CalculateHashResponse {
string message = 1;
}

message CommitRequest {
string allocation = 1;
string connection_id = 2;
string write_marker = 3;
}


message CommitResponse {
string allocation_root = 1;
WriteMarker write_marker = 2;
string error_message = 3;
bool success = 4;
}

message GetObjectTreeRequest {
string path = 1;
string allocation = 2;
Expand Down
9 changes: 9 additions & 0 deletions code/go/0chain.net/blobbercore/convert/responseHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ func GetObjectTreeResponseHandler(getObjectTreeResponse *blobbergrpc.GetObjectTr
}
}

func CommitWriteResponseHandler(resp *blobbergrpc.CommitResponse) *blobberHTTP.CommitResult {
return &blobberHTTP.CommitResult{
AllocationRoot: resp.AllocationRoot,
WriteMarker: WriteMarkerGRPCToWriteMarker(resp.WriteMarker),
Success: resp.Success,
ErrorMessage: resp.ErrorMessage,
}
}

func GetCalculateHashResponseHandler(response *blobbergrpc.CalculateHashResponse) interface{} {
result := make(map[string]interface{})
if msg := response.GetMessage(); msg != "" {
Expand Down
Loading