Skip to content

Commit

Permalink
wb | create constitution, withdrawals and keep voting yes
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaste committed Nov 19, 2024
1 parent f1319c2 commit 6b4fb12
Show file tree
Hide file tree
Showing 7 changed files with 1,491 additions and 4 deletions.
7 changes: 7 additions & 0 deletions nix/workbench/backend/nomad/cloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,13 @@ deploy-genesis-nomadcloud() {
local dir=${1:?$usage}; shift
local nomad_job_name=$(jq -r ". [\"job\"] | keys[0]" "${dir}"/nomad/nomad-job.json)

################################################################################
################################################################################
################################################################################
cp /tmp/guardrails-script.plutus "$dir"/genesis/guardrails-script.plutus
################################################################################
################################################################################
################################################################################
# Create genesis tar file
local genesis_file_name="${nomad_job_name}.tar.zst"
msg "$(blue Creating) $(yellow "\"${genesis_file_name}\"") ..."
Expand Down
7 changes: 7 additions & 0 deletions nix/workbench/backend/nomad/exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ deploy-genesis-nomadexec() {
msg "$(blue Reusing) already running local $(yellow "HTTP server")"
fi
msg "$(blue Creating) $(yellow "\"${nomad_job_name}.tar.zst\"") ..."
################################################################################
################################################################################
################################################################################
cp /tmp/guardrails-script.plutus "$dir"/genesis/guardrails-script.plutus
################################################################################
################################################################################
################################################################################
if ! wb_nomad webfs add-genesis-dir "${dir}"/genesis "${nomad_job_name}"
then
if test "${nomad_agents_were_already_running}" = "false"
Expand Down
7 changes: 7 additions & 0 deletions nix/workbench/backend/supervisor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ case "$op" in
deploy-genesis )
local usage="USAGE: wb backend $op RUN-DIR"
local dir=${1:?$usage}; shift
################################################################################
################################################################################
################################################################################
cp /tmp/guardrails-script.plutus "${dir}"/genesis/guardrails-script.plutus
################################################################################
################################################################################
################################################################################
;;

describe-run )
Expand Down
5 changes: 5 additions & 0 deletions nix/workbench/genesis/guardrails-script.plutus
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "PlutusScriptV3",
"description": "*BE CAREFUL* that this is compiled from a release commit of plutus and not from master",
"cborHex": "5908545908510101003232323232323232323232323232323232323232323232323232323232323232323232323232323232259323255333573466e1d20000011180098111bab357426ae88d55cf00104554ccd5cd19b87480100044600422c6aae74004dd51aba1357446ae88d55cf1baa3255333573466e1d200a35573a002226ae84d5d11aab9e00111637546ae84d5d11aba235573c6ea800642b26006003149a2c8a4c301f801c0052000c00e0070018016006901e406cc00e003000c00d20d00fc000c0003003800a4005801c00e003002c00d20c09a0c80d9801c006001801a4101b5881380018000600700148013003801c006005801a410100078001801c006001801a4101001f8001800060070014801b0038018096007001800600690404002600060001801c0052008c00e006025801c006001801a41209d8001800060070014802b003801c006005801a410112f501b3003800c00300348202b7881300030000c00e00290066007003800c00b003482032ad7b806036403060070014803b00380180960003003800a4021801c00e003002c00d20f40380d9801c006001801a41403f800100a0c00e0029009600f0030078040c00e002900a600f003800c00b003301c483403e01a600700180060066038904801e00060001801c0052016c01e00600f801c006001801980ca402900e30000c00e002901060070030128060c00e00290116007003800c00b003483c0ba03660070018006006906432e00040283003800a40498003003800a404d802c00e00f003800c00b003301c480cb0003003800c003003301c4802b00030001801c01e0070018016006603890605c0160006007001800600660389048276000600030000c00e0029014600b003801c00c04b003800c00300348203a2489b00030001801c00e006025801c006001801a4101b11dc2df80018000c0003003800a4055802c00e007003012c00e003000c00d2080b8b872c000c0006007003801809600700180060069040607e4155016000600030000c00e00290166007003012c00e003000c00d2080c001c000c0003003800a405d801c00e003002c00d20c80180d9801c006001801a412007800100a0c00e00290186007003014c0006007001480cb0058018016006007801801e00600300403003800a4069802c00c00b003003c00c00f003803c00e003002c00c03f00333023480692028c0004014c00c007003002c00c00b003002c00e00f003800c00b00300f80590052008003003800a406d801c00e003002c00d2000c00d2006c00060070018006006900a600060001801c0052038c00e007001801600690006006901260003003800c003003483281300020141801c005203ac00e006029801c006001801a403d800180006007001480f3003801804e00700180060069040404af3c4e302600060001801c005203ec00e006013801c006001801a4101416f0fd20b80018000600700148103003801c006005801a403501b3003800c0030034812b00030000c00e0029021600f003800c00a01ac00e003000c00ccc08d20d00f4800b00030000c0000000000803c00c017003800c003003014c00c04b00018000803c00c013003800c00300301380498000803c00c00e004400e00f003800c00b00300bc000802180020070018006006021801808e00030004006005801804e0060158000800c00b00330154805200c400e00300080330004006005801a4001801a410112f58000801c00600901160008019807240118002007001800600690404a75ee01e00060008018026000801803e000300d48010c03520c80130074800a0030028048c011200a800c00b0034800b0000c01d2002300448050c0312008300b48000c029200630094804a00690006000300748008c0192066300a2233335573e00250002801994004d55ce800cd55cf0008d5d08014c00cd5d10011263009222532900389800a4d2219002912c80344c01526910c80148964cc04cdd68010034564cc03801400626601800e0071801226601800e01518010096400a3000910c008600444002600244004a664600200244246466004460044460040064600444600200646a660080080066a00600224446600644b20051800484ccc02600244666ae68cdc3801000c00200500a91199ab9a33710004003000801488ccd5cd19b89002001800400a44666ae68cdc4801000c00a00122333573466e20008006005000912a999ab9a3371200400222002220052255333573466e2400800444008440040026eb400a42660080026eb000a4264666015001229002914801c8954ccd5cd19b8700400211333573466e1c00c006001002118011229002914801c88cc044cdc100200099b82002003245200522900391199ab9a3371066e08010004cdc1001001c002004403245200522900391199ab9a3371266e08010004cdc1001001c00a00048a400a45200722333573466e20cdc100200099b820020038014000912c99807001000c40062004912c99807001000c400a2002001199919ab9a357466ae880048cc028dd69aba1003375a6ae84008d5d1000934000dd60010a40064666ae68d5d1800c0020052225933006003357420031330050023574400318010600a444aa666ae68cdc3a400000222c22aa666ae68cdc4000a4000226600666e05200000233702900000088994004cdc2001800ccdc20010008cc010008004c01088954ccd5cd19b87480000044400844cc00c004cdc300100091119803112c800c60012219002911919806912c800c4c02401a442b26600a004019130040018c008002590028c804c8888888800d1900991111111002a244b267201722222222008001000c600518000001112a999ab9a3370e004002230001155333573466e240080044600823002229002914801c88ccd5cd19b893370400800266e0800800e00100208c8c0040048c0088cc008008005"
}
18 changes: 18 additions & 0 deletions nix/workbench/service/generator.nix
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,24 @@ let
value = ''
#!${pkgs.stdenv.shell}
############################### VOTING ###############################
############################### VOTING ###############################
############################### VOTING ###############################
${if profile.generator.drep_voting or false
then
''
${import ./voting.nix {inherit pkgs profile nodeSpecs;}}
workflow_generator \
${if profile.composition.with_explorer then "explorer" else "node-0"}
''
else
''
''
}
############################### VOTING ###############################
############################### VOTING ###############################
############################### VOTING ###############################
${service.script}
'';
JSON = pkgs.writeScript "startup-generator.sh" value;
Expand Down
41 changes: 37 additions & 4 deletions nix/workbench/service/healthcheck.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ let
active_slots="$(${jq}/bin/jq --null-input -r \
"''${epoch_length} * ''${active_slots_coeff}" \
)"
with_explorer="$(${jq}/bin/jq .composition.with_explorer ../profile.json)"
${coreutils}/bin/echo "profile.json:"
${coreutils}/bin/echo "- network_magic: ''${network_magic}"
${coreutils}/bin/echo "- slot_duration: ''${slot_duration}"
${coreutils}/bin/echo "- epoch_length: ''${epoch_length}"
${coreutils}/bin/echo "- active_slots_coeff: ''${active_slots_coeff}"
${coreutils}/bin/echo "- active_slots: ''${active_slots}"
${coreutils}/bin/echo "- with_explorer: ''${with_explorer}"
# Fetch all defined node names (Including "explorer" nodes)
###########################################################
Expand Down Expand Up @@ -191,9 +193,26 @@ let
done
else
# Seconds supervisor needs to consider the start successful
${coreutils}/bin/sleep 5
msg "Done, bye!"
# Producers only!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
############################# VOTING #############################
############################# VOTING #############################
############################# VOTING #############################
# If running supervisord (local only), only one healthcheck is run
# for all nodes, so sending to background and sleeping forever all
# but the last node on the list fits all backends for all
# producers to vote simultaneously.
for node in ''${nodes[*]} # nodes array is only deployed nodes!
do
if test "''${node}" = "''${nodes[-1]}"
then
workflow_producer "''${node}"
else
workflow_producer "''${node}" &
fi
done
############################# VOTING #############################
############################# VOTING #############################
############################# VOTING #############################
fi
}
Expand Down Expand Up @@ -223,7 +242,7 @@ let
# If the ping fails the whole script must fail!
${cardano-cli}/bin/cardano-cli ping \
--magic "''${network_magic}" \
--count 3 \
--count 1 \
--json \
--host "''${host}" \
--port "''${port}"
Expand Down Expand Up @@ -935,6 +954,20 @@ let
exit 22
}
######################################################################
# Conway/governance functions! #######################################
######################################################################
${if profile.generator.drep_voting or false
then
''
${import ./voting.nix {inherit pkgs profile nodeSpecs;}}
''
else
''
''
}
if test -n "''${NOMAD_DEBUG:-}"
then
DEBUG_FILE="$(${coreutils}/bin/dirname "$(${coreutils}/bin/readlink -f "$0")")"/"$0".debug
Expand Down
Loading

0 comments on commit 6b4fb12

Please sign in to comment.