From 96f00664f4b4deae8dbf394851b83f04513a7893 Mon Sep 17 00:00:00 2001 From: Mariano Conti Date: Thu, 15 Mar 2018 20:08:31 -0300 Subject: [PATCH] Add dapp key command to create wallets --- libexec/dapp/dapp---key | 27 +++++++++++++++++++++++++++ libexec/dapp/dapp-key | 2 ++ 2 files changed, 29 insertions(+) create mode 100755 libexec/dapp/dapp---key create mode 100755 libexec/dapp/dapp-key diff --git a/libexec/dapp/dapp---key b/libexec/dapp/dapp---key new file mode 100755 index 0000000..066c36b --- /dev/null +++ b/libexec/dapp/dapp---key @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +set -e + +OPTS="dapp key [] ... +dapp key --help +-- +keystore=path save path (default: ~/.ethereum/keystore) +password=file if not given, will prompt for password +" + +eval "$( + git rev-parse --parseopt -- "$@" <<<"$OPTS" || echo exit $? +)" + +while [[ $1 ]]; do + case $1 in + --) shift; break;; + --keystore) shift; ETH_KEYSTORE=$1;; + --password) shift; ETH_PASSWORD=$1;; + *) printf "${0##*/}: internal error: %q\\n" "$1"; exit 1 + esac; shift +done + +[[ $ETH_KEYSTORE ]] && args+=(--keystore "$ETH_KEYSTORE") +[[ $ETH_PASSWORD ]] && args+=(--password "$ETH_PASSWORD") + +geth account new "${args[@]}" diff --git a/libexec/dapp/dapp-key b/libexec/dapp/dapp-key new file mode 100755 index 0000000..fa81a8d --- /dev/null +++ b/libexec/dapp/dapp-key @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +dapp --nix-run go-ethereum-unlimited dapp --key "$@"