Skip to content

Commit

Permalink
sharder keep list (#1266)
Browse files Browse the repository at this point in the history
* changed get round

* updated version
  • Loading branch information
dabasov authored Oct 9, 2023
1 parent f028050 commit 981a4ef
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
7 changes: 3 additions & 4 deletions code/go/0chain.net/blobbercore/challenge/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package challenge

import (
"context"
"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk/zcncore"
"sync"
"time"

"github.com/0chain/gosdk/zcncore"

"github.com/0chain/blobber/code/go/0chain.net/blobbercore/config"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/datastore"
"github.com/0chain/blobber/code/go/0chain.net/core/logging"
Expand Down Expand Up @@ -87,8 +87,7 @@ func getRoundWorker(ctx context.Context) {
case <-ctx.Done():
return
case <-ticker.C:
network := zcncore.GetNetwork()
currentRound, _ := sdk.GetRoundFromSharders(network.Sharders)
currentRound, _ := zcncore.GetRoundFromSharders()

if roundInfo.LastRoundDiff == 0 {
roundInfo.LastRoundDiff = 1000
Expand Down
15 changes: 8 additions & 7 deletions config/0chain_blobber.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ logging:
# 100 GB - 107374182400
capacity: 1073741824 # 1 GB bytes total blobber capacity
read_price: 0.00 # token / GB for reading
write_price: 0.10 # token / GB / time_unit for writing
write_price: 0.025 # token / GB / time_unit for writing
price_in_usd: false
price_worker_in_hours: 12

# update_allocations_interval used to refresh known allocation objects from SC
update_allocations_interval: 1m
update_allocations_interval: 60m

#finalize_allocations_interval used to get and finalize empty allocations
finalize_allocations_interval: 24h
Expand All @@ -28,13 +28,13 @@ max_dirs_files: 50000
# delegate wallet (must be set)
delegate_wallet: '9c693cb14f29917968d6e8c909ebbea3425b4c1bc64b6732cadc2a1869f49be9'
# maximum allowed number of stake holders
num_delegates: 50
num_delegates: 10
# service charge of the blobber
service_charge: 0.10
service_charge: 0
# min submit from miners`
min_submit: 50
min_submit: 10
# min confirmation from sharder
min_confirmation: 50
min_confirmation: 10

block_worker: https://dev.0chain.net/dns

Expand Down Expand Up @@ -113,9 +113,10 @@ storage:
# Similarly for some file_hash "ef935503b66b1ce026610edf18bffd756a79676a8fe317d951965b77a77c0227" with dir_level [2, 2, 1]
# following path is created for the file:
# {alloc_dir}/ef/93/5/503b66b1ce026610edf18bffd756a79676a8fe317d951965b77a77c0227
alloc_dir_level: [2, 1]
alloc_dir_level: [2, 1] #TODO sort it out
file_dir_level: [2, 2, 1]

#TODO remove
disk_update:
# defaults to true. If false, blobber has to manually update blobber's capacity upon increase/decrease
# If blobber has to limit its capacity to 5% of its capacity then it should turn automaci_update to false.
Expand Down
6 changes: 3 additions & 3 deletions config/0chain_validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ version: 1.0
# delegate wallet (must be set)
delegate_wallet: '9c693cb14f29917968d6e8c909ebbea3425b4c1bc64b6732cadc2a1869f49be9'
# maximum allowed number of stake holders
num_delegates: 50
num_delegates: 1
# service charge of related blobber
service_charge: 0.10
service_charge: 1 #TODO CHECK IF 0 WORKS WELL

block_worker: https://dev.0chain.net/dns

Expand All @@ -21,7 +21,7 @@ logging:
console: true # printing log to console is only supported in development mode

healthcheck:
frequency: 60s # send healthcheck to miners every 60 seconds
frequency: 50m # send healthcheck to miners every 60 seconds

server_chain:
id: "0afc093ffb509f059c55478bc1a60351cef7b4e9c008a53a6cc8241ca8617dfe"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/0chain/errors v1.0.3
github.com/0chain/gosdk v1.10.1-0.20230914213608-24f1cb73a7af
github.com/0chain/gosdk v1.10.1-0.20231009155148-2f6b57548450
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/didip/tollbooth/v6 v6.1.2
github.com/go-openapi/runtime v0.26.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565 h1:z+DtCR8mBsjPnEs
github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565/go.mod h1:UyDC8Qyl5z9lGkCnf9RHJPMektnFX8XtCJZHXCCVj8E=
github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM=
github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc=
github.com/0chain/gosdk v1.10.1-0.20230914213608-24f1cb73a7af h1:2qWv26qE0xinmP0h3ujEVdvQkvYdEq5+0o/DxNlsbsQ=
github.com/0chain/gosdk v1.10.1-0.20230914213608-24f1cb73a7af/go.mod h1:/AYFyM6A7rBWk/AoAy/oClmNnpdznvA9d7ND2rhSGJI=
github.com/0chain/gosdk v1.10.1-0.20231009155148-2f6b57548450 h1:v997C2HUfq63KRtid8T0yUPssVnmxsAI8Oah2dVivJo=
github.com/0chain/gosdk v1.10.1-0.20231009155148-2f6b57548450/go.mod h1:6Co9xV9/jeS9Bdi0L3fISOnKbrm0qPTzRtBhIdB/yqY=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
Expand Down

0 comments on commit 981a4ef

Please sign in to comment.