Skip to content

Commit 3c63846

Browse files
ajtownsluke-jr
authored andcommitted
BIP8: add dot file for generating states diagram
1 parent 903d7a3 commit 3c63846

File tree

3 files changed

+151
-54
lines changed

3 files changed

+151
-54
lines changed

bip-0008/states.dot

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
digraph {
2+
rankdir=TD;
3+
4+
node [style="rounded,filled,bold", shape=box, fixedsize=true, width=1.3, fontname="Arial"];
5+
6+
edge [weight = 100];
7+
"DEFINED" -> "STARTED" [label="height >= start_height"];
8+
"STARTED" -> "FAILING" [label="height >= timeoutheight AND NOT lockinontimeout"];
9+
"STARTED" -> "LOCKED_IN" [label="(height < timeoutheight AND threshold reached)\nOR\n(height >= timeoutheight AND lockinontimeout)"];
10+
"LOCKED_IN" -> "ACTIVE" [label="always"];
11+
"FAILING" -> "FAILED" [label="NOT all blocks signal"];
12+
13+
edge [weight = 1];
14+
"FAILING" -> "ACTIVE" [label="all blocks signal"];
15+
16+
"DEFINED":sw -> "DEFINED":nw;
17+
"STARTED":sw -> "STARTED":nw;
18+
"ACTIVE":sw -> "ACTIVE":nw;
19+
"FAILED":sw -> "FAILED":nw;
20+
21+
"STARTED" [fillcolor="#a0a0ff"];
22+
23+
"FAILING" [fillcolor="#ffffa0"];
24+
"LOCKED_IN" [fillcolor="#ffffa0"];
25+
"ACTIVE" [fillcolor="#a0ffa0", shape=box];
26+
"FAILED" [fillcolor="#ffa0a0", shape=box];
27+
28+
"ACTIVE" -> "FAILED" [style=invis];
29+
30+
{ rank=same; "STARTED" "FAILING" }
31+
{ rank=sink; "ACTIVE" "FAILED" }
32+
}
33+
34+

bip-0008/states.png

22.1 KB
Loading

bip-0008/states.svg

Lines changed: 117 additions & 54 deletions
Loading

0 commit comments

Comments
 (0)