7 changed files with 91 additions and 8 deletions
@ -0,0 +1,5 @@ |
|||
#!/bin/bash |
|||
|
|||
alias lncli='command lncli --lnddir=/relay/.lnd/ "$@"' |
|||
alias lnd='command lnd --lnddir=/relay/.lnd/ "$@"' |
|||
|
@ -0,0 +1,38 @@ |
|||
#!/usr/bin/expect -f |
|||
|
|||
set WALLET_PASSWORD [lindex $argv 0] |
|||
set WALLET_PASSPHRASE [lindex $argv 1] |
|||
|
|||
set force_conservative 0 ;# set to 1 to force conservative mode even if |
|||
;# script wasn't run conservatively originally |
|||
if {$force_conservative} { |
|||
set send_slow {1 .1} |
|||
proc send {ignore arg} { |
|||
sleep .1 |
|||
exp_send -s -- $arg |
|||
} |
|||
} |
|||
|
|||
set timeout -1 |
|||
spawn lncli --lnddir=/relay/.lnd/ create |
|||
match_max 100000 |
|||
expect -exact "Input wallet password: " |
|||
send -- "$WALLET_PASSWORD\r" |
|||
expect -exact "\r |
|||
Confirm password:\r |
|||
" |
|||
send -- "$WALLET_PASSWORD\r" |
|||
expect -exact "\r |
|||
\r |
|||
Do you have an existing cipher seed mnemonic you want to use? (Enter y/n): " |
|||
send -- "n\r" |
|||
expect -exact "n\r |
|||
\r |
|||
Your cipher seed can optionally be encrypted.\r |
|||
Input your passphrase if you wish to encrypt it (or press enter to proceed without a cipher seed passphrase): " |
|||
send -- "$WALLET_PASSPHRASE\r" |
|||
expect -exact "\r |
|||
Confirm password:\r |
|||
" |
|||
send -- "$WALLET_PASSPHRASE\r" |
|||
expect eof |
@ -1,6 +1,38 @@ |
|||
# export NODE_DOMAIN=$(curl $ECS_CONTAINER_METADATA_URI | echo $(jq -r .DockerName).$NODE_DOMAIN) |
|||
export NODE_DOMAIN=lvh.me |
|||
#!/bin/bash |
|||
|
|||
# turn on bash's job control |
|||
set -m |
|||
|
|||
echo "Setting ENV vars..." |
|||
export NODE_DOMAIN=$(curl $ECS_CONTAINER_METADATA_URI | echo $(jq -r .DockerName).$NODE_DOMAIN) |
|||
# export NODE_DOMAIN=lvh.me |
|||
export NODE_ALIAS=$HOSTNAME |
|||
export NODE_IP=$NODE_SCHEME://$NODE_DOMAIN |
|||
|
|||
/usr/bin/supervisord |
|||
echo "Starting supervisor..." |
|||
# Start the primary process and put it in the background |
|||
/usr/bin/supervisord & |
|||
|
|||
sleep 5 |
|||
|
|||
echo "Creating wallet..." |
|||
WALLET_PASSWORD=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c20) |
|||
WALLET_PASSPHRASE=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c20) |
|||
|
|||
echo $WALLET_PASSWORD >> /relay/.lnd/.lndpwd |
|||
echo $WALLET_PASSPHRASE >> /relay/.lnd/.lndpwd |
|||
|
|||
expect /relay/docker/create_wallet.sh $WALLET_PASSWORD $WALLET_PASSPHRASE >> /relay/.lnd/.tempseed |
|||
|
|||
sed -e '2,14d' < /relay/.lnd/.tempseed >> /relay/.lnd/.lndseed |
|||
|
|||
rm /relay/.lnd/.tempseed |
|||
|
|||
sleep 5 |
|||
|
|||
echo "Starting relay..." |
|||
supervisorctl start relay |
|||
|
|||
# now we bring the primary process back into the foreground |
|||
# and leave it there |
|||
fg %1 |
|||
|
@ -0,0 +1,3 @@ |
|||
#!/bin/bash |
|||
|
|||
alias nodessh='_nodessh(){ docker exec -it "$1" /bin/bash;}; _nodessh' |
Loading…
Reference in new issue