Skip to content

Commit

Permalink
Merge pull request #5789 from IntersectMBO/jl/config-bp
Browse files Browse the repository at this point in the history
Default peerSharing true and add block producer config to release binaries
  • Loading branch information
johnalotoski committed May 3, 2024
2 parents 7b5e65e + 8ea159d commit 2ec27e9
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 19 deletions.
4 changes: 3 additions & 1 deletion configuration/cardano/mainnet-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
"LastKnownBlockVersion-Major": 3,
"LastKnownBlockVersion-Minor": 0,
"MaxKnownMajorProtocolVersion": 2,
"MinNodeVersion": "8.10.0",
"PeerSharing": true,
"Protocol": "Cardano",
"RequiresNetworkMagic": "RequiresNoMagic",
"ShelleyGenesisFile": "mainnet-shelley-genesis.json",
"ShelleyGenesisHash": "1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81",
"TargetNumberOfActivePeers": 20,
"TargetNumberOfEstablishedPeers": 50,
"TargetNumberOfKnownPeers": 100,
"TargetNumberOfRootPeers": 100,
"TargetNumberOfRootPeers": 60,
"TraceAcceptPolicy": true,
"TraceBlockFetchClient": false,
"TraceBlockFetchDecisions": false,
Expand Down
18 changes: 12 additions & 6 deletions configuration/cardano/mainnet-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ LastKnownBlockVersion-Minor: 0
LastKnownBlockVersion-Alt: 0
MaxKnownMajorProtocolVersion: 2

##### Network Configuration #####

PeerSharing: True
TargetNumberOfActivePeers: 20
TargetNumberOfEstablishedPeers: 50
TargetNumberOfKnownPeers: 100
TargetNumberOfRootPeers: 60

##### Version Information #####

MinNodeVersion: 8.10.0

##### Logging configuration #####

# Enable or disable logging overall
Expand Down Expand Up @@ -232,12 +244,6 @@ TraceTxOutbound: False
# Trace TxSubmission protocol messages.
TraceTxSubmissionProtocol: False


TargetNumberOfActivePeers: 20
TargetNumberOfEstablishedPeers: 50
TargetNumberOfKnownPeers: 100
TargetNumberOfRootPeers: 100

##### Fine grained logging control #####

# It is also possible to have more fine grained control over filtering of
Expand Down
4 changes: 3 additions & 1 deletion configuration/cardano/shelley_qa-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@
"LastKnownBlockVersion-Alt": 0,
"LastKnownBlockVersion-Major": 3,
"LastKnownBlockVersion-Minor": 1,
"MinNodeVersion": "8.10.0",
"PeerSharing": true,
"Protocol": "Cardano",
"RequiresNetworkMagic": "RequiresMagic",
"ShelleyGenesisFile": "shelley_qa-shelley-genesis.json",
"ShelleyGenesisHash": "73a9f6bdb0aa97f5e63190a6f14a702bd64a21f2bec831cbfc28f6037128b952",
"TargetNumberOfActivePeers": 20,
"TargetNumberOfEstablishedPeers": 50,
"TargetNumberOfKnownPeers": 100,
"TargetNumberOfRootPeers": 100,
"TargetNumberOfRootPeers": 60,
"TestAllegraHardForkAtEpoch": 0,
"TestAlonzoHardForkAtEpoch": 0,
"TestMaryHardForkAtEpoch": 0,
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 21 additions & 8 deletions nix/binary-release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,45 @@

let
inherit (pkgs) lib;

name = "cardano-node-${version}-${platform}";

environments = lib.getAttrs
[ "mainnet" "preprod" "preview" "sanchonet" ]
pkgs.cardanoLib.environments;

genesisAttrs = {
# File references point to the nix store, so we need to rewrite them
# as relative paths
ByronGenesisFile = "byron-genesis.json";
ShelleyGenesisFile = "shelley-genesis.json";
AlonzoGenesisFile = "alonzo-genesis.json";
ConwayGenesisFile = "conway-genesis.json";
};

writeConfig = name: env:
let
nodeConfig = pkgs.writeText
"config.json"
(builtins.toJSON
(env.nodeConfig // {
# File references point to the nix store, so we need to rewrite them
# as relative paths
ByronGenesisFile = "byron-genesis.json";
ShelleyGenesisFile = "shelley-genesis.json";
AlonzoGenesisFile = "alonzo-genesis.json";
ConwayGenesisFile = "conway-genesis.json";
}));
(env.nodeConfig // genesisAttrs));

nodeConfigBp = pkgs.writeText
"config-bp.json"
(builtins.toJSON
(env.nodeConfigBp // genesisAttrs));

topologyConfig = pkgs.cardanoLib.mkTopology env;

# Genesis files are the same for env.nodeConfig and env.nodeConfigBp
inherit (env.nodeConfig)
ByronGenesisFile ShelleyGenesisFile AlonzoGenesisFile ConwayGenesisFile;
in
# Format the node config file and copy the genesis files
''
mkdir -p "share/${name}"
jq . < "${nodeConfig}" > share/${name}/config.json
jq . < "${nodeConfigBp}" > share/${name}/config-bp.json
jq . < "${topologyConfig}" > share/${name}/topology.json
cp -n --remove-destination -v \
"${ByronGenesisFile}" \
Expand Down

0 comments on commit 2ec27e9

Please sign in to comment.