Skip to content

Commit

Permalink
BIP8: add dot file for generating states diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
ajtowns authored and luke-jr committed Oct 15, 2020
1 parent 903d7a3 commit 3c63846
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 54 deletions.
34 changes: 34 additions & 0 deletions bip-0008/states.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
digraph {
rankdir=TD;

node [style="rounded,filled,bold", shape=box, fixedsize=true, width=1.3, fontname="Arial"];

edge [weight = 100];
"DEFINED" -> "STARTED" [label="height >= start_height"];
"STARTED" -> "FAILING" [label="height >= timeoutheight AND NOT lockinontimeout"];
"STARTED" -> "LOCKED_IN" [label="(height < timeoutheight AND threshold reached)\nOR\n(height >= timeoutheight AND lockinontimeout)"];
"LOCKED_IN" -> "ACTIVE" [label="always"];
"FAILING" -> "FAILED" [label="NOT all blocks signal"];

edge [weight = 1];
"FAILING" -> "ACTIVE" [label="all blocks signal"];

"DEFINED":sw -> "DEFINED":nw;
"STARTED":sw -> "STARTED":nw;
"ACTIVE":sw -> "ACTIVE":nw;
"FAILED":sw -> "FAILED":nw;

"STARTED" [fillcolor="#a0a0ff"];

"FAILING" [fillcolor="#ffffa0"];
"LOCKED_IN" [fillcolor="#ffffa0"];
"ACTIVE" [fillcolor="#a0ffa0", shape=box];
"FAILED" [fillcolor="#ffa0a0", shape=box];

"ACTIVE" -> "FAILED" [style=invis];

{ rank=same; "STARTED" "FAILING" }
{ rank=sink; "ACTIVE" "FAILED" }
}


Binary file modified bip-0008/states.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
171 changes: 117 additions & 54 deletions bip-0008/states.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3c63846

Please sign in to comment.