Skip to content

Commit 88e40a4

Browse files
authored
Merge pull request #1451 from 0chain/refactor/deployment
Refactor/deployment
2 parents 6f13281 + 710a880 commit 88e40a4

File tree

10 files changed

+406
-341
lines changed

10 files changed

+406
-341
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ jobs:
3535
- name: Build Base
3636
run: ./docker.local/bin/build.base.sh
3737

38-
- name: Check swagger generation
39-
run: docker.local/bin/test.swagger.sh
40-
4138
- name: Golangci-lint
4239
uses: golangci/golangci-lint-action@v3
4340
with:

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"github.com/0chain/blobber/code/go/0chain.net/core/common"
45
"github.com/0chain/blobber/code/go/0chain.net/core/logging"
56
"github.com/0chain/blobber/code/go/0chain.net/core/node"
67
)
@@ -43,10 +44,14 @@ func main() {
4344
// when enabled "// +build integration_tests", this sets blobber for conductor tests.
4445
prepareBlobber(node.Self.ID)
4546

46-
if err := registerOnChain(); err != nil {
47-
logging.Logger.Error("Error register on blockchain" + err.Error())
48-
panic(err)
49-
}
47+
go func() {
48+
if err := registerOnChain(); err != nil {
49+
logging.Logger.Error("Error register on blockchain" + err.Error())
50+
panic(err)
51+
}
52+
53+
common.SetBlobberRegistered(true)
54+
}()
5055

5156
if err := setStorageScConfigFromChain(); err != nil {
5257
logging.Logger.Error("Error setStorageScConfigFromChain" + err.Error())

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@ package main
22

33
import (
44
"fmt"
5-
"time"
6-
75
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/config"
86
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/filestore"
97
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/handler"
108
"github.com/0chain/blobber/code/go/0chain.net/core/chain"
119
"github.com/0chain/blobber/code/go/0chain.net/core/common"
1210
handleCommon "github.com/0chain/blobber/code/go/0chain.net/core/common/handler"
11+
"github.com/0chain/blobber/code/go/0chain.net/core/logging"
1312
"github.com/0chain/blobber/code/go/0chain.net/core/node"
1413
"github.com/0chain/gosdk/zboxcore/sdk"
1514
"github.com/0chain/gosdk/zcncore"
15+
"go.uber.org/zap"
16+
"time"
1617
)
1718

1819
func registerOnChain() error {
@@ -31,8 +32,9 @@ func registerOnChain() error {
3132
return err
3233
}
3334

34-
// setup blobber (add or update) on the blockchain (multiple attempts)
35-
for i := 1; i <= 10; i++ {
35+
// setup blobber (add) on the blockchain (multiple attempts)
36+
i := 1
37+
for {
3638
if i == 1 {
3739
fmt.Printf("\r + connect to sharders:")
3840
} else {
@@ -50,6 +52,9 @@ func registerOnChain() error {
5052
err = handler.RegisterBlobber(common.GetRootContext())
5153
if err == nil {
5254
break
55+
} else {
56+
i++
57+
logging.Logger.Error("add_blobber_error", zap.Error(err))
5358
}
5459
}
5560

0 commit comments

Comments
 (0)