Skip to content

VladislavKudrin/hydra-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Hydra scripts

This repository is meant to speed up the process of creating multiple nodes with peers for the same head, which can speed up the development proccess when you need to manage multiple nodes. This is not in any case a replacement for the standard process, which you should at least run through once to understand what is going on:

Prerequisites

  1. Cardano Node
  2. Hydra Node

Environment variables

Scripts need these environment variables to be defined:

  • HYDRA_NODE_VERSION - version from here
  • CARDANO_NODE_SOCKET_PATH
  • HNODEBIN - directory of binary executable for hydra node

Scripts

1. hydra-node.sh

Main script for creating the hydra node. It will fetch protocol parameters, if not provided in the data folder:

  • data/protocol-parameters.json
Parameter Description
--node-id <node-id> Node Id
--testnet-magic <number> or --mainnet Choose the network magic
--deposit-deadline <number> Deposit deadline for incemental commits
-s, --stop-node Stop the service
--zero-fees Set fees to zero in the head
-d, --deploy-systemd Deploy as systemd
-s, --stop-node Stop the service
all other paramters from hydra-node You can pass parameters defined in the official documentation

2. publish-reference-scripts.sh

Script for publishing reference scripts on chain that are needed for the hydra node creation. To publish a script, you should have enough ADA on the address from signing key to cover the costs (~30ADA). It saves reference script tx ids into: data/reference-scripts.json

Note: This script is essential if you are creating a hydra node on the private network (yaci-devkit)

Parameter Description
--node-id <node-id> Node Id
--testnet-magic <number> or --mainnet Choose the network magic
--signing-key-file <path> Path to the signing key

3. generate-credentials.sh

Script for generating node, hydra credentials (adds peers if specified). It saves the keys into: data/credentials/{node-id} You can also add credentials manually to the:

  • data/credentials/{node-id}/{node-id}-{hydra, node}.{sk, vk}
Parameter Description
--node-id <node-id> Node Id
--generate-wallet Generate wallet (funds account) for the node
--add-peer <host>:<node-port>:<api-host>:<api-port> Adding credentials to peers.json
--testnet-magic <number> or --mainnet Choose the network magic

Example usage:

Preprod:

  1. Change env file if needed, define CARDANO_NODE_SOCKET_PATH, HNODEBIN if not defined
  2. Run generate-credentials.sh --node-id vlad --add-peer 127.0.0.1:5001:127.0.0.1:4001
  3. Fund the address in data/vlad/vlad-node.addr
  4. If you want to add more peers: repeat steps 2 - 3 (diffetent ports, hosts and node-ids) until you are satisfied
  5. Run hydra-node.sh --node-id vlad
  6. If you have peers specified: repeat step 5 (different node-ids) to run your peer nodes

Private network:

  1. Change env file if needed, define CARDANO_NODE_SOCKET_PATH, HNODEBIN if not defined
  2. Don't forget to change --testnet-magic in the env file to your number
  3. Run generate-credentials.sh --node-id vlad --add-peer 127.0.0.1:5001:127.0.0.1:4001
  4. Fund the address in data/vlad/vlad-node.addr
  5. If you want to add more peers: repeat steps 3 - 4 (diffetent ports, hosts and node-ids) until you are satisfied
  6. Run publish-reference-scripts.sh --node-id vlad
  7. Run hydra-node.sh --node-id vlad
  8. If you have peers specified: repeat step 7 (different node-ids) to run your peer nodes

Notes

  1. Why peers cant be added on the fly (yet)
  2. Blockfrost for hydra (WIP)
  3. MeshJs SDK for hydra
  4. Why multiple heads per node are not available (yet)

Issues?

Visit Wiki - it can solve some common issues

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages