hydra icon indicating copy to clipboard operation
hydra copied to clipboard

Add tmux bootstraper for hydra demo

Open paluh opened this issue 3 years ago • 4 comments
trafficstars

This change adds a simple tmux bootstraping command run-hydra-demo to the nix-shell -A demo:

asciicast

I'm not sure if it is worth a merge - there are some rough edges and maintanance burden:

  • I have not implemented proper awaiting logic so instead of checking cardano-node socket readiness I just wait an arbitrary 1 second before spawning hydra-node's (same goes for hydra-node -> hydra-tui)

  • I've used Python instead of bash so it is another language in the stack (probably a bit better than Bash)

  • I can create a small separate public repo which provides this as a separate example - of course it won't be nicely integrated :-(

paluh avatar Aug 03 '22 07:08 paluh

@ch1bo This is minor somewhat related question. Do you think that we can parameterize ./prepare-devnet.sh so it can be run from different locations (even outside the hydra-poc):

if [ -n "$HYDRA_POC_SRC_DIR" ]; then
  BASEDIR="$HYDRA_POC_SRC_DIR";
else
  BASEDIR=...

?

Motivation: We can then use the devnet setup during our devel flow without additional clonning hydra-poc demo but using the appropriate source from /nix/store.

paluh avatar Aug 08 '22 09:08 paluh

@ch1bo This is minor somewhat related question. Do you think that we can parameterize ./prepare-devnet.sh so it can be run from different locations (even outside the hydra-poc):

if [ -n "$HYDRA_POC_SRC_DIR" ]; then
  BASEDIR="$HYDRA_POC_SRC_DIR";
else
  BASEDIR=...

?

Motivation: We can then use the devnet setup during our devel flow without additional clonning hydra-poc demo but using the appropriate source from /nix/store.

The BASEDIR should point to the source tree, wherever it is using the realpath and $0. What are you missing?

ch1bo avatar Aug 08 '22 09:08 ch1bo

After a second thought, I think that I should just copy and create our own local version of bootstraping script for our project setup and treat ./prepare-devnet.sh as internal hydra-poc script. Sorry for spamming.

paluh avatar Aug 08 '22 10:08 paluh

  • I've changed a bit the structure of the ./seed-devnet.sh so I expect both (or none) to be passed as arguments: cardano-cli and hydra-node. If that change could stay then I'm going clean it up and update the docs.

  • I've changed the structure of the run-tmux.py script so it is easier to follow and I removed the config layer.

  • I've updated the screencast in the first comment so I'm testing in it the latest version.

paluh avatar Aug 16 '22 15:08 paluh

Manually merged this now.

ch1bo avatar Aug 25 '22 17:08 ch1bo