diff --git a/.gitignore b/.gitignore index 3be07f6..9098bbb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *-deployment *-spec.yml -output # Playbook vars *-vars.yml diff --git a/docs/run-first-validator.md b/docs/run-first-validator.md index b9af21d..052b755 100644 --- a/docs/run-first-validator.md +++ b/docs/run-first-validator.md @@ -7,6 +7,14 @@ ## Generate mainnet genesis file +- Get your private key from testnet deployment: + + ```bash + laconic-so deployment --dir exec laconicd "laconicd keys export --unarmored-hex --unsafe" + ``` + + NOTE: Store this key securely as it is needed in later steps + - Stop the node for SAPO testnet: ```bash @@ -63,15 +71,6 @@ ## Run node -- Get your private key from testnet deployment: - - ```bash - # Replace with the absolute path to the testnet deployment directory and with the name of your key - docker run -it \ - -v /data/laconicd-data:/root/.laconicd \ - cerc/laconicd:local bash -c "laconicd keys export --unarmored-hex --unsafe" - ``` - - Copy the example variables file if not already done: ```bash diff --git a/docs/run-validator.md b/docs/run-validator.md index f359113..5eec5e6 100644 --- a/docs/run-validator.md +++ b/docs/run-validator.md @@ -7,6 +7,14 @@ ## Run node +- Get your private key from testnet deployment: + + ```bash + laconic-so deployment --dir exec laconicd "laconicd keys export --unarmored-hex --unsafe" + ``` + + NOTE: Store this key securely as it is needed in later steps + - Stop the node for SAPO testnet: ```bash @@ -63,15 +71,6 @@ ## Create Validator -- Get your private key from testnet deployment: - - ```bash - # Replace with the absolute path to the testnet deployment directory and with the name of your key - docker run -it \ - -v /data/laconicd-data:/root/.laconicd \ - cerc/laconicd:local bash -c "laconicd keys export --unarmored-hex --unsafe" - ``` - - Export required env vars: ```bash diff --git a/stack-orchestrator/config/mainnet-laconicd/create-validator.sh b/stack-orchestrator/config/mainnet-laconicd/create-validator.sh index 639f7d6..e9c04aa 100755 --- a/stack-orchestrator/config/mainnet-laconicd/create-validator.sh +++ b/stack-orchestrator/config/mainnet-laconicd/create-validator.sh @@ -12,6 +12,16 @@ if [ ! -f "$staking_amount_file" ]; then exit 1 fi +if [-z "$KEY_NAME" ]; then + echo "KEY_NAME environment variable not set, exiting..." + exit 1 +fi + +if [ -z "$CERC_MONIKER" ]; then + echo "CERC_MONIKER environment variable not set, exiting..." + exit 1 +fi + # Set staking amount stake_amount=$(jq -r '.common_staking_amount' "$staking_amount_file")