Skip to content

Commit

Permalink
Merge #2831
Browse files Browse the repository at this point in the history
2831: CAD-2907 workbench: Alonzo support r=deepfire a=deepfire

This makes the `scripts/plutus/example-txin-locking-plutus-script.sh` script work with the workbench:

1. Alonzo-specific updates in the workbench genesis generation
2. Adaptations in the script
3. Small quality-of-life improvement: set `CARDANO_NODE_SOCKET_PATH` automatically inside the shell

Test with:

1. `make cls cluster-shell-dev CLUSTER_ARGS_EXTRA='--arg withHoogle false'`, and once inside the shell:
2. `./scripts/plutus/example-txin-locking-plutus-script.sh`
3. `cardano-cli transaction submit --tx-file example/work/alonzo.tx --testnet-magic 42`

The last command should output: `Transaction successfully submitted.`

Co-authored-by: Kosyrev Serge <serge.kosyrev@iohk.io>
  • Loading branch information
iohk-bors[bot] and deepfire committed Jun 16, 2021
2 parents 481ac3c + d378762 commit 2b9d75e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ profiles:
profile-names:
@./nix/workbench/wb profile-names

CLUSTER_PROFILE = default-mary
CLUSTER_PROFILE = default-alzo
CLUSTER_ARGS_EXTRA ?=

cluster-shell:
Expand Down
2 changes: 1 addition & 1 deletion custom-config/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ self: {
localCluster = {
cacheDir = "${self.localCluster.stateDir}/.cache";
stateDir = "state-cluster";
profileName = "default-mary";
profileName = "default-alzo";
basePort = 30000;
autoStartCluster = false;
enableEKG = true;
Expand Down
3 changes: 2 additions & 1 deletion nix/supervisord-cluster/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let
basePortDefault = 30000;
cacheDirDefault = "${__getEnv "HOME"}/.cache/cardano-workbench";
stateDirDefault = "state-cluster";
profileNameDefault = "default-mary";
profileNameDefault = "default-alzo";
in
{ pkgs
, workbench
Expand Down Expand Up @@ -52,6 +52,7 @@ let
finaliseNodeConfig =
{ port, ... }: cfg: recursiveUpdate cfg
({
AlonzoGenesisFile = "../genesis/alonzo-genesis.json";
ShelleyGenesisFile = "../genesis/genesis.json";
ByronGenesisFile = "../genesis/byron/genesis.json";
} // optionalAttrs enableEKG {
Expand Down
1 change: 1 addition & 0 deletions nix/workbench/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ let
}
export -f workbench-prebuild-executables
export CARDANO_NODE_SOCKET_PATH=run/current/node-0/node.socket
'';

generateProfiles =
Expand Down
14 changes: 7 additions & 7 deletions nix/workbench/genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,24 +146,24 @@ case "${op}" in
cardano-cli genesis create-staked "${params[@]}"

## TODO: temporary step for Alonzo
jq_fmutate ""$dir"/genesis.json" '. *
{ lovelacePerUTxOWord: 0
jq '
{ adaPerUTxOWord: 0
, executionPrices:
{ prMem: 1
, prSteps: 1
}
, maxTxExUnits:
{ exUnitsMem: 1
, exUnitsSteps: 1
{ exUnitsMem: 2000000000
, exUnitsSteps: 2000000000
}
, maxBlockExUnits:
{ exUnitsMem: 1
, exUnitsSteps: 1
{ exUnitsMem: 200000000000
, exUnitsSteps: 200000000000
}
, maxValueSize: 1000
, collateralPercentage: 100
, maxCollateralInputs: 1
}'
}' --null-input > "$dir"/alonzo-genesis.json

## TODO: try to get rid of this step:
Massage_the_key_file_layout_to_match_AWS "$profile_json" "$topo_dir" "$dir";;
Expand Down
3 changes: 2 additions & 1 deletion nix/workbench/profiles/node-services.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ let
LastKnownBlockVersion-Minor = 0;
LastKnownBlockVersion-Alt = 0;
})
[ "ByronGenesisHash"
[ "AlonzoGenesisHash"
"ByronGenesisHash"
"ShelleyGenesisHash"
])
//
Expand Down

0 comments on commit 2b9d75e

Please sign in to comment.