Skip to content

Commit f6d0802

Browse files
committed
wip10: add cardano-tracer default config
1 parent 2ac96c5 commit f6d0802

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

cardano-lib/default.nix

+5
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ let
7676
defaultLogConfig = import ./generic-log-config.nix;
7777
defaultLogConfigLegacy = import ./generic-log-config-legacy.nix;
7878
defaultExplorerLogConfig = import ./explorer-log-config.nix;
79+
defaultTracerConfig = import ./generic-tracer-config.nix;
7980

8081
mkExplorerConfig = name: nodeConfig: filterAttrs (k: v: v != null) {
8182
NetworkName = name;
@@ -128,6 +129,7 @@ let
128129
nodeConfigLegacy = defaultLogConfigLegacy // env.networkConfig // (env.extraTracerConfigLegacy or {});
129130
nodeConfigBp = mergeTraceOpts (defaultLogConfig // env.networkConfigBp) (env.extraTracerConfig or {});
130131
nodeConfigBpLegacy = defaultLogConfigLegacy // env.networkConfigBp // (env.extraTracerConfigLegacy or {});
132+
tracerConfig = defaultTracerConfig // {inherit (fromJSON (readFile ./${name}/shelley-genesis.json)) networkMagic;};
131133
consensusProtocol = env.networkConfig.Protocol;
132134
submitApiConfig = mkSubmitApiConfig name environments.${name}.nodeConfig;
133135
dbSyncConfig =
@@ -319,6 +321,7 @@ let
319321
<a class="button is-primary" href="${env}-submit-api-config.json">submit-api config</a>
320322
<a class="button is-primary" href="${env}-mithril-signer-config.json">mithril-signer config</a>
321323
<a class="button is-primary" href="rest-config.json">rest config</a>
324+
<a class="button is-primary" href="${env}-tracer-config.json">tracer config</a>
322325
</div>
323326
</td>
324327
</tr>
@@ -379,6 +382,7 @@ let
379382
${jq}/bin/jq . < ${toFile "${env}-db-sync-config.json" (toJSON (value.dbSyncConfig // { NodeConfigFile = "${env}-config.json"; }))} > $out/${env}-db-sync-config.json
380383
${jq}/bin/jq . < ${toFile "${env}-submit-api-config.json" (toJSON value.submitApiConfig)} > $out/${env}-submit-api-config.json
381384
${jq}/bin/jq . < ${toFile "${env}-mithril-signer-config.json" (toJSON value.mithrilSignerConfig)} > $out/${env}-mithril-signer-config.json
385+
${jq}/bin/jq . < ${toFile "${env}-tracer-config.json" (toJSON value.tracerConfig)} > $out/${env}-tracer-config.json
382386
${jq}/bin/jq . < ${mkTopology value} > $out/${env}-topology.json
383387
''
384388
) environments )
@@ -393,6 +397,7 @@ in {
393397
defaultExplorerLogConfig
394398
defaultLogConfig
395399
defaultLogConfigLegacy
400+
defaultTracerConfig
396401
eachEnv
397402
forEnvironments
398403
forEnvironmentsCustom

cardano-lib/generic-tracer-config.nix

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
# Cardano-tracer will use default values where parameters are set to null.
3+
WarnRTViewMissing = null;
4+
ekgRequestFreq = null;
5+
ekgRequestFull = null;
6+
7+
# Whether to enable an EKG http interface for process monitoring.
8+
hasEKG = {
9+
epHost = "127.0.0.1";
10+
epPort = 12788;
11+
};
12+
13+
# Whether to enable a prometheus export of metrics.
14+
hasPrometheus = {
15+
epHost = "127.0.0.1";
16+
epPort = 12808;
17+
};
18+
19+
loRequestNum = null;
20+
21+
# Configure default logging
22+
logging = [
23+
{
24+
logFormat = "ForHuman";
25+
logMode = "FileMode";
26+
logRoot = "/tmp/cardano-tracer";
27+
}
28+
];
29+
30+
metricsHelp = null;
31+
metricsNoSuffix = null;
32+
33+
# Configure default cardano-tracer operational mode
34+
network = {
35+
contents = "/tmp/cardano-tracer.socket";
36+
tag = "AcceptAt";
37+
};
38+
39+
# The network magic will need to be set per environment
40+
# networkMagic = ... ;
41+
42+
resourceFreq = null;
43+
44+
# Configure default rotation
45+
rotation = {
46+
rpFrequencySecs = 60;
47+
rpKeepFilesNum = 14;
48+
rpLogLimitBytes = 10000000;
49+
rpMaxAgeHours = 24;
50+
};
51+
52+
verbosity = null;
53+
}

0 commit comments

Comments
 (0)