Skip to content

Commit ea3eeb4

Browse files
committed
fetch storage version from sharders
1 parent ea34bb7 commit ea3eeb4

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

code/go/0chain.net/blobbercore/allocation/protocol.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func FetchAllocationFromEventsDB(ctx context.Context, allocationID string, alloc
111111
a.FileOptions = sa.FileOptions
112112
a.StartTime = sa.StartTime
113113
// Only for testing purpose
114-
a.StorageVersion = 1
114+
a.StorageVersion = uint8(sa.StorageVersion)
115115

116116
m := map[string]interface{}{
117117
"allocation_id": a.ID,

code/go/0chain.net/blobbercore/handler/protocol.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"sync"
88
"time"
99

10+
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/allocation"
1011
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/config"
1112
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/datastore"
1213
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/filestore"
@@ -67,6 +68,7 @@ func getStorageNode() (*transaction.StorageNode, error) {
6768
sn.StakePoolSettings.ServiceCharge = config.Configuration.ServiceCharge
6869

6970
sn.IsEnterprise = config.Configuration.IsEnterprise
71+
sn.StorageVersion = allocation.StorageV2
7072

7173
return sn, nil
7274
}

code/go/0chain.net/core/transaction/entity.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ type StorageNode struct {
7373
PublicKey string `json:"-"`
7474
StakePoolSettings StakePoolSettings `json:"stake_pool_settings"`
7575
IsEnterprise bool `json:"is_enterprise"`
76+
StorageVersion int `json:"storage_version"`
7677
}
7778

7879
type BlobberAllocation struct {
@@ -94,6 +95,7 @@ type StorageAllocation struct {
9495
WritePool uint64 `json:"write_pool"`
9596
FileOptions uint16 `json:"file_options"`
9697
StartTime common.Timestamp `json:"start_time"`
98+
StorageVersion int `json:"storage_version"`
9799

98100
DataShards int64 `json:"data_shards"`
99101
ParityShards int64 `json:"parity_shards"`

0 commit comments

Comments
 (0)