Skip to content

Commit

Permalink
temp add
Browse files Browse the repository at this point in the history
  • Loading branch information
qujihan committed Oct 6, 2024
1 parent 4adbc68 commit 7261ada
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
15 changes: 0 additions & 15 deletions src/chapter3.typ
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@
#let path-prefix = figure-root-path + "src/pics/"

= 共识算法Raft
#code(
"tree src/raft",
"Raft算法",
```zsh
src/raft
├── log.rs
├── message.rs
├── mod.rs
├── node.rs
├── state.rs
└── testscripts
└── ...
```,
)

#include "chapter3/intro.typ"
#include "chapter3/message.typ"
#include "chapter3/node.typ"
Expand Down
14 changes: 14 additions & 0 deletions src/chapter3/intro.typ
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
#let path-prefix = figure-root-path + "src/pics/"

== Raft介绍
#code(
"tree src/raft",
"Raft算法",
```zsh
src/raft
├── log.rs # 定义了Raft中的Log
├── message.rs # 定义了Raft中Node之间交互的信息
├── mod.rs
├── node.rs # 定义了Node(Leader, Follower, Candidate)以及其行为
├── state.rs # 定义了Raft中的状态机
└── testscripts
└── ...
```,
)

Raft共识算法是一种分布式一致性算法,它的设计目标是提供一种易于理解的一致性算法。Raft算法分为三个部分:领导选举、日志复制和安全性。具体的实现可以参考Raft论文#footnote("Raft 论文"+"https://raft.github.io/raft.pdf") #footnote("Raft 作者的博士论文: https://web.stanford.edu/~ouster/cgi-bin/papers/OngaroPhD.pdf") #footnote("Raft 官网: https://raft.github.io")的实现。

Expand Down
2 changes: 1 addition & 1 deletion typst-book-template

0 comments on commit 7261ada

Please sign in to comment.