-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: docker validator support (#468)
- Loading branch information
Showing
9 changed files
with
96 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env bash | ||
########################################################## | ||
# # | ||
# This script encrypts your forging secret and password. # | ||
# # | ||
########################################################## | ||
|
||
type openssl >/dev/null 2>&1 || { echo >&2 "OpenSSL missing. Please install and run the script again."; exit 1; } | ||
|
||
yellow=$(tput setaf 3) | ||
green=$(tput setaf 2) | ||
lila=$(tput setaf 4) | ||
bold=$(tput bold) | ||
reset=$(tput sgr0) | ||
|
||
warning () | ||
{ | ||
echo " ${yellow}==>${reset}${bold} $1${reset}" | ||
} | ||
|
||
success () | ||
{ | ||
echo " ${green}==>${reset}${bold} $1${reset}" | ||
} | ||
|
||
read -sp "Please enter your delegate secret: " inputSecret | ||
echo | ||
|
||
while true; do | ||
read -sp "Please enter your password: " inputPass | ||
echo | ||
read -sp "Please enter password again: " inputPassA | ||
echo | ||
[ "${inputPass}" = "${inputPassA}" ] && break | ||
echo "Password do not match! Please try again." | ||
done | ||
|
||
SECRET="${inputSecret}" | ||
BIP38="${inputPass}" | ||
|
||
rm -rf enc > /dev/null 2>&1 | ||
mkdir enc; cd enc | ||
|
||
warning "Encrypting ..." | ||
|
||
openssl genrsa -out secret.key 2048 | ||
openssl rsa -in secret.key -out secret.pub -outform PEM -pubout | ||
echo "${SECRET}" | openssl pkeyutl -encrypt -inkey secret.pub -pubin -out secret.dat | ||
|
||
openssl genrsa -out bip.key 2048 | ||
openssl rsa -in bip.key -out bip.pub -outform PEM -pubout | ||
echo "${BIP38}" | openssl pkeyutl -encrypt -inkey bip.pub -pubin -out bip.dat | ||
|
||
success "Done! Created folder $(echo "${lila}enc${reset}") with all certificates and keys inside." | ||
success "You are now ready to run your docker $(echo "${yellow}validator node")." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
#relay: start a relay node only | ||
#validator: start a validator node | ||
MODE=relay | ||
TOKEN=ark | ||
NETWORK=testnet | ||
|
||
|