> For the complete documentation index, see [llms.txt](https://csunny.gitbook.io/etcd/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://csunny.gitbook.io/etcd/introduce/storage/consensus_algorithm.md).

# 共识算法

在上一节我们提到了，为了多节点中多副本数据的一致性，提出来一致性协议，而针对一致性协议又衍生出了很多的一致性算法。 简单来讲，共识算法又可以分为下面几部分:

* 开放网络
  * 区块链公链
    * pow (proof of power)
    * pos (proof of stake)
    * dpos (Delegated proof of stake)
    * ripple
  * 区块链联盟链
    * pbft (Practical Byzantine Fault Tolerance）)
    * dbft(Delegated Byzantine Fault Tolerant))
* 内部网络
  * 分布式一致性系统
    * paxos
    * raft &#x20;

![](https://raw.githubusercontent.com/csunny/etcd-from-arch-to-souce-code/master/_asserts/images/consensus_algorithm.jpg)

当然在这里，我们不打算介绍区块链领域里面的那些共识算法，感兴趣的同学，可以访问我的[github](https://github.com/csunny)来查看，在里面我有解释， 以及具体的代码实现。本书中，我们只介绍raft共识算法。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://csunny.gitbook.io/etcd/introduce/storage/consensus_algorithm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
