Skip to content

Commit 36f12ed

Browse files
committed
imp: add cardano-tracer default config
1 parent a72f832 commit 36f12ed

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

cardano-lib/default.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ let
8585
defaultLogConfig = import ./generic-log-config.nix;
8686
defaultLogConfigLegacy = import ./generic-log-config-legacy.nix;
8787
defaultExplorerLogConfig = import ./explorer-log-config.nix;
88+
defaultTracerConfig = import ./generic-tracer-config.nix;
8889

8990
mkExplorerConfig = name: nodeConfig: filterAttrs (k: v: v != null) {
9091
NetworkName = name;
@@ -139,6 +140,7 @@ let
139140
nodeConfigLegacy = defaultLogConfigLegacy // env.networkConfig // (env.extraTracerConfigLegacy or {});
140141
nodeConfigBp = mergeTraceOpts (defaultLogConfig // env.networkConfigBp) (env.extraTracerConfig or {});
141142
nodeConfigBpLegacy = defaultLogConfigLegacy // env.networkConfigBp // (env.extraTracerConfigLegacy or {});
143+
tracerConfig = defaultTracerConfig // {inherit (fromJSON (readFile ./${name}/shelley-genesis.json)) networkMagic;};
142144
consensusProtocol = env.networkConfig.Protocol;
143145
submitApiConfig = mkSubmitApiConfig name environments.${name}.nodeConfig;
144146
dbSyncConfig =
@@ -336,6 +338,7 @@ let
336338
<a class="button is-primary" href="${env}-submit-api-config.json">submit-api config</a>
337339
<a class="button is-primary" href="${env}-mithril-signer-config.json">mithril-signer config</a>
338340
<a class="button is-primary" href="rest-config.json">rest config</a>
341+
<a class="button is-primary" href="${env}-tracer-config.json">tracer config</a>
339342
</div>
340343
</td>
341344
</tr>
@@ -398,6 +401,7 @@ let
398401
${jq}/bin/jq . < ${toFile "${env}-db-sync-config.json" (toJSON (value.dbSyncConfig // { NodeConfigFile = "${env}-config.json"; }))} > $out/${env}-db-sync-config.json
399402
${jq}/bin/jq . < ${toFile "${env}-submit-api-config.json" (toJSON value.submitApiConfig)} > $out/${env}-submit-api-config.json
400403
${jq}/bin/jq . < ${toFile "${env}-mithril-signer-config.json" (toJSON value.mithrilSignerConfig)} > $out/${env}-mithril-signer-config.json
404+
${jq}/bin/jq . < ${toFile "${env}-tracer-config.json" (toJSON value.tracerConfig)} > $out/${env}-tracer-config.json
401405
${jq}/bin/jq . < ${mkTopology value} > $out/${env}-topology.json
402406
${jq}/bin/jq . < ${./${env}/peer-snapshot.json} > $out/${env}-peer-snapshot.json
403407
${optionalString (value.nodeConfig ? CheckpointsFile) ''
@@ -416,6 +420,7 @@ in {
416420
defaultExplorerLogConfig
417421
defaultLogConfig
418422
defaultLogConfigLegacy
423+
defaultTracerConfig
419424
eachEnv
420425
forEnvironments
421426
forEnvironmentsCustom
Lines changed: 53 additions & 0 deletions
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)