Skip to content

Commit

Permalink
Add create-testnet-data support to modular genesis too
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabedini committed Apr 30, 2024
1 parent 604205b commit 6ea6a6d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions nix/workbench/modules/genesis.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ in

## UTxO & delegation

total_supply = mkOption {
description = ''
The maximum possible amount of Lovelace, which is evenly distributed across stake holders.
'';
type = types.int;
default = 1000000000000000;
};

per_pool_balance = mkOption {
# part of the profile
description = "UTxO & delegation: per_pool_balance";
Expand Down Expand Up @@ -234,6 +242,11 @@ in
type = types.separatedString " ";
};

create-testnet-data-args = mkOption {
description = "Arguments to cardano-cli genesis create-testnet-data";
type = types.separatedString " ";
};

byron-genesis-args = mkOption {
description = "Arguments to cardano-cli byron genesis genesis";
type = types.separatedString " ";
Expand Down Expand Up @@ -268,6 +281,9 @@ in

config = {
genesis = {

total_supply = genesis.funds_balance + derived.supply_delegated;

create-staked-args = concatStringsSep " " ([
"--supply ${toString genesis.funds_balance}"
"--gen-utxo-keys 1"
Expand All @@ -283,6 +299,17 @@ in
"--bulk-pools-per-file ${toString composition.dense_pool_density}"
]);

create-testnet-data-args = concatStringsSep " " [
"--total-supply ${toString genesis.total_supply}"
"--utxo-keys 1"
"--genesis-keys ${toString composition.n_bft_hosts}"
"--delegated-supply ${toString derived.supply_delegated}"
"--pools ${toString composition.n_pools}"
"--stake-delegators ${toString derived.delegators_effective}"
"--stuffed-utxo ${toString derived.utxo_stuffed}"
"--testnet-magic ${toString genesis.network_magic}"
];

byron-genesis-args = concatStringsSep " " ([
"--k ${toString genesis.parameter_k}"
"--protocol-magic ${toString genesis.network_magic}"
Expand Down

0 comments on commit 6ea6a6d

Please sign in to comment.