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

网友投稿 1112 2022-10-31

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

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

Chain33 区块链开发框架(为了适合go module 的版本号标准 最新版本号改为: 1.64.0)

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

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

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

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

chain33背后故事: chain33诞生记

视频教程: 视频教程

感谢

腾讯玄武安全实验室

bug 奖励

我们会对bug 评价4个等级(不会奖励人民币,等值虚拟资产)。 只有影响现有在线运行系统的,并且会产生严重分叉等行为的,才会评价为 L3

L0 1000L1 3000L2 10000L3 20000

Building from source

环境要求: Go (version 1.12 or later)

编译:

git clone https://github.com/33cn/chain33.git $GOPATH/src/github.com/33cn/chain33cd $GOPATH/src/github.com/33cn/chain33//国内用户需要导入一下代理export GOPROXY=https://mirrors.aliyun.com/goproxymake

注意:国内用户需要加一下阿里云代理,用于获取依赖包, mod功能已经在Makefile默认开启了

测试:

$ make test

运行

通过这个命令可以运行一个单节点到环境,可以用于开发测试

$ chain33 -f chain33.toml

使用chain33 开发插件注意点

不可以使用 master 分支,要使用 发布分支

贡献代码

我们先说一下代码贡献的细节流程,这些流程可以不看,用户可以直接看我们贡献代码简化流程

细节过程

注意:这里要 clone 到 $GOPATH/src/github.com/33cn/chain33, 否则go 包路径会找不到

添加 33cn/chain33 远端分支: git remote add upstream https://github.com/33cn/chain33.git 我已经把这个加入了 Makefile 可以直接 运行 make addupstream 保持 33cn/chain33 和 vipwzw/chain33 master 分支的同步,可以直接跑 make sync , 或者执行下面的命令

git fetch upstreamgit checkout mastergit merge upstream/master

注意:不要去修改 master 分支,这样,master 分支永远和upstream/master 保持同步

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

git fetch upstreamgit checkout mastergit merge upstream/mastergit branch -b "fixbug_ci"

开发完成后, push 到 vipwzw/chain33

git fetch upstreamgit checkout mastergit merge upstream/mastergit checkout fixbug_cigit merge mastergit push origin fixbug_ci

然后在界面上进行pull request

简化流程

准备阶段

注意:这里要 clone 到 $GOPATH/src/github.com/33cn/chain33, 否则go 包路径会找不到

make addupstream

开始开发: 这个分支名称自己设置

make branch b=mydevbranchname

开发完成: push

make push b=mydevbranchname m="这个提交的信息"

如果m不设置,那么不会执行 git commit 的命令

修改别人的pull requset

比如我要修改 name=libangzhu branch chain33-p2p-listenPort 的pr

step1: 拉取要修改的分支

make pull name=libangzhu b=chain33-p2p-listenPort

然后修改代码,修改完成后,并且在本地commit

step2: push已经修改好的内容

make pullpush name=libangzhu b=chain33-p2p-listenPort

License

BSD 3-Clause LicenseCopyright (c) 2018, 33-All rights reserved.Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions are met:* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.* Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THEIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLEFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ORSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USEOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:【LeetCode 36】有效的数独
下一篇:2021-02-04 | 41. 缺失的第一个正数
相关文章

 发表评论

暂时没有评论,来抢沙发吧~