Skip to content

Commit c015cbc

Browse files
authored
Merge pull request #205 from meshplus/feat/support_bitxhub2.8
Feat/support bitxhub2.8
2 parents 6780814 + 32378c7 commit c015cbc

75 files changed

Lines changed: 3621 additions & 764 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ test-coverage:
4242

4343
## make install: Go install the project
4444
install:
45-
cd cmd/goduck && packr
45+
cd cmd/goduck && packr2
4646
$(GO) install -ldflags '${GO_LDFLAGS}' ./cmd/${APP_NAME}
4747
@printf "${GREEN}Build ${APP_NAME} successfully!${NC}\n"
4848

4949
build:
50-
cd cmd/goduck && packr
50+
cd cmd/goduck && packr2
5151
@mkdir -p bin
5252
$(GO) build -ldflags '${GO_LDFLAGS}' ./cmd/${APP_NAME}
5353
@mv ./${APP_NAME} bin

cmd/goduck/bitxhub.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ var bxhConfigMap = map[string]string{
3232
"v1.11.1": "v1.11.0",
3333
"v1.11.3": "v1.11.3",
3434
"v1.23.0": "v1.23.0",
35+
"v2.8.0": "v2.8.0",
3536
}
3637

3738
func bitxhubCMD() *cli.Command {
@@ -58,7 +59,7 @@ func bitxhubCMD() *cli.Command {
5859
},
5960
&cli.StringFlag{
6061
Aliases: []string{"version", "v"},
61-
Value: "v1.23.0",
62+
Value: "v2.8.0",
6263
Usage: "BitXHub version",
6364
},
6465
},
@@ -88,7 +89,7 @@ func bitxhubCMD() *cli.Command {
8889
},
8990
&cli.StringFlag{
9091
Aliases: []string{"version", "v"},
91-
Value: "v1.23.0",
92+
Value: "v2.8.0",
9293
Usage: "BitXHub version",
9394
},
9495
},

cmd/goduck/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"github.com/codeskyblue/go-sh"
2525
"github.com/fatih/color"
2626
"github.com/gobuffalo/packd"
27-
"github.com/gobuffalo/packr"
27+
"github.com/gobuffalo/packr/v2"
2828
"github.com/meshplus/bitxhub-kit/crypto"
2929
"github.com/meshplus/bitxhub-kit/crypto/asym"
3030
"github.com/meshplus/bitxhub-kit/fileutil"
@@ -1237,7 +1237,7 @@ func renderConfigFiles(dstDir, srcDir string, filesToRender []string, data inter
12371237
filesM[file] = struct{}{}
12381238
}
12391239

1240-
box := packr.NewBox(filepath.Join(PackPath, srcDir))
1240+
box := packr.New("box", filepath.Join(PackPath, srcDir))
12411241
if err := box.Walk(func(s string, file packd.File) error {
12421242
p := filepath.Join(dstDir, s)
12431243
dir := filepath.Dir(p)
@@ -1273,7 +1273,7 @@ func renderConfigFiles(dstDir, srcDir string, filesToRender []string, data inter
12731273
}
12741274

12751275
func renderConfigFile(dstDir string, srcFiles []string, data interface{}) error {
1276-
box := packr.NewBox(PackPath)
1276+
box := packr.New("box", PackPath)
12771277

12781278
for _, srcFile := range srcFiles {
12791279
fileStr, err := box.FindString(srcFile)

cmd/goduck/ether.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ var EthConfigMap = map[string]string{
2323
"v1.11.1": "1.3.0",
2424
"v1.11.3": "1.3.0",
2525
"v1.23.0": "1.2.0",
26+
"v2.8.0": "1.2.0",
2627
}
2728

2829
func etherCMD() *cli.Command {
@@ -62,7 +63,7 @@ func etherCMD() *cli.Command {
6263
Name: "bxh-version",
6364
Usage: "specify bitxhub version (Only for docker. The launched ethereum private chain in docker mod has already deployed the cross-chain contract required for the corresponding version of BitXHub)",
6465
Required: false,
65-
Value: "v1.23.0",
66+
Value: "v2.8.0",
6667
},
6768
},
6869
Action: startEther,

cmd/goduck/ethereum/contract.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ var ContractCMD = &cli.Command{
135135
&cli.StringFlag{
136136
Name: "version",
137137
Usage: "specify bitxhub version",
138-
Value: "v1.6.5",
138+
Value: "v2.8.0",
139139
Required: false,
140140
},
141141
},
@@ -154,6 +154,9 @@ func downloadContract(ctx *cli.Context) error {
154154
if !fileutil.Exist(repoPath) {
155155
return fmt.Errorf("please `goduck init` first")
156156
}
157+
if version == "v2.8.0" {
158+
ethContract = append(ethContract, "broker_data")
159+
}
157160

158161
for _, contract := range ethContract {
159162
path := filepath.Join(repoPath, types.ChainTypeEther, "contract", version, fmt.Sprintf("%s.sol", contract))

cmd/goduck/fabric/contract.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var ContractCMD = &cli.Command{
3333
&cli.StringFlag{
3434
Name: "bxh-version",
3535
Usage: "specify bitxhub version. If not set code-path, the code will be downloaded based on this version",
36-
Value: "v1.6.5",
36+
Value: "v2.8.0",
3737
Required: false,
3838
},
3939
&cli.StringFlag{

cmd/goduck/init.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"github.com/coreos/etcd/pkg/fileutil"
1414
"github.com/fatih/color"
1515
"github.com/gobuffalo/packd"
16-
"github.com/gobuffalo/packr"
16+
"github.com/gobuffalo/packr/v2"
1717
"github.com/meshplus/goduck/internal/repo"
1818
"github.com/meshplus/goduck/internal/types"
1919
"github.com/urfave/cli/v2"
@@ -50,8 +50,8 @@ func Initialize(ctx *cli.Context) error {
5050
return nil
5151
}
5252
}
53-
scriptBox := packr.NewBox(ScriptsPath)
54-
configBox := packr.NewBox(ConfigPath)
53+
scriptBox := packr.New("scriptBox", ScriptsPath)
54+
configBox := packr.New("configBox", ConfigPath)
5555

5656
var walkFn = func(s string, file packd.File) error {
5757
p := filepath.Join(repoRoot, s)

cmd/goduck/pier.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var pierConfigMap = map[string]string{
2727
"v1.11.1": "v1.11.0",
2828
"v1.11.3": "v1.11.3",
2929
"v1.23.0": "v1.23.0",
30+
"v2.8.0": "v2.8.0",
3031
}
3132

3233
var pierCMD = &cli.Command{
@@ -57,7 +58,7 @@ var pierCMD = &cli.Command{
5758
},
5859
&cli.StringFlag{
5960
Aliases: []string{"version", "v"},
60-
Value: "v1.23.0",
61+
Value: "v2.8.0",
6162
Usage: "Pier version",
6263
},
6364
},
@@ -92,7 +93,7 @@ var pierCMD = &cli.Command{
9293
},
9394
&cli.StringFlag{
9495
Aliases: []string{"version", "v"},
95-
Value: "v1.23.0",
96+
Value: "v2.8.0",
9697
Usage: "Pier version",
9798
},
9899
},
@@ -131,7 +132,7 @@ var pierCMD = &cli.Command{
131132
},
132133
&cli.StringFlag{
133134
Aliases: []string{"version", "v"},
134-
Value: "v1.23.0",
135+
Value: "v2.8.0",
135136
Usage: "Pier version",
136137
},
137138
},

cmd/goduck/playground.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func playgroundCMD() *cli.Command {
3333
&cli.StringFlag{
3434
Aliases: []string{"version", "v"},
3535
Usage: "version of the demo interchain system",
36-
Value: "v1.23.0",
36+
Value: "v2.8.0",
3737
Required: false,
3838
},
3939
},
@@ -56,7 +56,7 @@ func playgroundCMD() *cli.Command {
5656
&cli.StringFlag{
5757
Aliases: []string{"version", "v"},
5858
Usage: "version of the demo interchain system",
59-
Value: "v1.23.0",
59+
Value: "v2.8.0",
6060
Required: false,
6161
},
6262
},

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ require (
1818
github.com/docker/go-units v0.4.0 // indirect
1919
github.com/ethereum/go-ethereum v1.10.6
2020
github.com/fatih/color v1.7.0
21-
github.com/gobuffalo/packd v1.0.0
22-
github.com/gobuffalo/packr v1.30.1
21+
github.com/gobuffalo/packd v1.0.1
22+
github.com/gobuffalo/packr/v2 v2.8.3
2323
github.com/gorilla/mux v1.8.0 // indirect
2424
github.com/hyperledger/fabric v2.0.1+incompatible
2525
github.com/hyperledger/fabric-sdk-go v1.0.0-beta1
@@ -31,11 +31,11 @@ require (
3131
github.com/mitchellh/go-homedir v1.1.0
3232
github.com/opencontainers/go-digest v1.0.0 // indirect
3333
github.com/opencontainers/image-spec v1.0.1 // indirect
34-
github.com/pelletier/go-toml v1.8.0
34+
github.com/pelletier/go-toml v1.9.3
3535
github.com/pkg/errors v0.9.1
3636
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible
37-
github.com/sirupsen/logrus v1.6.0
38-
github.com/spf13/viper v1.6.1
37+
github.com/sirupsen/logrus v1.8.1
38+
github.com/spf13/viper v1.8.1
3939
github.com/stretchr/testify v1.7.0
4040
github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31
4141
github.com/urfave/cli/v2 v2.3.0

0 commit comments

Comments
 (0)