github.com/turingchain2020/turingchain@v1.1.21/README.md (about)

     1  [![API Reference](
     2  https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667
     3  )](https://godoc.org/github.com/turingchain2020/turingchain)
     4  [![pipeline status](https://api.travis-ci.org/turingchain2020/turingchain.svg?branch=master)](https://travis-ci.org/turingchain2020/turingchain/)
     5  [![Go Report Card](https://goreportcard.com/badge/github.com/turingchain2020/turingchain)](https://goreportcard.com/report/github.com/turingchain2020/turingchain)
     6   [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/turingchain2020/turingchain?svg=true&branch=master&passingText=Windows%20-%20OK&failingText=Windows%20-%20failed&pendingText=Windows%20-%20pending)](https://ci.appveyor.com/project/turingchain2020/turingchain)
     7  [![codecov](https://codecov.io/gh/turingchain2020/turingchain/branch/master/graph/badge.svg)](https://codecov.io/gh/turingchain2020/turingchain) [![Join the chat at https://gitter.im/turingchain2020/Lobby](https://badges.gitter.im/turingchain2020/Lobby.svg)](https://gitter.im/turingchain2020/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
     8  
     9  # Turingchain 区块链开发框架(为了适合go module 的版本号标准 最新版本号改为: 1.65.0)
    10  
    11  高度模块化, 遵循 KISS原则的区块链开发框架
    12  
    13  官方网站 和 文档: https://chain.__officeSite__
    14  
    15  官方插件库: https://github.com/turingchain2020/plugin
    16  
    17  典型案例: https://github.com/turingchaincoin/turingchaincoin
    18  
    19  turingchain背后故事: [turingchain诞生记](https://mp.weixin.qq.com/s/9g5ZFDKJi9uzR_NFxfeuAA)
    20  
    21  视频教程: [视频教程](https://chain.__officeSite__/document/289)
    22  
    23  # 感谢
    24  
    25  [腾讯玄武安全实验室](https://github.com/turingchain2020/turingchain/issues?utf8=%E2%9C%93&q=label%3A%E8%85%BE%E8%AE%AF%E7%8E%84%E6%AD%A6%E5%AE%9E%E9%AA%8C%E5%AE%A4)
    26  
    27  # bug 奖励
    28  
    29  我们会对bug 评价4个等级(不会奖励人民币,等值虚拟资产)。
    30  只有影响现有在线运行系统的,并且会产生严重分叉等行为的,才会评价为 L3
    31  
    32  ```
    33  L0 1000
    34  L1 3000
    35  L2 10000
    36  L3 20000
    37  ```
    38  
    39  ## Building from source
    40  
    41  环境要求: Go (version 1.13 or later)
    42  
    43  编译:
    44  
    45  ```shell
    46  git clone https://github.com/turingchain2020/turingchain.git $GOPATH/src/github.com/turingchain2020/turingchain
    47  cd $GOPATH/src/github.com/turingchain2020/turingchain
    48  //国内用户需要导入一下代理
    49  export GOPROXY=https://mirrors.aliyun.com/goproxy
    50  make
    51  ```
    52  
    53  ```
    54   注意:国内用户需要加一下阿里云代理,用于获取依赖包, mod功能已经在Makefile默认开启了
    55  ```
    56  
    57  测试:
    58  
    59  ```shell
    60  $ make test
    61  ```
    62  
    63  ## 运行
    64  
    65  通过这个命令可以运行一个单节点到环境,可以用于开发测试
    66  
    67  ```shell
    68  $ turingchain -f turingchain.toml
    69  ```
    70  
    71  ## 使用turingchain 开发插件注意点
    72  
    73  * 不可以使用 master 分支,要使用 发布分支
    74  
    75  ## 贡献代码
    76  
    77  我们先说一下代码贡献的细节流程,这些流程可以不看,用户可以直接看我们贡献代码简化流程
    78  
    79  ### 细节过程
    80  
    81  * 如果有什么想法,建立 issues, 和我们来讨论。
    82  * 首先点击 右上角的 fork 图标, 把turingchain fork 到自己的分支 比如我的是 vipwzw/turingchain
    83  * `git clone https://github.com/vipwzw/turingchain.git $GOPATH/src/github.com/turingchain2020/turingchain`
    84  
    85  ```
    86  注意:这里要 clone 到 $GOPATH/src/github.com/turingchain2020/turingchain, 否则go 包路径会找不到
    87  ```
    88  
    89  * 添加 `turingchain2020/turingchain` 远端分支: `git remote add upstream https://github.com/turingchain2020/turingchain.git`  我已经把这个加入了 Makefile 可以直接 运行 `make addupstream` 
    90  
    91  * 保持 `turingchain2020/turingchain` 和 `vipwzw/turingchain` master 分支的同步,可以直接跑 `make sync` , 或者执行下面的命令
    92  
    93  ```
    94  git fetch upstream
    95  git checkout master
    96  git merge upstream/master
    97  ```
    98  ```
    99  注意:不要去修改 master 分支,这样,master 分支永远和upstream/master 保持同步
   100  ```
   101  
   102  * 从最新的turingchain2020/turingchain代码建立分支开始开发
   103  
   104  ```
   105  git fetch upstream
   106  git checkout master
   107  git merge upstream/master
   108  git branch -b "fixbug_ci"
   109  ```
   110  
   111  * 开发完成后, push 到 `vipwzw/turingchain`
   112  
   113  ```
   114  git fetch upstream
   115  git checkout master
   116  git merge upstream/master
   117  git checkout fixbug_ci
   118  git merge master
   119  git push origin fixbug_ci
   120  ```
   121  
   122  然后在界面上进行pull request
   123  
   124  ### 简化流程
   125  
   126  #### 准备阶段
   127  
   128  * 首先点击 右上角的 fork 图标, 把turingchain fork 到自己的分支 比如我的是 vipwzw/turingchain
   129  * `git clone https://github.com/vipwzw/turingchain.git $GOPATH/src/github.com/turingchain2020/turingchain`
   130  
   131  ```
   132  注意:这里要 clone 到 $GOPATH/src/github.com/turingchain2020/turingchain, 否则go 包路径会找不到
   133  ```
   134  
   135  ```
   136  make addupstream
   137  ```
   138  
   139  #### 开始开发: 这个分支名称自己设置
   140  
   141  ```
   142  make branch b=mydevbranchname
   143  ```
   144  
   145  #### 开发完成: push 
   146  
   147  ```
   148  make push b=mydevbranchname m="这个提交的信息"
   149  ```
   150  
   151  如果m不设置,那么不会执行 git commit 的命令
   152  
   153  ## 修改别人的pull requset
   154  
   155  比如我要修改 name=libangzhu branch turingchain-p2p-listenPort 的pr
   156  
   157  ##### step1: 拉取要修改的分支
   158  
   159  ```
   160  make pull name=libangzhu b=turingchain-p2p-listenPort
   161  ```
   162  
   163  然后修改代码,修改完成后,并且在本地commit
   164  
   165  ###### step2: push已经修改好的内容
   166  
   167  ```
   168  make pullpush name=libangzhu b=turingchain-p2p-listenPort
   169  ```
   170  
   171  ## License
   172  
   173  ```
   174  BSD 3-Clause License
   175  
   176  Copyright (c) 2018, __officeSite__
   177  All rights reserved.
   178  
   179  Redistribution and use in source and binary forms, with or without
   180  modification, are permitted provided that the following conditions are met:
   181  
   182  * Redistributions of source code must retain the above copyright notice, this
   183    list of conditions and the following disclaimer.
   184  
   185  * Redistributions in binary form must reproduce the above copyright notice,
   186    this list of conditions and the following disclaimer in the documentation
   187    and/or other materials provided with the distribution.
   188  
   189  * Neither the name of the copyright holder nor the names of its
   190    contributors may be used to endorse or promote products derived from
   191    this software without specific prior written permission.
   192  
   193  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   194  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   195  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   196  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
   197  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   198  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   199  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   200  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   201  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   202  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   203  ```