chain33

package module
v0.0.0-...-1c4572a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2018 License: BSD-2-Clause Imports: 3 Imported by: 0

README

API Reference pipeline status Go Report Card Windows Build Status codecov

Chain33 区块链开发框架

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

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

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

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

Building from source

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

编译:

git clone https://github.com/33cn/chain33.git $GOPATH/src/github.com/33cn/chain33
cd $GOPATH/src/github.com/33cn/chain33
make

测试:

$ make test

运行

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

$ chain33 -f chain33.toml

使用chain33 开发插件注意点

  • 不可以使用 master 分支,要使用 发布分支
  • vendor 依赖不要重建,未来我们可能会支持自己下载vendor目录,但是目前,我们不支持这样做。

贡献代码

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

细节过程
  • 如果有什么想法,建立 issues, 和我们来讨论。
  • 首先点击 右上角的 fork 图标, 把chain33 fork 到自己的分支 比如我的是 vipwzw/chain33
  • git clone https://github.com/vipwzw/chain33.git $GOPATH/src/github.com/33cn/chain33
注意:这里要 clone 到 $GOPATH/src/github.com/33cn/chain33, 否则go 包路径会找不到
  • 添加 33cn/chain33 远端分支: git remote add upstream https://github.com/33cn/chain33.git 我已经把这个加入了 Makefile 可以直接 运行 make addupstream

  • 保持 33cn/chain33vipwzw/chain33 master 分支的同步,可以直接跑 make sync , 或者执行下面的命令

git fetch upstream
git checkout master
git merge upstream/master
注意:不要去修改 master 分支,这样,master 分支永远和upstream/master 保持同步
  • 从最新的33cn/chain33代码建立分支开始开发
git fetch upstream
git checkout master
git merge upstream/master
git branch -a "fixbug_ci"
  • 开发完成后, push 到 vipwzw/chain33
git fetch upstream
git checkout master
git merge upstream/master
git checkout fixbug_ci
git merge master
git push origin fixbug_ci

然后在界面上进行pull request

简化流程
准备阶段
  • 首先点击 右上角的 fork 图标, 把chain33 fork 到自己的分支 比如我的是 vipwzw/chain33
  • git clone https://github.com/vipwzw/chain33.git $GOPATH/src/github.com/33cn/chain33
注意:这里要 clone 到 $GOPATH/src/github.com/33cn/chain33, 否则go 包路径会找不到
make addupstream
开始开发: 这个分支名称自己设置
make branch b=mydevbranchname
开发完成: push
make push b=mydevbranchname m="这个提交的信息"

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

License

BSD 2-Clause License

Copyright (c) 2018, 33.cn
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, 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.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Documentation

Overview

chain33 是由复杂美科技有限公司开发的区块链链框架

1. 高度可定制

2. 丰富的插件库

3. 创新的 合约 调用和组合方式

Directories

Path Synopsis
Package account 实现chain33 区块链资产操作
Package account 实现chain33 区块链资产操作
实现区块链模块,包含区块链存储
实现区块链模块,包含区块链存储
Package client 系统接口客户端: 封装 Queue Event
Package client 系统接口客户端: 封装 Queue Event
cmd
cli
miner_accounts/accounts
Package accounts is a generated protocol buffer package.
Package accounts is a generated protocol buffer package.
crypto/sha3
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
db
ed25519
Package ed25519 implements the Ed25519 signature algorithm.
Package ed25519 implements the Ed25519 signature algorithm.
ed25519/edwards25519
Package edwards25519 implements operations in GF(2**255-19) and on an Edwards curve that is isomorphic to curve25519.
Package edwards25519 implements operations in GF(2**255-19) and on an Edwards curve that is isomorphic to curve25519.
log
log/log15
Package log15 provides an opinionated, simple toolkit for best-practice logging that is both human and machine readable.
Package log15 provides an opinionated, simple toolkit for best-practice logging that is both human and machine readable.
pubsub
Package pubsub implements a simple multi-topic pub-sub library.
Package pubsub implements a simple multi-topic pub-sub library.
p2p
nat
Package nat provides access to common network port mapping protocols.
Package nat provides access to common network port mapping protocols.
rpc
jsonpb
Package jsonpb provides marshaling and unmarshaling between protocol buffers and JSON.
Package jsonpb provides marshaling and unmarshaling between protocol buffers and JSON.
cli
bipwallet/transformer/btcbase
转换基于比特币地址规则的币种 使用此规则的币种有:BTC、BCH、LTC、ZEC、USDT、 BTY 对各个币种进行注册
转换基于比特币地址规则的币种 使用此规则的币种有:BTC、BCH、LTC、ZEC、USDT、 BTY 对各个币种进行注册

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL