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
15 changes: 7 additions & 8 deletions code/go/0chain.net/blobbercore/allocation/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,20 @@ type Allocation struct {
UsedSize int64 `gorm:"column:used_size"`
OwnerID string `gorm:"column:owner_id"`
OwnerPublicKey string `gorm:"column:owner_public_key"`
RepairerID string `gorm:"column:repairer_id"`// experimental / blobber node id
PayerID string `gorm:"column:payer_id"` // optional / client paying for all r/w ops
Expiration common.Timestamp `gorm:"column:expiration_date"`
AllocationRoot string `gorm:"column:allocation_root"`
BlobberSize int64 `gorm:"column:blobber_size"`
BlobberSizeUsed int64 `gorm:"column:blobber_size_used"`
LatestRedeemedWM string `gorm:"column:latest_redeemed_write_marker"`
IsRedeemRequired bool `gorm:"column:is_redeem_required"`
TimeUnit time.Duration `gorm:"column:time_unit"`
// ending and cleaning
CleanedUp bool `gorm:"column:cleaned_up"`
Finalized bool `gorm:"column:finalized"`
// Has many terms.
Terms []*Terms `gorm:"-"`

// Used for 3rd party/payer operations
PayerID string `gorm:"column:payer_id"`
// Ending and cleaning
CleanedUp bool `gorm:"column:cleaned_up"`
Finalized bool `gorm:"column:finalized"`
// Has many terms
Terms []*Terms `gorm:"-"`
}

func (Allocation) TableName() string {
Expand Down
2 changes: 1 addition & 1 deletion code/go/0chain.net/blobbercore/allocation/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ func VerifyAllocationTransaction(ctx context.Context, allocationTx string,
a.Expiration = sa.Expiration
a.OwnerID = sa.OwnerID
a.OwnerPublicKey = sa.OwnerPublicKey
a.RepairerID = t.ClientID // blobber node id
a.TotalSize = sa.Size
a.UsedSize = sa.UsedSize
a.Finalized = sa.Finalized
a.PayerID = t.ClientID
a.TimeUnit = sa.TimeUnit

// related terms
Expand Down
98 changes: 54 additions & 44 deletions code/go/0chain.net/blobbercore/blobbergrpc/blobber.pb.go

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

23 changes: 12 additions & 11 deletions code/go/0chain.net/blobbercore/blobbergrpc/proto/blobber.proto
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,18 @@ message Allocation {
int64 UsedSize = 4;
string OwnerID = 5;
string OwnerPublicKey = 6;
int64 Expiration = 7;
string AllocationRoot = 8;
int64 BlobberSize = 9;
int64 BlobberSizeUsed = 10;
string LatestRedeemedWM = 11;
bool IsRedeemRequired = 12;
int64 TimeUnit = 13;
bool CleanedUp = 14;
bool Finalized = 15;
repeated Term Terms = 16;
string PayerID = 17;
string RepairerID = 7;
string PayerID = 8;
int64 Expiration = 9;
string AllocationRoot = 10;
int64 BlobberSize = 11;
int64 BlobberSizeUsed = 12;
string LatestRedeemedWM = 13;
bool IsRedeemRequired = 14;
int64 TimeUnit = 15;
bool CleanedUp = 16;
bool Finalized = 17;
repeated Term Terms = 18;
}

message Term {
Expand Down
3 changes: 2 additions & 1 deletion code/go/0chain.net/blobbercore/handler/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ func AllocationToGRPCAllocation(alloc *allocation.Allocation) *blobbergrpc.Alloc
UsedSize: alloc.UsedSize,
OwnerID: alloc.OwnerID,
OwnerPublicKey: alloc.OwnerPublicKey,
RepairerID: alloc.RepairerID,
PayerID: alloc.PayerID,
Expiration: int64(alloc.Expiration),
AllocationRoot: alloc.AllocationRoot,
BlobberSize: alloc.BlobberSize,
Expand All @@ -35,7 +37,6 @@ func AllocationToGRPCAllocation(alloc *allocation.Allocation) *blobbergrpc.Alloc
CleanedUp: alloc.CleanedUp,
Finalized: alloc.Finalized,
Terms: terms,
PayerID: alloc.PayerID,
}
}

Expand Down
Loading