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,452 changes: 821 additions & 631 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.

20 changes: 20 additions & 0 deletions code/go/0chain.net/blobbercore/blobbergrpc/proto/blobber.proto
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,26 @@ service Blobber {
body: "*"
};
}

rpc Collaborator(CollaboratorRequest) returns (CollaboratorResponse) {
option (google.api.http) = {
post: "/v2/file/collaborator/{allocation}"
body: "*"
};
}
}

message CollaboratorRequest {
string allocation = 1;
string collab_id = 2;
string method = 3;
string path = 4;
string path_hash = 5;
}

message CollaboratorResponse {
string message = 1;
repeated Collaborator Collaborators = 2;
}

message CalculateHashRequest {
Expand Down
19 changes: 19 additions & 0 deletions code/go/0chain.net/blobbercore/convert/responseHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,22 @@ func GetCommitMetaTxnHandlerResponse(response *blobbergrpc.CommitMetaTxnResponse

return result
}

func CollaboratorResponse(response *blobbergrpc.CollaboratorResponse) interface{} {
if msg := response.GetMessage(); msg != "" {
return struct {
Msg string `json:"msg"`
}{Msg: msg}
}

if collaborators := response.GetCollaborators(); collaborators != nil {
collabs := make([]reference.Collaborator, 0, len(collaborators))
for _, c := range collaborators {
collabs = append(collabs, *GRPCCollaboratorToCollaborator(c))
}

return collabs
}

return nil
}
8 changes: 3 additions & 5 deletions code/go/0chain.net/blobbercore/handler/grpc_commit_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@ import (
"encoding/json"
"strconv"

"gorm.io/gorm"

"github.com/0chain/blobber/code/go/0chain.net/blobbercore/convert"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/datastore"

"github.com/0chain/blobber/code/go/0chain.net/blobbercore/allocation"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/blobbergrpc"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/convert"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/datastore"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/writemarker"
"github.com/0chain/blobber/code/go/0chain.net/core/common"
"github.com/0chain/blobber/code/go/0chain.net/core/encryption"
"github.com/0chain/blobber/code/go/0chain.net/core/lock"
"gorm.io/gorm"
)

func (b *blobberGRPCService) Commit(ctx context.Context, req *blobbergrpc.CommitRequest) (*blobbergrpc.CommitResponse, error) {
Expand Down
Loading