Skip to content

Commit 3c3709f

Browse files
author
Jayash
committed
Fix
1 parent 15aef61 commit 3c3709f

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

code/go/0chain.net/blobber/settings.go

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import (
44
"context"
55
"encoding/json"
66
"errors"
7+
"github.com/0chain/gosdk/core/transaction"
78
"strconv"
89
"time"
910

1011
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/config"
1112
"github.com/0chain/blobber/code/go/0chain.net/core/logging"
12-
"github.com/0chain/gosdk/zcncore"
1313
)
1414

1515
type storageScCB struct {
@@ -58,20 +58,24 @@ func (ssc *storageScCB) OnInfoAvailable(op int, status int, info string, errStr
5858
}
5959

6060
func setStorageScConfigFromChain() error {
61-
cb := &storageScCB{
62-
done: make(chan struct{}),
61+
conf, err := transaction.GetConfig("storage_sc_config")
62+
if err != nil {
63+
return err
6364
}
64-
err := zcncore.GetStorageSCConfig(cb)
65+
66+
maxChallengeCompletionRoundsString := conf.Fields["max_challenge_completion_rounds"]
67+
maxChallengeCompletionRoundsInt, err := strconv.ParseInt(maxChallengeCompletionRoundsString, 10, 64)
6568
if err != nil {
6669
return err
6770
}
68-
<-cb.done
69-
if cb.err != nil {
71+
maxFileSizeString := conf.Fields["max_file_size"]
72+
maxFileSizeInt64, err := strconv.ParseInt(maxFileSizeString, 10, 64)
73+
if err != nil {
7074
return err
7175
}
7276

73-
config.StorageSCConfig.ChallengeCompletionTime = cb.cct
74-
config.StorageSCConfig.MaxFileSize = cb.mfs
77+
config.StorageSCConfig.ChallengeCompletionTime = maxChallengeCompletionRoundsInt
78+
config.StorageSCConfig.MaxFileSize = maxFileSizeInt64
7579
return nil
7680
}
7781

docker.local/bin/build.base.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ echo "2> download herumi"
2727
[ ! -f ./docker.local/bin/bls.tar.gz ] && wget -O ./docker.local/bin/bls.tar.gz https://github.com/herumi/bls/archive/refs/tags/v1.22.tar.gz
2828

2929
echo "3> docker build"
30-
DOCKER_BUILDKIT=1 docker $DOCKER_BUILD --progress=plain --build-arg GIT_COMMIT=$GIT_COMMIT -f docker.local/base.Dockerfile . -t $DOCKER_IMAGE_BASE --network host
30+
DOCKER_BUILDKIT=0 docker $DOCKER_BUILD --build-arg GIT_COMMIT=$GIT_COMMIT -f docker.local/base.Dockerfile . -t $DOCKER_IMAGE_BASE --network host

docker.local/bin/build.blobber.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ echo ""
3333
# docker.local/bin/test.swagger.sh
3434

3535
echo "2> docker build blobber"
36-
DOCKER_BUILDKIT=1 docker $DOCKER_BUILD --progress=plain --build-arg GIT_COMMIT=$GIT_COMMIT --build-arg DOCKER_IMAGE_BASE=$DOCKER_IMAGE_BASE -f docker.local/blobber.Dockerfile . $DOCKER_IMAGE_BLOBBER --network host
36+
DOCKER_BUILDKIT=0 docker $DOCKER_BUILD --build-arg GIT_COMMIT=$GIT_COMMIT --build-arg DOCKER_IMAGE_BASE=$DOCKER_IMAGE_BASE -f docker.local/blobber.Dockerfile . $DOCKER_IMAGE_BLOBBER --network host

0 commit comments

Comments
 (0)