-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli-gen-key.sh
More file actions
29 lines (20 loc) · 907 Bytes
/
cli-gen-key.sh
File metadata and controls
29 lines (20 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -o pipefail
#--------- Import common paths and functions ---------
source common-utils.sh
#--------- Verification ---------
# Verify correct number of arguments
if [[ "$#" -eq 0 ]]; then error "Missing parameters" && info "Usage: gen-key.sh <wallet-name> <stake-name> | gen-key.sh <wallet-name>"; exit 1; fi
# Get wallet name
wallet_name=${1}
#--------- Run program ---------
${cardanocli} address key-gen \
--verification-key-file ${key_path}/${wallet_name}.vkey \
--signing-key-file ${key_path}/${wallet_name}.skey
info "Keys ${wallet_name}.vkey and ${wallet_name}.skey saved in ${key_path}/"
if [[ -z ${2} ]]; then exit 0; fi
stake_name=${2}
${cardanocli} stake-address key-gen \
--verification-key-file ${key_path}/${stake_name}.vkey \
--signing-key-file ${key_path}/${stake_name}.skey
info "Keys ${stake_name}.vkey and ${stake_name}.skey saved in ${key_path}/"