Skip to content

Commit

Permalink
fix somes
Browse files Browse the repository at this point in the history
  • Loading branch information
wchh committed Dec 24, 2023
1 parent 83caf68 commit 3c905e5
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
[![pipeline status](https://github.com/assetcloud/chain/actions/workflows/build.yml/badge.svg)](https://github.com/assetcloud/chain/actions/)
[![Go Report Card](https://goreportcard.com/badge/github.com/assetcloud/chain)](https://goreportcard.com/report/github.com/assetcloud/chain)
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/assetcloud/chain?svg=true&branch=master&passingText=Windows%20-%20OK&failingText=Windows%20-%20failed&pendingText=Windows%20-%20pending)](https://ci.appveyor.com/project/assetcloud/chain)
[![codecov](https://codecov.io/gh/assetcloud/chain/branch/master/graph/badge.svg)](https://codecov.io/gh/assetcloud/chain) [![Join the chat at https://gitter.im/33cn/Lobby](https://badges.gitter.im/33cn/Lobby.svg)](https://gitter.im/33cn/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![codecov](https://codecov.io/gh/assetcloud/chain/branch/master/graph/badge.svg)](https://codecov.io/gh/assetcloud/chain) [![Join the chat at https://gitter.im/assetcloud/Lobby](https://badges.gitter.im/assetcloud/Lobby.svg)](https://gitter.im/assetcloud/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

# Chain 区块链开发框架

高度模块化, 遵循 KISS 原则的区块链开发框架

官方网站 和 文档: https://chain.33.cn

官方插件库: https://github.com/33cn/plugin
官方插件库: https://github.com/assetcloud/plugin

典型案例: https://github.com/bityuan/bityuan

Expand Down Expand Up @@ -98,7 +98,7 @@ git merge upstream/master
注意:不要去修改 master 分支,这样,master 分支永远和upstream/master 保持同步
```

- 从最新的 33cn/chain 代码建立分支开始开发
- 从最新的 assetcloud/chain 代码建立分支开始开发

```
git fetch upstream
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ os: Visual Studio 2019

build: off

clone_folder: c:\gopath\src\github.com\33cn\chain
clone_folder: c:\gopath\src\github.com\assetcloud\chain

environment:
GOPATH: c:\gopath
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/commands/gendapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func addGenDappFlag(cmd *cobra.Command) {
cmd.MarkFlagRequired("name")
cmd.Flags().StringP("proto", "p", "", "dapp protobuf file path")
cmd.MarkFlagRequired("proto")
cmd.Flags().StringP("output", "o", "", "go package for output (default github.com/33cn/plugin/plugin/dapp/)")
cmd.Flags().StringP("output", "o", "", "go package for output (default github.com/assetcloud/plugin/plugin/dapp/)")

}

Expand Down
12 changes: 6 additions & 6 deletions cmd/tools/doc/gencalculator.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ service calculator {
//本例默认将calculator生成至官方plugin项目dapp目录下
$ cd $GOPATH/src/github.com/assetcloud/chain/cmd/tools && go build -o tool
$ ./tool gendapp -n calculator -p doc/calculator.proto
$ cd $GOPATH/src/github.com/33cn/plugin/plugin/dapp/calculator && ls
$ cd $GOPATH/src/github.com/assetcloud/plugin/plugin/dapp/calculator && ls
```

##### 生成 pb.go 文件
Expand All @@ -97,7 +97,7 @@ pb.go 文件基于 protobuf 提供的 proto-gen-go 插件生成,这里 protobu

```
//进入生成合约的目录
$ cd $GOPATH/src/github.com/33cn/plugin/plugin/dapp/calculator
$ cd $GOPATH/src/github.com/assetcloud/plugin/plugin/dapp/calculator
//执行脚本生成calculator.pb.go
$ cd proto && make
```
Expand Down Expand Up @@ -366,7 +366,7 @@ import (
"github.com/spf13/cobra"

rpctypes "github.com/assetcloud/chain/rpc/types"
calculatortypes "github.com/33cn/plugin/plugin/dapp/calculator/types"
calculatortypes "github.com/assetcloud/plugin/plugin/dapp/calculator/types"
)
```

Expand Down Expand Up @@ -476,7 +476,7 @@ func Cmd() *cobra.Command {
```go
import (
_ "github.com/33cn/plugin/plugin/dapp/calculator" //init calculator
_ "github.com/assetcloud/plugin/plugin/dapp/calculator" //init calculator
)
```

Expand All @@ -485,7 +485,7 @@ import (
> 直接通过官方 makefile 文件
```
$ cd $GOPATH/src/github.com/33cn/plugin && make
$ cd $GOPATH/src/github.com/assetcloud/plugin && make
```

#### 测试
Expand Down Expand Up @@ -517,4 +517,4 @@ curl -kd '{"method":"calculator.QueryCalcCount", "params":[{"action":"Add"}]}' h

##### 其他例子

官方 [plugin 项目](https://github.com/33cn/plugin) 提供了丰富的插件,可以参考学习
官方 [plugin 项目](https://github.com/assetcloud/plugin) 提供了丰富的插件,可以参考学习
4 changes: 2 additions & 2 deletions cmd/tools/doc/gendapp.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ Usage:
Flags:
-h, --help help for gendapp
-n, --name string dapp name
-o, --output string go package for output (default github.com/33cn/plugin/plugin/dapp/)
-o, --output string go package for output (default github.com/assetcloud/plugin/plugin/dapp/)
-p, --proto string dapp protobuf file path
```

- -n 指定合约名字,不能含有空格和特殊字符
- -p 指定合约的 protobuf 文件
- -o 生成代码的输出目录路径,此处是 go 包路径,及相对于$GOPATH/src的路径,
默认为官方项目路径($GOPATH/src/github.com/33cn/plugin/plugin/dapp/)
默认为官方项目路径($GOPATH/src/github.com/assetcloud/plugin/plugin/dapp/)

举例:

Expand Down
18 changes: 9 additions & 9 deletions cmd/tools/strategy/create_plugin_file_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ update:
cp -Rf vendor/${CHAIN}/vendor/* vendor/
rm -rf vendor/${CHAIN}/vendor
govendor init
go build -i -o tool github.com/33cn/plugin/vendor/github.com/assetcloud/chain/cmd/tools
go build -i -o tool github.com/assetcloud/plugin/vendor/github.com/assetcloud/chain/cmd/tools
./tool import --path "plugin" --packname "${PROJECTPATH}/plugin" --conf "plugin/plugin.toml"
updatevendor:
Expand Down Expand Up @@ -313,28 +313,28 @@ go:
CpftPluginToml = `
# type字段仅支持 consensus dapp store mempool
[dapp-ticket]
gitrepo = "github.com/33cn/plugin/plugin/dapp/ticket"
gitrepo = "github.com/assetcloud/plugin/plugin/dapp/ticket"
[consensus-ticket]
gitrepo = "github.com/33cn/plugin/plugin/consensus/ticket"
gitrepo = "github.com/assetcloud/plugin/plugin/consensus/ticket"
[dapp-retrieve]
gitrepo = "github.com/33cn/plugin/plugin/dapp/retrieve"
gitrepo = "github.com/assetcloud/plugin/plugin/dapp/retrieve"
[dapp-hashlock]
gitrepo = "github.com/33cn/plugin/plugin/dapp/hashlock"
gitrepo = "github.com/assetcloud/plugin/plugin/dapp/hashlock"
[dapp-token]
gitrepo = "github.com/33cn/plugin/plugin/dapp/token"
gitrepo = "github.com/assetcloud/plugin/plugin/dapp/token"
[dapp-trade]
gitrepo = "github.com/33cn/plugin/plugin/dapp/trade"
gitrepo = "github.com/assetcloud/plugin/plugin/dapp/trade"
[mempool-price]
gitrepo = "github.com/33cn/plugin/plugin/mempool/price"
gitrepo = "github.com/assetcloud/plugin/plugin/mempool/price"
[mempool-score]
gitrepo = "github.com/33cn/plugin/plugin/mempool/score"
gitrepo = "github.com/assetcloud/plugin/plugin/mempool/score"
`
// 项目 cli/main.go 文件模板
CpftCliMain = `package main
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/strategy/createplugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (c *createPluginStrategy) initMember() error {
return errors.New("Can't find GOPATH")
}
c.gopath = gopath
c.outRootPath = filepath.Join(gopath, "/src/github.com/33cn")
c.outRootPath = filepath.Join(gopath, "/src/github.com/assetcloud")
c.projName, _ = c.getParam(types.KeyProjectName)
c.execName, _ = c.getParam(types.KeyExecutorName)
c.className, _ = c.getParam(types.KeyClassName)
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/strategy/gendapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (ad *genDappStrategy) initMember() bool {

// 默认输出到plugin项目的plugin/dapp/目录下
if outDir == "" {
outDir = filepath.Join("github.com", "33cn", "plugin", "plugin", "dapp")
outDir = filepath.Join("github.com", "assetcloud", "plugin", "plugin", "dapp")
}
//兼容win 反斜杠路径
packPath := strings.Replace(filepath.Join(outDir), string(filepath.Separator), "/", -1)
Expand Down
2 changes: 1 addition & 1 deletion system/consensus/solo/solo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
_ "github.com/assetcloud/chain/system/dapp/init"
_ "github.com/assetcloud/chain/system/mempool/init"
_ "github.com/assetcloud/chain/system/store/init"
//_ "github.com/33cn/plugin/plugin/store/kvmvcc"
//_ "github.com/assetcloud/plugin/plugin/store/kvmvcc"
)

// 执行: go test -cover
Expand Down

0 comments on commit 3c905e5

Please sign in to comment.