Skip to content

Commit c03af02

Browse files
authored
Import cardano-node doc/ directory (#19)
1 parent 6c8cf00 commit c03af02

File tree

122 files changed

+22045
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+22045
-0
lines changed

doc/.sphinx/_static/css/custom.css

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
html, body.wy-body-for-nav, .wy-nav-side, .wy-nav-content-wrap{
2+
background: #f8f8f5;
3+
}
4+
5+
body {
6+
font-weight: 300;
7+
}
8+
9+
body, h1, h2, h3, h4, h5, h6 {
10+
font-family: 'Chivo', sans-serif;
11+
letter-spacing: .03rem;
12+
}
13+
14+
h1, h2, h3, h4, h5, h6 {
15+
letter-spacing: .05rem;
16+
}
17+
18+
.icon.icon-home,
19+
h1 {
20+
color:#0033AD
21+
}
22+
23+
24+
a {
25+
color:#0a38a6;
26+
}
27+
a:visited {
28+
color:#335cbe;
29+
}
30+
p {
31+
line-height: 28px;
32+
font-weight: 300;
33+
}
34+
35+
.wy-nav-content {
36+
max-width: 70rem;
37+
}
38+
39+
.wy-menu-vertical a {
40+
color: #444;
41+
}
42+
.wy-menu-vertical a:hover {
43+
color: #444;
44+
background:#ddd;
45+
}
46+
47+
.rst-footer-buttons {
48+
margin-top:10rem;
49+
padding-top:1.8rem;
50+
border-top:1px solid #eee;
51+
}
52+
.rst-footer-buttons .btn.btn-neutral {
53+
border:0;
54+
background:transparent !important;
55+
box-shadow:0 0 0 transparent;
56+
padding:0;
57+
}
58+
59+
.rst-content .section ul, .rst-content .toctree-wrapper ul, .wy-plain-list-disc, article ul ,.rst-content .section ul li, .rst-content .toctree-wrapper ul li, .wy-plain-list-disc li, article ul li {
60+
line-height: 33px;
61+
}
62+
63+
.wy-menu-vertical li.toctree-l1.current > a {
64+
border: 0;
65+
}
66+
.wy-menu-vertical li.current > a, .wy-menu-vertical li.on a, .wy-menu-vertical li.toctree-l1.current > a {
67+
background: #eee;
68+
border: none;
69+
border-left:#5281f7 5px solid !important;
70+
padding-left: 18px;
71+
}
72+
.wy-menu-vertical li.current {
73+
background: transparent;
74+
}
75+
76+
.wy-nav-top {
77+
background: linear-gradient(145deg, rgba(255,85,83,1) 0%, rgba(0,51,173,1) 100%);
78+
}
79+
.wy-nav-top a{
80+
color:white
81+
}
82+
83+
84+
.rst-content .note .admonition-title, .rst-content .note .wy-alert-title, .rst-content .seealso .admonition-title, .rst-content .seealso .wy-alert-title, .rst-content .wy-alert-info.admonition-todo .admonition-title, .rst-content .wy-alert-info.admonition-todo .wy-alert-title, .rst-content .wy-alert-info.admonition .admonition-title, .rst-content .wy-alert-info.admonition .wy-alert-title, .rst-content .wy-alert-info.attention .admonition-title, .rst-content .wy-alert-info.attention .wy-alert-title, .rst-content .wy-alert-info.caution .admonition-title, .rst-content .wy-alert-info.caution .wy-alert-title, .rst-content .wy-alert-info.danger .admonition-title, .rst-content .wy-alert-info.danger .wy-alert-title, .rst-content .wy-alert-info.error .admonition-title, .rst-content .wy-alert-info.error .wy-alert-title, .rst-content .wy-alert-info.hint .admonition-title, .rst-content .wy-alert-info.hint .wy-alert-title, .rst-content .wy-alert-info.important .admonition-title, .rst-content .wy-alert-info.important .wy-alert-title, .rst-content .wy-alert-info.tip .admonition-title, .rst-content .wy-alert-info.tip .wy-alert-title, .rst-content .wy-alert-info.warning .admonition-title, .rst-content .wy-alert-info.warning .wy-alert-title, .rst-content .wy-alert.wy-alert-info .admonition-title, .wy-alert.wy-alert-info .rst-content .admonition-title, .wy-alert.wy-alert-info .wy-alert-title {
85+
background: #5281f7;
86+
}
87+
.rst-content .note, .rst-content .seealso, .rst-content .wy-alert-info.admonition, .rst-content .wy-alert-info.admonition-todo, .rst-content .wy-alert-info.attention, .rst-content .wy-alert-info.caution, .rst-content .wy-alert-info.danger, .rst-content .wy-alert-info.error, .rst-content .wy-alert-info.hint, .rst-content .wy-alert-info.important, .rst-content .wy-alert-info.tip, .rst-content .wy-alert-info.warning, .wy-alert.wy-alert-info {
88+
background: #ccd6ee;
89+
}
90+
.wy-menu-vertical header, .wy-menu-vertical p.caption {
91+
color: #ff7676;
92+
}
93+
.rst-content .admonition-todo .admonition-title, .rst-content .admonition-todo .wy-alert-title, .rst-content .attention .admonition-title, .rst-content .attention .wy-alert-title, .rst-content .caution .admonition-title, .rst-content .caution .wy-alert-title, .rst-content .warning .admonition-title, .rst-content .warning .wy-alert-title, .rst-content .wy-alert-warning.admonition .admonition-title, .rst-content .wy-alert-warning.admonition .wy-alert-title, .rst-content .wy-alert-warning.danger .admonition-title, .rst-content .wy-alert-warning.danger .wy-alert-title, .rst-content .wy-alert-warning.error .admonition-title, .rst-content .wy-alert-warning.error .wy-alert-title, .rst-content .wy-alert-warning.hint .admonition-title, .rst-content .wy-alert-warning.hint .wy-alert-title, .rst-content .wy-alert-warning.important .admonition-title, .rst-content .wy-alert-warning.important .wy-alert-title, .rst-content .wy-alert-warning.note .admonition-title, .rst-content .wy-alert-warning.note .wy-alert-title, .rst-content .wy-alert-warning.seealso .admonition-title, .rst-content .wy-alert-warning.seealso .wy-alert-title, .rst-content .wy-alert-warning.tip .admonition-title, .rst-content .wy-alert-warning.tip .wy-alert-title, .rst-content .wy-alert.wy-alert-warning .admonition-title, .wy-alert.wy-alert-warning .rst-content .admonition-title, .wy-alert.wy-alert-warning .wy-alert-title {
94+
background: #ff7676;
95+
}
96+
.rst-content .admonition-todo, .rst-content .attention, .rst-content .caution, .rst-content .warning, .rst-content .wy-alert-warning.admonition, .rst-content .wy-alert-warning.danger, .rst-content .wy-alert-warning.error, .rst-content .wy-alert-warning.hint, .rst-content .wy-alert-warning.important, .rst-content .wy-alert-warning.note, .rst-content .wy-alert-warning.seealso, .rst-content .wy-alert-warning.tip, .wy-alert.wy-alert-warning {
97+
background: #FED8D8;
98+
}
99+
100+
.rst-content blockquote {
101+
margin-left: 0;
102+
background: rgba(200,220,255,.4);
103+
padding:1rem 1.3rem;
104+
}
105+
106+
.rst-content div[class^="highlight"], .rst-content pre.literal-block {
107+
border:0;
108+
margin: 1px 0 2rem;
109+
}
110+
.highlight {
111+
background:rgba(115,255,160,.3) ;
112+
}
113+
.rst-content div[class^="highlight"] pre {
114+
padding:1rem 1.3rem;
115+
}
116+
.highlight .s1 {
117+
color: #FF4F4F;
118+
}
119+
120+
.rst-content code.literal, .rst-content tt.literal {
121+
color: #FF4F4F;
122+
}
123+
.rst-content code, .rst-content tt, code {
124+
background:rgba(115,255,160,.3) ;
125+
border: 0 solid #e1e4e5;
126+
border-radius: 3px;
127+
}
128+
129+
130+
.rst-versions {
131+
display: none;
132+
}
133+
134+
135+
@media (min-width:768px) {
136+
h1 {
137+
font-size:2.4rem;
138+
}
139+
140+
.wy-grid-for-nav {
141+
position: relative;
142+
max-width: 100rem;
143+
margin:auto;
144+
}
145+
.wy-nav-side {
146+
147+
}
148+
}

doc/.sphinx/_templates/layout.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% extends "!layout.html" %}
2+
3+
{% block footer %}
4+
{{ super() }}
5+
<div class="footer">YEP THIS IS AN EXAMPLE
6+
</div>
7+
{% endblock %}

doc/.sphinx/cardano-logo.png

19.7 KB
Loading

doc/.sphinx/requirements.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Sphinx==3.1.1
2+
sphinx-intl==2.0.1
3+
transifex-client==0.13.10
4+
testresources==2.0.1
5+
-e git+https://github.com/input-output-hk/sphinx_rtd_theme.git#egg=sphinx_rtd_theme
6+
recommonmark==0.6
7+
## The following requirements were added by pip freeze:
8+
alabaster==0.7.12
9+
Babel==2.9.1
10+
certifi==2022.12.7
11+
chardet==3.0.4
12+
click==7.1.2
13+
sphinxcontrib-mermaid==0.4.0
14+
sphinxemoji==0.1.6
15+
sphinx_markdown_tables==0.0.15
16+
CommonMark==0.9.1
17+
docutils==0.16
18+
future==0.18.3
19+
idna==2.9
20+
imagesize==1.2.0
21+
Jinja2==2.11.3
22+
jsonpointer==2.0
23+
jsonref==0.2
24+
MarkupSafe==1.1.1
25+
Pygments==2.7.4
26+
pytz==2020.1
27+
requests==2.24.0
28+
six==1.15.0
29+
snowballstemmer==2.0.0
30+
sphinxcontrib-websupport==1.2.2
31+
urllib3==1.26.5

doc/New Tracing Quickstart.md

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# New Tracing Quickstart
2+
3+
From now on old-tracing (based on iohk-monitoring-framework) exists
4+
together with new-tracing (based on trace-dispatcher and cardano-tracer) for a while.
5+
6+
In this transition time new-tracing can be tested and improved. Since we have several hundred trace messages
7+
it is expected that you will find regressions and bugs in the port, please help to find
8+
and fix them.
9+
10+
In this transition time new tracing will for technical reason have a restricted functionality,
11+
as e.g. the reconfiguration of a running node is not available.
12+
13+
To switch to new tracing set the value `UseTraceDispatcher` to true. If you do this, the
14+
config file needs to contain several values for the configuration of new-tracing, as we
15+
describe next.
16+
17+
The current tracing system has two ways to identify the message, a hierarchical name we
18+
call it's `Namespace` and the `Kind field` in machine representation. We base our implementation
19+
on the namespace, and require a one-to-one correspondence between namespaces and messages (bijective mapping).
20+
21+
As we have two mechanisms for the same purpose for historic reasons, we will soon
22+
__deprecate the Kind field__, and it will disappear in the near future. So we strongly
23+
advice to use namespaces for any analysis tools of traces!
24+
25+
### Configuration of new tracing
26+
27+
In Cardano a default configuration is given in the module [Cardano.Node.Tracing.DefaultTraceConfig](https://github.com/input-output-hk/cardano-node/blob/master/cardano-node/src/Cardano/Node/Tracing/DefaultTraceConfig.hs). In the config file all entries of the default configuration can be overridden. To remove a frequency limiter, define a limiter with maxFrequency 0.0.
28+
29+
1. Specify a filter for the severity of the messages you want to see, e.g.:
30+
31+
~~~yaml
32+
# Show messages of Severity Notice or higher as default
33+
"":
34+
severity: Notice
35+
36+
# But show ChainDB messages starting from Info
37+
ChainDB:
38+
severity: Info
39+
~~~
40+
41+
42+
So the namespaces are used for configuration values, which works
43+
down to individual messages, and the more specialized value overwrites the more general.
44+
45+
If you don't want to see any messages from tracers the new severity `Silence`
46+
exists, which suppresses all messages.
47+
48+
49+
2. Specify in which detail level, the messages get shown.
50+
51+
~~~yaml
52+
"":
53+
# Keep this
54+
severity: Notice
55+
# All messages are shown with normal detail level
56+
detail: DNormal
57+
~~~
58+
59+
Other options would be DMinimal, DDetailed and DMaximum. This has only an effect on messages which support the representation in different ways.
60+
61+
3. Specify limiters for the frequency of messages
62+
63+
Eliding tracers are not supported in new-tracing, instead you can limit the
64+
frequency in which messages get shown.
65+
66+
~~~yaml
67+
ChainDB.AddBlockEvent.AddedBlockToQueue:
68+
# Only show a maximum of 2 of these messages per second
69+
maxFrequency: 2.0
70+
~~~
71+
72+
The activity of limiters will be written in the traces as well.
73+
74+
4. Specify the backends the messages are routed to.
75+
76+
~~~yaml
77+
"":
78+
# Keep this
79+
severity: Notice
80+
# And this
81+
detail: DNormal
82+
# And specify a list of backends to use
83+
backends:
84+
- Stdout MachineFormat
85+
- EKGBackend
86+
- Forwarder
87+
~~~
88+
89+
These are all the backends currently supported. With Stdout you have the
90+
options MachineFormat or HumanFormatColoured/HumanFormatUncoloured.
91+
If messages don't support representation in HumanFormat* they are shown in MachineFormat anyway.
92+
93+
Forwarder means that messages are send to cardano-tracer
94+
95+
Configuration can be written in JSON and YAML, we have shown the examples in YAML.
96+
97+
### Configuration and use of cardano-tracer
98+
99+
`cardano-tracer` is a part of the new tracing infrastructure. It is a separate service that accepts different messages from the node and handles them.
100+
So it is assumed that if you want to use the new tracing infrastructure - you will use `cardano-tracer`. Please read its [documentation](https://github.com/input-output-hk/cardano-node/blob/master/cardano-tracer/docs/cardano-tracer.md) for more details.
101+
102+
This example describes the simplest case, when the node and `cardano-tracer` on the same machine.
103+
104+
First of all, add `--tracer-socket-path-connect /tmp/forwarder.sock` option to the node's CLI options, asking it to connect to `cardano-tracer`.
105+
106+
Then build and run `cardano-tracer`:
107+
108+
~~~shell
109+
$ cabal build cardano-tracer && cabal install cardano-tracer --installdir=PATH_TO_DIR --overwrite-policy=always
110+
$ cd PATH_TO_DIR
111+
$ ./cardano-tracer --config PATH_TO_CONFIG
112+
~~~
113+
114+
where `PATH_TO_CONFIG` is a path to tracer's configuration file. This is an example of such a configuration:
115+
116+
~~~yaml
117+
---
118+
network:
119+
tag: AcceptAt
120+
contents: "/tmp/forwarder.sock"
121+
logging:
122+
- logRoot: "/tmp/cardano-tracer-logs"
123+
logMode: FileMode
124+
logFormat: ForMachine
125+
~~~
126+
127+
That's it. After you run the node, it will establish the connection with `cardano-tracer` and will start to forward messages to it.
128+
As a result, you will find log files, in JSON format, in `/tmp/cardano-tracer-logs` directory.
129+
130+
### Development during transition-time
131+
132+
For developing tracers in the transition time we suggest:
133+
134+
1. Don't use strictness annotations for trace types. Trace messages are either
135+
discarded immediately (which happens frequently) or instantly converted to another format
136+
but never stored. So strictness annotations make the code less efficient without any benefit.
137+
As well it doesn't play well together with the required prototypes of messages in the
138+
new framework.
139+
140+
2. If you develop new tracers we suggest that you develop the new tracers first,
141+
and then map to old tracers, as the new tracers will survive. You will find plenty of
142+
examples in cardano-node under Cardano.Node.Tracing.Tracers.
143+
144+
3. Contact the benchmarking team or node-logging channel for any questions and reviews.
145+
146+
### Documentation of trace messages and further documentation
147+
148+
This is a document which is regenerated periodically and documents all trace-messages, metrics and data-points in cardano-node. It as well displays the handling of these
149+
messages with the current default configuration:
150+
151+
[Cardano Trace Documentation](https://github.com/input-output-hk/cardano-node/blob/master/doc/new-tracing/tracers_doc_generated.md)
152+
153+
This document describes the underlying library trace-dispatcher:
154+
155+
[trace-dispatcher: efficient, simple and flexible program tracing](https://github.com/input-output-hk/cardano-node/blob/master/trace-dispatcher/doc/trace-dispatcher.md)
156+
157+
This document describes a seperate service for logging and monitoring Cardano nodes:
158+
159+
[Cardano Tracer](https://github.com/input-output-hk/cardano-node/blob/master/cardano-tracer/docs/cardano-tracer.md)

0 commit comments

Comments
 (0)