diff --git a/api/client/ffs.go b/api/client/ffs.go index 5ab51ea87..5928caf6b 100644 --- a/api/client/ffs.go +++ b/api/client/ffs.go @@ -179,9 +179,9 @@ func (f *FFS) SetDefaultStorageConfig(ctx context.Context, config *rpc.StorageCo return f.client.SetDefaultStorageConfig(ctx, req) } -// CidData returns information about cids managed by the FFS instance. -func (f *FFS) CidData(ctx context.Context, cids ...string) (*rpc.CidDataResponse, error) { - return f.client.CidData(ctx, &rpc.CidDataRequest{Cids: cids}) +// CidInfo returns information about cids managed by the FFS instance. +func (f *FFS) CidInfo(ctx context.Context, cids ...string) (*rpc.CidInfoResponse, error) { + return f.client.CidInfo(ctx, &rpc.CidInfoRequest{Cids: cids}) } // CancelJob signals that the executing Job with JobID jid should be diff --git a/cmd/pow/cmd/ffs_data.go b/cmd/pow/cmd/ffs_info.go similarity index 83% rename from cmd/pow/cmd/ffs_data.go rename to cmd/pow/cmd/ffs_info.go index 567e25566..808e89a48 100644 --- a/cmd/pow/cmd/ffs_data.go +++ b/cmd/pow/cmd/ffs_info.go @@ -11,11 +11,11 @@ import ( ) func init() { - ffsCmd.AddCommand(ffsDataCmd) + ffsCmd.AddCommand(ffsInfoCmd) } -var ffsDataCmd = &cobra.Command{ - Use: "data [optional cid1,cid2,...]", +var ffsInfoCmd = &cobra.Command{ + Use: "info [optional cid1,cid2,...]", Short: "Get information about the current state of cid storage", Long: `Get information about the current state of cid storage`, Args: cobra.MaximumNArgs(1), @@ -32,7 +32,7 @@ var ffsDataCmd = &cobra.Command{ cids = strings.Split(args[0], ",") } - res, err := fcClient.FFS.CidData(mustAuthCtx(ctx), cids...) + res, err := fcClient.FFS.CidInfo(mustAuthCtx(ctx), cids...) checkErr(err) json, err := protojson.MarshalOptions{Multiline: true, Indent: " ", EmitUnpopulated: true}.Marshal(res) diff --git a/ffs/api/api.go b/ffs/api/api.go index ad19cae2c..ef709e903 100644 --- a/ffs/api/api.go +++ b/ffs/api/api.go @@ -134,8 +134,8 @@ func (i *API) GetStorageConfigs(cids ...cid.Cid) (map[cid.Cid]ffs.StorageConfig, // Show returns the information about a stored Cid. If no information is available, // since the Cid was never stored, it returns ErrNotFound. -func (i *API) Show(cid cid.Cid) (ffs.CidInfo, error) { - inf, err := i.sched.GetCidInfo(cid) +func (i *API) Show(cid cid.Cid) (ffs.StorageInfo, error) { + inf, err := i.sched.GetStorageInfo(cid) if err == scheduler.ErrNotFound { return inf, ErrNotFound } diff --git a/ffs/api/api_import.go b/ffs/api/api_import.go index 33e3f157d..93fe9bac7 100644 --- a/ffs/api/api_import.go +++ b/ffs/api/api_import.go @@ -43,7 +43,7 @@ func (i *API) ImportStorage(payloadCid cid.Cid, pieceCid cid.Cid, deals []Import } } - cinfo := ffs.CidInfo{ + cinfo := ffs.StorageInfo{ JobID: ffs.EmptyJobID, Cid: payloadCid, Created: time.Now(), @@ -57,7 +57,7 @@ func (i *API) ImportStorage(payloadCid cid.Cid, pieceCid cid.Cid, deals []Import }, } - if err := i.sched.ImportCidInfo(cinfo); err != nil { + if err := i.sched.ImportStorageInfo(cinfo); err != nil { return fmt.Errorf("importing cid info in scheduler: %s", err) } diff --git a/ffs/rpc/rpc.go b/ffs/rpc/rpc.go index eed5ee78e..a991a6c60 100644 --- a/ffs/rpc/rpc.go +++ b/ffs/rpc/rpc.go @@ -156,8 +156,8 @@ func (s *RPC) SetDefaultStorageConfig(ctx context.Context, req *SetDefaultStorag return &SetDefaultStorageConfigResponse{}, nil } -// CidData returns information about cids managed by the FFS instance. -func (s *RPC) CidData(ctx context.Context, req *CidDataRequest) (*CidDataResponse, error) { +// CidInfo returns information about cids managed by the FFS instance. +func (s *RPC) CidInfo(ctx context.Context, req *CidInfoRequest) (*CidInfoResponse, error) { i, err := s.getInstanceByToken(ctx) if err != nil { return nil, err @@ -176,10 +176,10 @@ func (s *RPC) CidData(ctx context.Context, req *CidDataRequest) (*CidDataRespons } return nil, status.Errorf(code, "getting storage configs: %v", err) } - res := make([]*CidData, 0, len(storageConfigs)) + res := make([]*CidInfo, 0, len(storageConfigs)) for cid, config := range storageConfigs { rpcConfig := ToRPCStorageConfig(config) - cidData := &CidData{ + cidInfo := &CidInfo{ Cid: cid.String(), LatestPushedStorageConfig: rpcConfig, } @@ -187,7 +187,7 @@ func (s *RPC) CidData(ctx context.Context, req *CidDataRequest) (*CidDataRespons if err != nil && err != api.ErrNotFound { return nil, status.Errorf(codes.Internal, "getting storage info: %v", err) } else if err == nil { - cidData.CurrentCidInfo = toRPCCidInfo(info) + cidInfo.CurrentStorageInfo = toRPCStorageInfo(info) } queuedJobs := i.QueuedStorageJobs(cid) rpcQueudJobs := make([]*Job, len(queuedJobs)) @@ -198,14 +198,14 @@ func (s *RPC) CidData(ctx context.Context, req *CidDataRequest) (*CidDataRespons } rpcQueudJobs[i] = rpcJob } - cidData.QueuedStorageJobs = rpcQueudJobs + cidInfo.QueuedStorageJobs = rpcQueudJobs executingJobs := i.ExecutingStorageJobs() if len(executingJobs) > 0 { rpcJob, err := toRPCJob(executingJobs[0]) if err != nil { return nil, status.Errorf(codes.Internal, "converting job to rpc job: %v", err) } - cidData.ExecutingStorageJob = rpcJob + cidInfo.ExecutingStorageJob = rpcJob } finalJobs := i.LatestFinalStorageJobs(cid) if len(finalJobs) > 0 { @@ -213,7 +213,7 @@ func (s *RPC) CidData(ctx context.Context, req *CidDataRequest) (*CidDataRespons if err != nil { return nil, status.Errorf(codes.Internal, "converting job to rpc job: %v", err) } - cidData.LatestFinalStorageJob = rpcJob + cidInfo.LatestFinalStorageJob = rpcJob } successfulJobs := i.LatestSuccessfulStorageJobs(cid) if len(successfulJobs) > 0 { @@ -221,11 +221,11 @@ func (s *RPC) CidData(ctx context.Context, req *CidDataRequest) (*CidDataRespons if err != nil { return nil, status.Errorf(codes.Internal, "converting job to rpc job: %v", err) } - cidData.LatestSuccessfulStorageJob = rpcJob + cidInfo.LatestSuccessfulStorageJob = rpcJob } - res = append(res, cidData) + res = append(res, cidInfo) } - return &CidDataResponse{CidDatas: res}, nil + return &CidInfoResponse{CidInfos: res}, nil } // CancelJob calls API.CancelJob. @@ -821,8 +821,8 @@ func fromRPCColdConfig(config *ColdConfig) ffs.ColdConfig { return res } -func toRPCCidInfo(info ffs.CidInfo) *CidInfo { - cidInfo := &CidInfo{ +func toRPCStorageInfo(info ffs.StorageInfo) *StorageInfo { + storageInfo := &StorageInfo{ JobId: info.JobID.String(), Cid: util.CidToString(info.Cid), Created: info.Created.UnixNano(), @@ -851,7 +851,7 @@ func toRPCCidInfo(info ffs.CidInfo) *CidInfo { if p.PieceCid.Defined() { strPieceCid = util.CidToString(p.PieceCid) } - cidInfo.Cold.Filecoin.Proposals[i] = &FilStorage{ + storageInfo.Cold.Filecoin.Proposals[i] = &FilStorage{ ProposalCid: strProposalCid, PieceCid: strPieceCid, Renewed: p.Renewed, @@ -862,7 +862,7 @@ func toRPCCidInfo(info ffs.CidInfo) *CidInfo { EpochPrice: p.EpochPrice, } } - return cidInfo + return storageInfo } func toRPCPaychInfo(info ffs.PaychInfo) *PaychInfo { diff --git a/ffs/rpc/rpc.pb.go b/ffs/rpc/rpc.pb.go index c7327fcdf..674b0eadb 100644 --- a/ffs/rpc/rpc.pb.go +++ b/ffs/rpc/rpc.pb.go @@ -948,7 +948,7 @@ func (x *ColdInfo) GetFilecoin() *FilInfo { return nil } -type CidInfo struct { +type StorageInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -960,8 +960,8 @@ type CidInfo struct { Cold *ColdInfo `protobuf:"bytes,5,opt,name=cold,proto3" json:"cold,omitempty"` } -func (x *CidInfo) Reset() { - *x = CidInfo{} +func (x *StorageInfo) Reset() { + *x = StorageInfo{} if protoimpl.UnsafeEnabled { mi := &file_ffs_rpc_rpc_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -969,13 +969,13 @@ func (x *CidInfo) Reset() { } } -func (x *CidInfo) String() string { +func (x *StorageInfo) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CidInfo) ProtoMessage() {} +func (*StorageInfo) ProtoMessage() {} -func (x *CidInfo) ProtoReflect() protoreflect.Message { +func (x *StorageInfo) ProtoReflect() protoreflect.Message { mi := &file_ffs_rpc_rpc_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -987,62 +987,62 @@ func (x *CidInfo) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CidInfo.ProtoReflect.Descriptor instead. -func (*CidInfo) Descriptor() ([]byte, []int) { +// Deprecated: Use StorageInfo.ProtoReflect.Descriptor instead. +func (*StorageInfo) Descriptor() ([]byte, []int) { return file_ffs_rpc_rpc_proto_rawDescGZIP(), []int{12} } -func (x *CidInfo) GetJobId() string { +func (x *StorageInfo) GetJobId() string { if x != nil { return x.JobId } return "" } -func (x *CidInfo) GetCid() string { +func (x *StorageInfo) GetCid() string { if x != nil { return x.Cid } return "" } -func (x *CidInfo) GetCreated() int64 { +func (x *StorageInfo) GetCreated() int64 { if x != nil { return x.Created } return 0 } -func (x *CidInfo) GetHot() *HotInfo { +func (x *StorageInfo) GetHot() *HotInfo { if x != nil { return x.Hot } return nil } -func (x *CidInfo) GetCold() *ColdInfo { +func (x *StorageInfo) GetCold() *ColdInfo { if x != nil { return x.Cold } return nil } -type CidData struct { +type CidInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` LatestPushedStorageConfig *StorageConfig `protobuf:"bytes,2,opt,name=latest_pushed_storage_config,json=latestPushedStorageConfig,proto3" json:"latest_pushed_storage_config,omitempty"` - CurrentCidInfo *CidInfo `protobuf:"bytes,3,opt,name=current_cid_info,json=currentCidInfo,proto3" json:"current_cid_info,omitempty"` + CurrentStorageInfo *StorageInfo `protobuf:"bytes,3,opt,name=current_storage_info,json=currentStorageInfo,proto3" json:"current_storage_info,omitempty"` QueuedStorageJobs []*Job `protobuf:"bytes,4,rep,name=queued_storage_jobs,json=queuedStorageJobs,proto3" json:"queued_storage_jobs,omitempty"` ExecutingStorageJob *Job `protobuf:"bytes,5,opt,name=executing_storage_job,json=executingStorageJob,proto3" json:"executing_storage_job,omitempty"` LatestFinalStorageJob *Job `protobuf:"bytes,6,opt,name=latest_final_storage_job,json=latestFinalStorageJob,proto3" json:"latest_final_storage_job,omitempty"` LatestSuccessfulStorageJob *Job `protobuf:"bytes,7,opt,name=latest_successful_storage_job,json=latestSuccessfulStorageJob,proto3" json:"latest_successful_storage_job,omitempty"` } -func (x *CidData) Reset() { - *x = CidData{} +func (x *CidInfo) Reset() { + *x = CidInfo{} if protoimpl.UnsafeEnabled { mi := &file_ffs_rpc_rpc_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1050,13 +1050,13 @@ func (x *CidData) Reset() { } } -func (x *CidData) String() string { +func (x *CidInfo) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CidData) ProtoMessage() {} +func (*CidInfo) ProtoMessage() {} -func (x *CidData) ProtoReflect() protoreflect.Message { +func (x *CidInfo) ProtoReflect() protoreflect.Message { mi := &file_ffs_rpc_rpc_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1068,54 +1068,54 @@ func (x *CidData) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CidData.ProtoReflect.Descriptor instead. -func (*CidData) Descriptor() ([]byte, []int) { +// Deprecated: Use CidInfo.ProtoReflect.Descriptor instead. +func (*CidInfo) Descriptor() ([]byte, []int) { return file_ffs_rpc_rpc_proto_rawDescGZIP(), []int{13} } -func (x *CidData) GetCid() string { +func (x *CidInfo) GetCid() string { if x != nil { return x.Cid } return "" } -func (x *CidData) GetLatestPushedStorageConfig() *StorageConfig { +func (x *CidInfo) GetLatestPushedStorageConfig() *StorageConfig { if x != nil { return x.LatestPushedStorageConfig } return nil } -func (x *CidData) GetCurrentCidInfo() *CidInfo { +func (x *CidInfo) GetCurrentStorageInfo() *StorageInfo { if x != nil { - return x.CurrentCidInfo + return x.CurrentStorageInfo } return nil } -func (x *CidData) GetQueuedStorageJobs() []*Job { +func (x *CidInfo) GetQueuedStorageJobs() []*Job { if x != nil { return x.QueuedStorageJobs } return nil } -func (x *CidData) GetExecutingStorageJob() *Job { +func (x *CidInfo) GetExecutingStorageJob() *Job { if x != nil { return x.ExecutingStorageJob } return nil } -func (x *CidData) GetLatestFinalStorageJob() *Job { +func (x *CidInfo) GetLatestFinalStorageJob() *Job { if x != nil { return x.LatestFinalStorageJob } return nil } -func (x *CidData) GetLatestSuccessfulStorageJob() *Job { +func (x *CidInfo) GetLatestSuccessfulStorageJob() *Job { if x != nil { return x.LatestSuccessfulStorageJob } @@ -2670,7 +2670,7 @@ func (*SetDefaultStorageConfigResponse) Descriptor() ([]byte, []int) { return file_ffs_rpc_rpc_proto_rawDescGZIP(), []int{37} } -type CidDataRequest struct { +type CidInfoRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2678,8 +2678,8 @@ type CidDataRequest struct { Cids []string `protobuf:"bytes,1,rep,name=cids,proto3" json:"cids,omitempty"` } -func (x *CidDataRequest) Reset() { - *x = CidDataRequest{} +func (x *CidInfoRequest) Reset() { + *x = CidInfoRequest{} if protoimpl.UnsafeEnabled { mi := &file_ffs_rpc_rpc_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2687,13 +2687,13 @@ func (x *CidDataRequest) Reset() { } } -func (x *CidDataRequest) String() string { +func (x *CidInfoRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CidDataRequest) ProtoMessage() {} +func (*CidInfoRequest) ProtoMessage() {} -func (x *CidDataRequest) ProtoReflect() protoreflect.Message { +func (x *CidInfoRequest) ProtoReflect() protoreflect.Message { mi := &file_ffs_rpc_rpc_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2705,28 +2705,28 @@ func (x *CidDataRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CidDataRequest.ProtoReflect.Descriptor instead. -func (*CidDataRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use CidInfoRequest.ProtoReflect.Descriptor instead. +func (*CidInfoRequest) Descriptor() ([]byte, []int) { return file_ffs_rpc_rpc_proto_rawDescGZIP(), []int{38} } -func (x *CidDataRequest) GetCids() []string { +func (x *CidInfoRequest) GetCids() []string { if x != nil { return x.Cids } return nil } -type CidDataResponse struct { +type CidInfoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - CidDatas []*CidData `protobuf:"bytes,1,rep,name=cid_datas,json=cidDatas,proto3" json:"cid_datas,omitempty"` + CidInfos []*CidInfo `protobuf:"bytes,1,rep,name=cid_infos,json=cidInfos,proto3" json:"cid_infos,omitempty"` } -func (x *CidDataResponse) Reset() { - *x = CidDataResponse{} +func (x *CidInfoResponse) Reset() { + *x = CidInfoResponse{} if protoimpl.UnsafeEnabled { mi := &file_ffs_rpc_rpc_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2734,13 +2734,13 @@ func (x *CidDataResponse) Reset() { } } -func (x *CidDataResponse) String() string { +func (x *CidInfoResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CidDataResponse) ProtoMessage() {} +func (*CidInfoResponse) ProtoMessage() {} -func (x *CidDataResponse) ProtoReflect() protoreflect.Message { +func (x *CidInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_ffs_rpc_rpc_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2752,14 +2752,14 @@ func (x *CidDataResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CidDataResponse.ProtoReflect.Descriptor instead. -func (*CidDataResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use CidInfoResponse.ProtoReflect.Descriptor instead. +func (*CidInfoResponse) Descriptor() ([]byte, []int) { return file_ffs_rpc_rpc_proto_rawDescGZIP(), []int{39} } -func (x *CidDataResponse) GetCidDatas() []*CidData { +func (x *CidInfoResponse) GetCidInfos() []*CidInfo { if x != nil { - return x.CidDatas + return x.CidInfos } return nil } @@ -4901,27 +4901,28 @@ var file_ffs_rpc_rpc_proto_rawDesc = []byte{ 0x64, 0x12, 0x2c, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x66, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x69, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x22, - 0x97, 0x01, 0x0a, 0x07, 0x43, 0x69, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x15, 0x0a, 0x06, 0x6a, - 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f, 0x62, - 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x63, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x22, - 0x0a, 0x03, 0x68, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x66, - 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x6f, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x03, 0x68, - 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x63, 0x6f, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x66, 0x66, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6c, 0x64, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x63, 0x6f, 0x6c, 0x64, 0x22, 0xc8, 0x03, 0x0a, 0x07, 0x43, 0x69, - 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x57, 0x0a, 0x1c, 0x6c, 0x61, 0x74, 0x65, 0x73, - 0x74, 0x5f, 0x70, 0x75, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x66, 0x66, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x19, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x75, 0x73, - 0x68, 0x65, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x3a, 0x0a, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x69, 0x64, 0x5f, - 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x66, 0x73, - 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x69, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0e, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x69, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3c, 0x0a, 0x13, + 0x9b, 0x01, 0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x15, 0x0a, 0x06, 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x12, 0x22, 0x0a, 0x03, 0x68, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x66, 0x66, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x6f, 0x74, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x03, 0x68, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x63, 0x6f, 0x6c, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x66, 0x66, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, + 0x6f, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x63, 0x6f, 0x6c, 0x64, 0x22, 0xd4, 0x03, + 0x0a, 0x07, 0x43, 0x69, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x57, 0x0a, 0x1c, 0x6c, + 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x75, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x66, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x19, 0x6c, 0x61, 0x74, 0x65, 0x73, + 0x74, 0x50, 0x75, 0x73, 0x68, 0x65, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x12, 0x46, 0x0a, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x66, 0x66, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x12, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3c, 0x0a, 0x13, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x66, 0x66, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x11, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x53, @@ -5115,13 +5116,13 @@ var file_ffs_rpc_rpc_proto_rawDesc = []byte{ 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x21, 0x0a, 0x1f, 0x53, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x0a, 0x0e, 0x43, 0x69, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x0a, 0x0e, 0x43, 0x69, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x64, 0x73, 0x22, 0x40, 0x0a, 0x0f, 0x43, 0x69, - 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, - 0x09, 0x63, 0x69, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x66, 0x66, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x69, 0x64, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x08, 0x63, 0x69, 0x64, 0x44, 0x61, 0x74, 0x61, 0x73, 0x22, 0x24, 0x0a, 0x10, + 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, + 0x09, 0x63, 0x69, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x66, 0x66, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x69, 0x64, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x08, 0x63, 0x69, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x22, 0x24, 0x0a, 0x10, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6a, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6a, 0x69, 0x64, 0x22, 0x13, 0x0a, 0x11, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4a, 0x6f, 0x62, 0x52, @@ -5356,10 +5357,10 @@ var file_ffs_rpc_rpc_proto_rawDesc = []byte{ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x66, 0x66, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x07, 0x43, 0x69, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x17, 0x2e, - 0x66, 0x66, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x69, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x07, 0x43, 0x69, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x2e, + 0x66, 0x66, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x69, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x66, 0x66, 0x73, 0x2e, 0x72, 0x70, 0x63, - 0x2e, 0x43, 0x69, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x43, 0x69, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x09, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4a, 0x6f, 0x62, 0x12, 0x19, 0x2e, 0x66, 0x66, 0x73, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x66, 0x66, 0x73, @@ -5501,8 +5502,8 @@ var file_ffs_rpc_rpc_proto_goTypes = []interface{}{ (*FilStorage)(nil), // 11: ffs.rpc.FilStorage (*FilInfo)(nil), // 12: ffs.rpc.FilInfo (*ColdInfo)(nil), // 13: ffs.rpc.ColdInfo - (*CidInfo)(nil), // 14: ffs.rpc.CidInfo - (*CidData)(nil), // 15: ffs.rpc.CidData + (*StorageInfo)(nil), // 14: ffs.rpc.StorageInfo + (*CidInfo)(nil), // 15: ffs.rpc.CidInfo (*DealInfo)(nil), // 16: ffs.rpc.DealInfo (*Job)(nil), // 17: ffs.rpc.Job (*DealError)(nil), // 18: ffs.rpc.DealError @@ -5527,8 +5528,8 @@ var file_ffs_rpc_rpc_proto_goTypes = []interface{}{ (*NewAddrResponse)(nil), // 37: ffs.rpc.NewAddrResponse (*SetDefaultStorageConfigRequest)(nil), // 38: ffs.rpc.SetDefaultStorageConfigRequest (*SetDefaultStorageConfigResponse)(nil), // 39: ffs.rpc.SetDefaultStorageConfigResponse - (*CidDataRequest)(nil), // 40: ffs.rpc.CidDataRequest - (*CidDataResponse)(nil), // 41: ffs.rpc.CidDataResponse + (*CidInfoRequest)(nil), // 40: ffs.rpc.CidInfoRequest + (*CidInfoResponse)(nil), // 41: ffs.rpc.CidInfoResponse (*CancelJobRequest)(nil), // 42: ffs.rpc.CancelJobRequest (*CancelJobResponse)(nil), // 43: ffs.rpc.CancelJobResponse (*StorageJobRequest)(nil), // 44: ffs.rpc.StorageJobRequest @@ -5580,14 +5581,14 @@ var file_ffs_rpc_rpc_proto_depIdxs = []int32{ 9, // 5: ffs.rpc.HotInfo.ipfs:type_name -> ffs.rpc.IpfsHotInfo 11, // 6: ffs.rpc.FilInfo.proposals:type_name -> ffs.rpc.FilStorage 12, // 7: ffs.rpc.ColdInfo.filecoin:type_name -> ffs.rpc.FilInfo - 10, // 8: ffs.rpc.CidInfo.hot:type_name -> ffs.rpc.HotInfo - 13, // 9: ffs.rpc.CidInfo.cold:type_name -> ffs.rpc.ColdInfo - 8, // 10: ffs.rpc.CidData.latest_pushed_storage_config:type_name -> ffs.rpc.StorageConfig - 14, // 11: ffs.rpc.CidData.current_cid_info:type_name -> ffs.rpc.CidInfo - 17, // 12: ffs.rpc.CidData.queued_storage_jobs:type_name -> ffs.rpc.Job - 17, // 13: ffs.rpc.CidData.executing_storage_job:type_name -> ffs.rpc.Job - 17, // 14: ffs.rpc.CidData.latest_final_storage_job:type_name -> ffs.rpc.Job - 17, // 15: ffs.rpc.CidData.latest_successful_storage_job:type_name -> ffs.rpc.Job + 10, // 8: ffs.rpc.StorageInfo.hot:type_name -> ffs.rpc.HotInfo + 13, // 9: ffs.rpc.StorageInfo.cold:type_name -> ffs.rpc.ColdInfo + 8, // 10: ffs.rpc.CidInfo.latest_pushed_storage_config:type_name -> ffs.rpc.StorageConfig + 14, // 11: ffs.rpc.CidInfo.current_storage_info:type_name -> ffs.rpc.StorageInfo + 17, // 12: ffs.rpc.CidInfo.queued_storage_jobs:type_name -> ffs.rpc.Job + 17, // 13: ffs.rpc.CidInfo.executing_storage_job:type_name -> ffs.rpc.Job + 17, // 14: ffs.rpc.CidInfo.latest_final_storage_job:type_name -> ffs.rpc.Job + 17, // 15: ffs.rpc.CidInfo.latest_successful_storage_job:type_name -> ffs.rpc.Job 0, // 16: ffs.rpc.Job.status:type_name -> ffs.rpc.JobStatus 16, // 17: ffs.rpc.Job.deal_info:type_name -> ffs.rpc.DealInfo 18, // 18: ffs.rpc.Job.deal_errors:type_name -> ffs.rpc.DealError @@ -5597,7 +5598,7 @@ var file_ffs_rpc_rpc_proto_depIdxs = []int32{ 2, // 22: ffs.rpc.AddrsResponse.addrs:type_name -> ffs.rpc.AddrInfo 8, // 23: ffs.rpc.DefaultStorageConfigResponse.default_storage_config:type_name -> ffs.rpc.StorageConfig 8, // 24: ffs.rpc.SetDefaultStorageConfigRequest.config:type_name -> ffs.rpc.StorageConfig - 15, // 25: ffs.rpc.CidDataResponse.cid_datas:type_name -> ffs.rpc.CidData + 15, // 25: ffs.rpc.CidInfoResponse.cid_infos:type_name -> ffs.rpc.CidInfo 17, // 26: ffs.rpc.StorageJobResponse.job:type_name -> ffs.rpc.Job 17, // 27: ffs.rpc.QueuedStorageJobsResponse.storage_jobs:type_name -> ffs.rpc.Job 17, // 28: ffs.rpc.ExecutingStorageJobsResponse.storage_jobs:type_name -> ffs.rpc.Job @@ -5624,7 +5625,7 @@ var file_ffs_rpc_rpc_proto_depIdxs = []int32{ 32, // 49: ffs.rpc.RPCService.SignMessage:input_type -> ffs.rpc.SignMessageRequest 34, // 50: ffs.rpc.RPCService.VerifyMessage:input_type -> ffs.rpc.VerifyMessageRequest 38, // 51: ffs.rpc.RPCService.SetDefaultStorageConfig:input_type -> ffs.rpc.SetDefaultStorageConfigRequest - 40, // 52: ffs.rpc.RPCService.CidData:input_type -> ffs.rpc.CidDataRequest + 40, // 52: ffs.rpc.RPCService.CidInfo:input_type -> ffs.rpc.CidInfoRequest 42, // 53: ffs.rpc.RPCService.CancelJob:input_type -> ffs.rpc.CancelJobRequest 44, // 54: ffs.rpc.RPCService.StorageJob:input_type -> ffs.rpc.StorageJobRequest 46, // 55: ffs.rpc.RPCService.QueuedStorageJobs:input_type -> ffs.rpc.QueuedStorageJobsRequest @@ -5652,7 +5653,7 @@ var file_ffs_rpc_rpc_proto_depIdxs = []int32{ 33, // 77: ffs.rpc.RPCService.SignMessage:output_type -> ffs.rpc.SignMessageResponse 35, // 78: ffs.rpc.RPCService.VerifyMessage:output_type -> ffs.rpc.VerifyMessageResponse 39, // 79: ffs.rpc.RPCService.SetDefaultStorageConfig:output_type -> ffs.rpc.SetDefaultStorageConfigResponse - 41, // 80: ffs.rpc.RPCService.CidData:output_type -> ffs.rpc.CidDataResponse + 41, // 80: ffs.rpc.RPCService.CidInfo:output_type -> ffs.rpc.CidInfoResponse 43, // 81: ffs.rpc.RPCService.CancelJob:output_type -> ffs.rpc.CancelJobResponse 45, // 82: ffs.rpc.RPCService.StorageJob:output_type -> ffs.rpc.StorageJobResponse 47, // 83: ffs.rpc.RPCService.QueuedStorageJobs:output_type -> ffs.rpc.QueuedStorageJobsResponse @@ -5831,7 +5832,7 @@ func file_ffs_rpc_rpc_proto_init() { } } file_ffs_rpc_rpc_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CidInfo); i { + switch v := v.(*StorageInfo); i { case 0: return &v.state case 1: @@ -5843,7 +5844,7 @@ func file_ffs_rpc_rpc_proto_init() { } } file_ffs_rpc_rpc_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CidData); i { + switch v := v.(*CidInfo); i { case 0: return &v.state case 1: @@ -6143,7 +6144,7 @@ func file_ffs_rpc_rpc_proto_init() { } } file_ffs_rpc_rpc_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CidDataRequest); i { + switch v := v.(*CidInfoRequest); i { case 0: return &v.state case 1: @@ -6155,7 +6156,7 @@ func file_ffs_rpc_rpc_proto_init() { } } file_ffs_rpc_rpc_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CidDataResponse); i { + switch v := v.(*CidInfoResponse); i { case 0: return &v.state case 1: @@ -6699,7 +6700,7 @@ type RPCServiceClient interface { SignMessage(ctx context.Context, in *SignMessageRequest, opts ...grpc.CallOption) (*SignMessageResponse, error) VerifyMessage(ctx context.Context, in *VerifyMessageRequest, opts ...grpc.CallOption) (*VerifyMessageResponse, error) SetDefaultStorageConfig(ctx context.Context, in *SetDefaultStorageConfigRequest, opts ...grpc.CallOption) (*SetDefaultStorageConfigResponse, error) - CidData(ctx context.Context, in *CidDataRequest, opts ...grpc.CallOption) (*CidDataResponse, error) + CidInfo(ctx context.Context, in *CidInfoRequest, opts ...grpc.CallOption) (*CidInfoResponse, error) CancelJob(ctx context.Context, in *CancelJobRequest, opts ...grpc.CallOption) (*CancelJobResponse, error) StorageJob(ctx context.Context, in *StorageJobRequest, opts ...grpc.CallOption) (*StorageJobResponse, error) QueuedStorageJobs(ctx context.Context, in *QueuedStorageJobsRequest, opts ...grpc.CallOption) (*QueuedStorageJobsResponse, error) @@ -6793,9 +6794,9 @@ func (c *rPCServiceClient) SetDefaultStorageConfig(ctx context.Context, in *SetD return out, nil } -func (c *rPCServiceClient) CidData(ctx context.Context, in *CidDataRequest, opts ...grpc.CallOption) (*CidDataResponse, error) { - out := new(CidDataResponse) - err := c.cc.Invoke(ctx, "/ffs.rpc.RPCService/CidData", in, out, opts...) +func (c *rPCServiceClient) CidInfo(ctx context.Context, in *CidInfoRequest, opts ...grpc.CallOption) (*CidInfoResponse, error) { + out := new(CidInfoResponse) + err := c.cc.Invoke(ctx, "/ffs.rpc.RPCService/CidInfo", in, out, opts...) if err != nil { return nil, err } @@ -7085,7 +7086,7 @@ type RPCServiceServer interface { SignMessage(context.Context, *SignMessageRequest) (*SignMessageResponse, error) VerifyMessage(context.Context, *VerifyMessageRequest) (*VerifyMessageResponse, error) SetDefaultStorageConfig(context.Context, *SetDefaultStorageConfigRequest) (*SetDefaultStorageConfigResponse, error) - CidData(context.Context, *CidDataRequest) (*CidDataResponse, error) + CidInfo(context.Context, *CidInfoRequest) (*CidInfoResponse, error) CancelJob(context.Context, *CancelJobRequest) (*CancelJobResponse, error) StorageJob(context.Context, *StorageJobRequest) (*StorageJobResponse, error) QueuedStorageJobs(context.Context, *QueuedStorageJobsRequest) (*QueuedStorageJobsResponse, error) @@ -7133,8 +7134,8 @@ func (*UnimplementedRPCServiceServer) VerifyMessage(context.Context, *VerifyMess func (*UnimplementedRPCServiceServer) SetDefaultStorageConfig(context.Context, *SetDefaultStorageConfigRequest) (*SetDefaultStorageConfigResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetDefaultStorageConfig not implemented") } -func (*UnimplementedRPCServiceServer) CidData(context.Context, *CidDataRequest) (*CidDataResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CidData not implemented") +func (*UnimplementedRPCServiceServer) CidInfo(context.Context, *CidInfoRequest) (*CidInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CidInfo not implemented") } func (*UnimplementedRPCServiceServer) CancelJob(context.Context, *CancelJobRequest) (*CancelJobResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CancelJob not implemented") @@ -7327,20 +7328,20 @@ func _RPCService_SetDefaultStorageConfig_Handler(srv interface{}, ctx context.Co return interceptor(ctx, in, info, handler) } -func _RPCService_CidData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CidDataRequest) +func _RPCService_CidInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CidInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(RPCServiceServer).CidData(ctx, in) + return srv.(RPCServiceServer).CidInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ffs.rpc.RPCService/CidData", + FullMethod: "/ffs.rpc.RPCService/CidInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RPCServiceServer).CidData(ctx, req.(*CidDataRequest)) + return srv.(RPCServiceServer).CidInfo(ctx, req.(*CidInfoRequest)) } return interceptor(ctx, in, info, handler) } @@ -7755,8 +7756,8 @@ var _RPCService_serviceDesc = grpc.ServiceDesc{ Handler: _RPCService_SetDefaultStorageConfig_Handler, }, { - MethodName: "CidData", - Handler: _RPCService_CidData_Handler, + MethodName: "CidInfo", + Handler: _RPCService_CidInfo_Handler, }, { MethodName: "CancelJob", diff --git a/ffs/rpc/rpc.proto b/ffs/rpc/rpc.proto index 8e8d57722..37cbb361b 100644 --- a/ffs/rpc/rpc.proto +++ b/ffs/rpc/rpc.proto @@ -85,7 +85,7 @@ message ColdInfo { FilInfo filecoin = 2; } -message CidInfo { +message StorageInfo { string job_id = 1; string cid = 2; int64 created = 3; @@ -93,10 +93,10 @@ message CidInfo { ColdInfo cold = 5; } -message CidData { +message CidInfo { string cid = 1; StorageConfig latest_pushed_storage_config = 2; - CidInfo current_cid_info = 3; + StorageInfo current_storage_info = 3; repeated Job queued_storage_jobs = 4; Job executing_storage_job = 5; Job latest_final_storage_job = 6; @@ -273,12 +273,12 @@ message SetDefaultStorageConfigRequest { message SetDefaultStorageConfigResponse { } -message CidDataRequest { +message CidInfoRequest { repeated string cids = 1; } -message CidDataResponse { - repeated CidData cid_datas = 1; +message CidInfoResponse { + repeated CidInfo cid_infos = 1; } message CancelJobRequest { @@ -467,7 +467,7 @@ service RPCService { rpc SignMessage(SignMessageRequest) returns (SignMessageResponse) {} rpc VerifyMessage(VerifyMessageRequest) returns (VerifyMessageResponse) {} rpc SetDefaultStorageConfig(SetDefaultStorageConfigRequest) returns (SetDefaultStorageConfigResponse) {} - rpc CidData(CidDataRequest) returns (CidDataResponse) {} + rpc CidInfo(CidInfoRequest) returns (CidInfoResponse) {} rpc CancelJob(CancelJobRequest) returns (CancelJobResponse) {} rpc StorageJob(StorageJobRequest) returns (StorageJobResponse) {} rpc QueuedStorageJobs(QueuedStorageJobsRequest) returns (QueuedStorageJobsResponse) {} diff --git a/ffs/scheduler/internal/cistore/cistore.go b/ffs/scheduler/internal/cistore/cistore.go index e21752317..b48b1e52b 100644 --- a/ffs/scheduler/internal/cistore/cistore.go +++ b/ffs/scheduler/internal/cistore/cistore.go @@ -16,7 +16,7 @@ var ( ErrNotFound = errors.New("cid info not found") ) -// Store is an Datastore implementation of CidInfoStore. +// Store is an Datastore implementation of StorageInfoStore. type Store struct { ds datastore.Datastore // ToDo: Build some index in here for fetching by iid and cid etc @@ -30,8 +30,8 @@ func New(ds datastore.Datastore) *Store { } // Get gets the current stored state of a Cid. -func (s *Store) Get(c cid.Cid) (ffs.CidInfo, error) { - var ci ffs.CidInfo +func (s *Store) Get(c cid.Cid) (ffs.StorageInfo, error) { + var ci ffs.StorageInfo buf, err := s.ds.Get(makeKey(c)) if err == datastore.ErrNotFound { return ci, ErrNotFound @@ -45,8 +45,8 @@ func (s *Store) Get(c cid.Cid) (ffs.CidInfo, error) { return ci, nil } -// Put saves a new storing state for a Cid. -func (s *Store) Put(ci ffs.CidInfo) error { +// Put saves a new storage state for a Cid. +func (s *Store) Put(ci ffs.StorageInfo) error { if !ci.Cid.Defined() { return fmt.Errorf("cid can't be undefined") } diff --git a/ffs/scheduler/scheduler_storage.go b/ffs/scheduler/scheduler_storage.go index 8efed51b8..87491d45e 100644 --- a/ffs/scheduler/scheduler_storage.go +++ b/ffs/scheduler/scheduler_storage.go @@ -97,22 +97,22 @@ func (s *Scheduler) Untrack(c cid.Cid) error { return nil } -// GetCidInfo returns the current storage state of a Cid. Returns ErrNotFound +// GetStorageInfo returns the current storage state of a Cid. Returns ErrNotFound // if there isn't information for a Cid. -func (s *Scheduler) GetCidInfo(c cid.Cid) (ffs.CidInfo, error) { +func (s *Scheduler) GetStorageInfo(c cid.Cid) (ffs.StorageInfo, error) { info, err := s.cis.Get(c) if err == cistore.ErrNotFound { - return ffs.CidInfo{}, ErrNotFound + return ffs.StorageInfo{}, ErrNotFound } if err != nil { - return ffs.CidInfo{}, fmt.Errorf("getting CidInfo from store: %s", err) + return ffs.StorageInfo{}, fmt.Errorf("getting StorageInfo from store: %s", err) } return info, nil } -// ImportCidInfo imports Cid information manually. That's to say, will be CidInfo +// ImportStorageInfo imports Cid information manually. That's to say, will be StorageInfo // which wasn't generated by executing a Job, but provided externally. -func (s *Scheduler) ImportCidInfo(ci ffs.CidInfo) error { +func (s *Scheduler) ImportStorageInfo(ci ffs.StorageInfo) error { _, err := s.cis.Get(ci.Cid) if err != nil && err != cistore.ErrNotFound { return fmt.Errorf("checking if cid info already exists: %s", err) @@ -202,15 +202,15 @@ func (s *Scheduler) StorageConfig(jid ffs.JobID) (ffs.StorageConfig, error) { // executeStorage executes a Job. If an error is returned, it means that the Job // should be considered failed. If error is nil, it still can return []ffs.DealError // since some deals failing isn't necessarily a fatal Job config execution. -func (s *Scheduler) executeStorage(ctx context.Context, a astore.StorageAction, job ffs.StorageJob, dealUpdates chan deals.StorageDealInfo) (ffs.CidInfo, []ffs.DealError, error) { +func (s *Scheduler) executeStorage(ctx context.Context, a astore.StorageAction, job ffs.StorageJob, dealUpdates chan deals.StorageDealInfo) (ffs.StorageInfo, []ffs.DealError, error) { ci, err := s.getRefreshedInfo(ctx, a.Cid) if err != nil { - return ffs.CidInfo{}, nil, fmt.Errorf("getting current cid info from store: %s", err) + return ffs.StorageInfo{}, nil, fmt.Errorf("getting current cid info from store: %s", err) } if a.ReplacedCid.Defined() { if err := s.Untrack(a.ReplacedCid); err != nil && err != astore.ErrNotFound { - return ffs.CidInfo{}, nil, fmt.Errorf("untracking replaced cid: %s", err) + return ffs.StorageInfo{}, nil, fmt.Errorf("untracking replaced cid: %s", err) } } @@ -218,7 +218,7 @@ func (s *Scheduler) executeStorage(ctx context.Context, a astore.StorageAction, hot, err := s.executeHotStorage(ctx, ci, a.Cfg.Hot, a.Cfg.Cold.Filecoin.Addr, a.ReplacedCid) if err != nil { s.l.Log(ctx, "Hot-Storage excution failed.") - return ffs.CidInfo{}, nil, fmt.Errorf("executing hot-storage config: %s", err) + return ffs.StorageInfo{}, nil, fmt.Errorf("executing hot-storage config: %s", err) } s.l.Log(ctx, "Hot-Storage execution ran successfully.") @@ -226,11 +226,11 @@ func (s *Scheduler) executeStorage(ctx context.Context, a astore.StorageAction, cold, errors, err := s.executeColdStorage(ctx, ci, a.Cfg.Cold, dealUpdates) if err != nil { s.l.Log(ctx, "Cold-Storage execution failed.") - return ffs.CidInfo{}, errors, fmt.Errorf("executing cold-storage config: %s", err) + return ffs.StorageInfo{}, errors, fmt.Errorf("executing cold-storage config: %s", err) } s.l.Log(ctx, "Cold-Storage execution ran successfully.") - return ffs.CidInfo{ + return ffs.StorageInfo{ JobID: job.ID, Cid: a.Cid, Hot: hot, @@ -239,7 +239,7 @@ func (s *Scheduler) executeStorage(ctx context.Context, a astore.StorageAction, }, errors, nil } -func (s *Scheduler) executeHotStorage(ctx context.Context, curr ffs.CidInfo, cfg ffs.HotConfig, waddr string, replaceCid cid.Cid) (ffs.HotInfo, error) { +func (s *Scheduler) executeHotStorage(ctx context.Context, curr ffs.StorageInfo, cfg ffs.HotConfig, waddr string, replaceCid cid.Cid) (ffs.HotInfo, error) { if cfg.Enabled == curr.Hot.Enabled { s.l.Log(ctx, "No actions needed in Hot Storage.") return curr.Hot, nil @@ -304,24 +304,24 @@ func (s *Scheduler) executeHotStorage(ctx context.Context, curr ffs.CidInfo, cfg }, nil } -func (s *Scheduler) getRefreshedInfo(ctx context.Context, c cid.Cid) (ffs.CidInfo, error) { +func (s *Scheduler) getRefreshedInfo(ctx context.Context, c cid.Cid) (ffs.StorageInfo, error) { var err error ci, err := s.cis.Get(c) if err != nil { if err != cistore.ErrNotFound { - return ffs.CidInfo{}, ErrNotFound + return ffs.StorageInfo{}, ErrNotFound } - return ffs.CidInfo{Cid: c}, nil // Default value has both storages disabled + return ffs.StorageInfo{Cid: c}, nil // Default value has both storages disabled } ci.Hot, err = s.getRefreshedHotInfo(ctx, c, ci.Hot) if err != nil { - return ffs.CidInfo{}, fmt.Errorf("getting refreshed hot info: %s", err) + return ffs.StorageInfo{}, fmt.Errorf("getting refreshed hot info: %s", err) } ci.Cold, err = s.getRefreshedColdInfo(ctx, ci.Cold) if err != nil { - return ffs.CidInfo{}, fmt.Errorf("getting refreshed cold info: %s", err) + return ffs.StorageInfo{}, fmt.Errorf("getting refreshed cold info: %s", err) } return ci, nil @@ -357,7 +357,7 @@ func (s *Scheduler) getRefreshedColdInfo(ctx context.Context, curr ffs.ColdInfo) return curr, nil } -func (s *Scheduler) executeColdStorage(ctx context.Context, curr ffs.CidInfo, cfg ffs.ColdConfig, dealUpdates chan deals.StorageDealInfo) (ffs.ColdInfo, []ffs.DealError, error) { +func (s *Scheduler) executeColdStorage(ctx context.Context, curr ffs.StorageInfo, cfg ffs.ColdConfig, dealUpdates chan deals.StorageDealInfo) (ffs.ColdInfo, []ffs.DealError, error) { if !cfg.Enabled { s.l.Log(ctx, "Cold-Storage was disabled, Filecoin deals will eventually expire.") return curr.Cold, nil, nil diff --git a/ffs/types.go b/ffs/types.go index ef9a4aba1..8ca60bf88 100644 --- a/ffs/types.go +++ b/ffs/types.go @@ -409,9 +409,9 @@ type RetrievalInfo struct { CreatedAt time.Time } -// CidInfo contains information about the current storage state +// StorageInfo contains information about the current storage state // of a Cid. -type CidInfo struct { +type StorageInfo struct { // JobID indicates the Job ID which updated // the current information. It *may be empty* if // the data was imported manually.